当前位置: 首页>>代码示例>>PHP>>正文


PHP Komento::getTheme方法代码示例

本文整理汇总了PHP中Komento::getTheme方法的典型用法代码示例。如果您正苦于以下问题:PHP Komento::getTheme方法的具体用法?PHP Komento::getTheme怎么用?PHP Komento::getTheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Komento的用法示例。


在下文中一共展示了Komento::getTheme方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAjaxTemplate

 public function getAjaxTemplate()
 {
     $files = JRequest::getVar('names', '');
     if (empty($files)) {
         return false;
     }
     // Ensure the integrity of each items submitted to be an array.
     if (!is_array($files)) {
         $files = array($files);
     }
     $result = array();
     foreach ($files as $file) {
         $template = Komento::getTheme();
         $out = $template->fetch($file . '.ejs');
         $obj = new stdClass();
         $obj->name = $file;
         $obj->content = $out;
         $result[] = $obj;
     }
     Komento::getClass('json', 'KomentoJson');
     header('Content-type: text/x-json; UTF-8');
     $json = new KomentoJson();
     echo $json->encode($result);
     exit;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:25,代码来源:themes.php

示例2: loadForm

	public static function loadForm( $id, $component, $options = array() )
	{
		$theme	= Komento::getTheme();
		$html	= $theme->fetch( 'comment/form.php' );

		echo $html;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:api.php

示例3: display

	function display($tmpl = null)
	{
		$mainframe = JFactory::getApplication();
		$commentsModel = Komento::getModel( 'comments' );

		$cid = JRequest::getVar( 'cid', 'all' );

		$filter['component']	= $mainframe->getUserStateFromRequest( 'com_komento.pending.filter_component', 'filter-component', 'all', 'string' );
		$filter['sort']			= $mainframe->getUserStateFromRequest( 'com_komento.pending.filter_sort', 'filter-sort', 'latest', 'string' );
		$filter['search']		= trim( JString::strtolower( $mainframe->getUserStateFromRequest( 'com_komento.pending.filter_search', 'filter-search', '', 'string' ) ) );

		$options = array(
			'limit'		=> 0,
			'sort'		=> $filter['sort'],
			'search'	=> $filter['search'],
			'published'	=> 2,
			'threaded'	=> 0
		);

		$comments = $commentsModel->getComments( $filter['component'], $cid, $options );
		$pagination = $commentsModel->getPagination();
		$components = $commentsModel->getUniqueComponents();

		$theme = Komento::getTheme();
		$theme->set( 'components', $components );
		$theme->set( 'pagination', $pagination );
		$theme->set( 'comments', $comments );
		$theme->set( 'filter', $filter );

		echo $theme->fetch('dashboard/pending.php');
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:view.html.php

示例4: getResource

 public function getResource()
 {
     $resources = JRequest::getVar('resource');
     $component = JRequest::getCmd('kmtcomponent');
     Komento::setCurrentComponent($component);
     if (!is_array($resources)) {
         header('Content-type: text/x-json; UTF-8');
         echo '[]';
         exit;
     }
     foreach ($resources as &$resource) {
         $resource = (object) $resource;
         switch ($resource->type) {
             case 'language':
                 $resource->content = JText::_(strtoupper($resource->name));
                 break;
             case 'view':
                 $template = Komento::getTheme();
                 $out = $template->fetch($resource->name . '.ejs');
                 if ($out !== false) {
                     $resource->content = $out;
                 }
                 break;
         }
     }
     Komento::getClass('json', 'KomentoJson');
     header('Content-type: text/x-json; UTF-8');
     $json = new KomentoJson();
     echo $json->encode($resources);
     exit;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:31,代码来源:foundry.php

示例5: getHTML

	public function getHTML()
	{
		$captcha			= Komento::getTable( 'Captcha', 'KomentoTable' );
		$captcha->created	= Komento::getDate()->toMySQL();
		$captcha->store();

		$theme		= Komento::getTheme();
		$theme->set( 'id' , $captcha->id );
		$theme->set( 'url', $this->getCaptchaUrl( $captcha->id ) );
		return $theme->fetch( 'comment/captcha.php' );
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:11,代码来源:captcha.php

示例6: display

 public function display($tpl = null)
 {
     $konfig = Komento::getKonfig();
     $id = JRequest::getInt('id', 0);
     // @task: If profiles are disabled, do not show the profile here.
     if (!$konfig->get('profile_enable')) {
         $app = JFactory::getApplication();
         $app->redirect('index.php', JText::_('COM_KOMENTO_PROFILE_SYSTEM_DISABLED'));
         $app->close();
     }
     $profileModel = Komento::getModel('Profile');
     $activityModel = Komento::getModel('Activity');
     $commentsModel = Komento::getModel('Comments');
     $actionsModel = Komento::getModel('Actions');
     $count = new stdClass();
     $user = JFactory::getUser();
     if ($id === 0 && $user->id > 0) {
         $id = $user->id;
     }
     // Block non-exists profile
     if (!$profileModel->exists($id)) {
         echo JText::_('COM_KOMENTO_PROFILE_NOT_FOUND');
         return;
     }
     // TODO: Block custom profile id
     // ..
     $profile = Komento::getProfile($id);
     // $activities		= $activityModel->getUserActivities( $profile->id );
     $count->totalComments = $commentsModel->getTotalComment($profile->id);
     $count->likesReceived = $actionsModel->getLikesReceived($profile->id);
     $count->likesGiven = $actionsModel->getLikesGiven($profile->id);
     // Set Pathway
     // Check if Komento profile menu item exist before setting profile pathway
     $app = JFactory::getApplication();
     $menu = $app->getMenu();
     $item = $menu->getActive();
     if (empty($item) || $item->query['view'] != 'profile') {
         $this->setPathway(JText::_('COM_KOMENTO_PROFILE'), '');
     }
     $this->setPathway($profile->getName(), '');
     // Set browser title
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_KOMENTO_USER_PROFILE') . ' - ' . $profile->getName());
     // set component to com_komento
     Komento::setCurrentComponent('com_komento');
     $theme = Komento::getTheme();
     $theme->set('profile', $profile);
     $theme->set('count', $count);
     // $theme->set( 'activities', $activities );
     echo $theme->fetch('profile/profile.php');
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:51,代码来源:view.html.php

示例7: getView

 public function getView($name)
 {
     // Due to compatibility, we had to append komento/ infront of the views, but we do not want this when fetching template
     if (strpos('komento/', $name) >= 0) {
         $name = substr($name, 8);
     }
     $template = Komento::getTheme();
     $out = $template->fetch($name . '.ejs');
     $contents = '';
     if ($out !== false) {
         $contents = $out;
     }
     return $contents;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:14,代码来源:foundry.php

示例8: getHTML

 public function getHTML()
 {
     $template = Komento::getTheme();
     $config = Komento::getConfig();
     $publicKey = $config->get('antispam_recaptcha_public_key');
     $language = $config->get('antispam_recaptcha_lang', 'en');
     $theme = $config->get('antispam_recaptcha_theme', 'clean');
     $server = $config->get('antispam_recaptcha_ssl') ? self::RECAPTCHA_API_SECURE_SERVER : self::RECAPTCHA_API_SERVER;
     $template->set('server', $server);
     $template->set('publicKey', $publicKey);
     $template->set('language', $language);
     $template->set('theme', $theme);
     // Use AJAX method to prevent operation aborted problems with IE
     return $template->fetch('comment/recaptcha.php');
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:15,代码来源:recaptcha.php

示例9: defined

 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
defined('_JEXEC') or die('Restricted access');
if ($system->config->get('enable_reply_reference') && $row->parent_id != 0) {
    ?>
<span class="inReplyTo kmt-inreplyto">
	<?php 
    if ($system->config->get('enable_threaded')) {
        $name = '';
        $parent = Komento::getComment($row->parent_id, true);
        echo JText::sprintf('COM_KOMENTO_COMMENT_IN_REPLY_TO_NAME', $row->parentlink, $parent->name);
        // echo JText::sprintf( 'COM_KOMENTO_COMMENT_IN_REPLY_TO_NAME', $row->parentlink, $parent->name );
    } else {
        // non threaded no need to show name, because will have parent comment as a popup when hover over comment id
        echo JText::sprintf('COM_KOMENTO_COMMENT_IN_REPLY_TO', $row->parentlink, $row->parent_id);
        // echo JText::sprintf( 'COM_KOMENTO_COMMENT_IN_REPLY_TO', $row->parentlink, $row->parent_id );
    }
    $parent = '';
    if ($system->konfig->get('parent_preload')) {
        $parent = Komento::getComment($row->parent_id);
    }
    $parentTheme = Komento::getTheme(true);
    $parentTheme->set('parent', $parent);
    echo $parentTheme->fetch('comment/item/parent.php');
    ?>
</span>
<?php 
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:31,代码来源:inreplyto.php

示例10: commentify


//.........这里部分代码省略.........
     if ($config->get('notification_sendmailonpageload')) {
         self::getMailQueue()->sendOnPageLoad();
     }
     // @task: clear captcha database
     if ($konfig->get('database_clearcaptchaonpageload')) {
         self::clearCaptcha();
     }
     // @task: load necessary css and javascript files.
     self::getHelper('Document')->loadHeaders();
     /**********************************************/
     // Run Komento!
     $commentsModel = Komento::getModel('comments');
     $comments = '';
     $return = false;
     $commentCount = $commentsModel->getCount($component, $cid);
     // Get total ratings
     $ratings = $commentsModel->getOverallRatings($component, $cid);
     $totalRating = 0;
     $totalRatingCount = 0;
     if ($ratings) {
         $totalRating = $ratings->value;
         $totalRatingCount = $ratings->total;
     }
     if ($application->isListingView()) {
         $html = '';
         if (!array_key_exists('skipBar', $options)) {
             $commentOptions = array();
             $commentOptions['threaded'] = 0;
             $commentOptions['limit'] = $config->get('preview_count', '3');
             $commentOptions['sort'] = $config->get('preview_sort', 'latest');
             $commentOptions['parentid'] = $config->get('preview_parent_only', false) ? 0 : 'all';
             $commentOptions['sticked'] = $config->get('preview_sticked_only', false) ? true : 'all';
             if ($commentOptions['sort'] == 'popular') {
                 $comments = $commentsModel->getPopularComments($component, $cid, $commentOptions);
             } else {
                 $comments = $commentsModel->getComments($component, $cid, $commentOptions);
             }
             $theme = Komento::getTheme();
             $theme->set('commentCount', $commentCount);
             $theme->set('componentHelper', $application);
             $theme->set('component', $component);
             $theme->set('cid', $cid);
             $theme->set('comments', $comments);
             $theme->set('article', $article);
             $html = $theme->fetch('comment/bar.php');
         }
         $return = $application->onExecute($article, $html, 'listing', $options);
     }
     if ($application->isEntryView()) {
         // check for escaped_fragment (google ajax crawler)
         $fragment = JRequest::getVar('_escaped_fragment_', '');
         if ($fragment != '') {
             $tmp = explode('=', $fragment);
             $fragment = array($tmp[0] => $tmp[1]);
             if (isset($fragment['kmt-start'])) {
                 $options['limitstart'] = $fragment['kmt-start'];
             }
         } else {
             // Sort comments oldest first by default.
             if (!isset($options['sort'])) {
                 $options['sort'] = JRequest::getVar('kmt-sort', $config->get('default_sort'));
             }
             if ($config->get('load_previous')) {
                 $options['limitstart'] = $commentCount - $config->get('max_comments_per_page');
                 if ($options['limitstart'] < 0) {
                     $options['limitstart'] = 0;
                 }
             }
         }
         $options['threaded'] = $config->get('enable_threaded');
         $profile = Komento::getProfile();
         $my = JFactory::getUser();
         if (!$profile->allow('read_others_comment')) {
             $options['userid'] = $my->id;
         }
         if ($profile->allow('read_comment')) {
             $comments = $commentsModel->getComments($component, $cid, $options);
         }
         $contentLink = $application->getContentPermalink();
         $theme = Komento::getTheme();
         $theme->set('totalRating', $totalRating);
         $theme->set('totalRatingCount', $totalRatingCount);
         $theme->set('component', $component);
         $theme->set('cid', $cid);
         $theme->set('comments', $comments);
         $theme->set('options', $options);
         $theme->set('componentHelper', $application);
         $theme->set('application', $application);
         $theme->set('commentCount', $commentCount);
         $theme->set('contentLink', $contentLink);
         $html = $theme->fetch('comment/box.php');
         /* [KOMENTO_POWERED_BY_LINK] */
         // free version powered by link append (for reference only)
         // $html	.= '<div style="text-align: center; padding: 20px 0;"><a href="http://stackideas.com">' . JText::_( 'COM_KOMENTO_POWERED_BY_KOMENTO' ) . '</a></div>';
         $return = $application->onExecute($article, $html, 'entry', $options);
         // @task: Append hidden token into the page.
         $return .= '<span id="komento-token" style="display:none;"><input type="hidden" name="' . Komento::_('getToken') . '" value="1" /></span>';
     }
     return $return;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:101,代码来源:helper.php

示例11: getTemplateBuffer

	public function getTemplateBuffer( $template, $data, $params = array() )
	{
		$theme	= Komento::getTheme();

		foreach( $data as $key => $val )
		{
			$theme->set( $key , $val );
		}

		$document = JFactory::getDocument();

		$theme->set( 'data', $data );
		$theme->set( 'options', $params );
		$theme->set( 'document', $document );

		$contents	= $theme->fetch( $template );

		return $contents;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:19,代码来源:notification.php

示例12: getResourcesSettings

	public function getResourcesSettings()
	{
		$config 	= Komento::getConfig();

		// Build a deterministic cache
		$settings = array(
							"language"	=> JFactory::getLanguage()->getTag(),
							"template"	=> array(
													"site"   => $config->get( 'layout_theme' )
											),
							"view"		=> array(),
							"modified"	=> filemtime($this->resourceManifestFile)
							);

		// Get manifest
		$manifest = $this->getResourcesManifest();

		if(isset($manifest[0]->view) && $manifest[0]->view)
		{
			foreach ($manifest[0]->view as $view)
			{
				$theme 		= Komento::getTheme();
				$path 		= $theme->resolve( $view . '.ejs' );

				// If the file still does not exist, we'll skip this
				if (!JFile::exists($path))
				{
					continue;
				}

				$settings["view"][] = array(
					"path"     => str_ireplace(JPATH_ROOT, '', $path),
					"modified" => filemtime($path)
				);
			}
		}

		// Build hash
		$settings["id"] = md5(serialize($settings));

		return $settings;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:42,代码来源:compiler.php

示例13: getSubscribeContent

	public function getSubscribeContent()
	{
		$component = JRequest::getCmd( 'component' );
		$cid = JRequest::getCmd( 'cid' );

		$user = Komento::getProfile();

		$subscribed = null;

		if( !$user->guest )
		{
			$subscriptionModel = Komento::getModel( 'subscription' );
			$subscribed = $subscriptionModel->checkSubscriptionExist( $component, $cid, $user->id );
		}

		$html = '';

		$theme = Komento::getTheme();
		$theme->set( 'my', $user );
		$theme->set( 'subscribed', $subscribed );

		$html = $theme->fetch( 'dialogs/subscribe.email.php' );

		$ajax = Komento::getAjax();

		$ajax->success( $html );
		$ajax->send();
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:28,代码来源:view.ajax.php

示例14: getStickedComments

	function getStickedComments()
	{
		$loadMore = JRequest::getInt( 'loadMore', 0 );

		$ajax = Komento::getAjax();
		$model = Komento::getModel( 'comments' );

		$uid = JRequest::getInt( 'uid' );
		$start = JRequest::getInt( 'start', 0 );
		$limit = JRequest::getInt( 'limit', 10 );

		$options = array(
			'limitstart'	=> $start,
			'limit'			=> $limit,
			'userid'		=> $uid,
			'sticked'		=> 1,
			'threaded'		=> 0,
			'sort'			=> 'latest'
			);

		$comments = $model->getComments( 'all', 'all', $options );
		$total = '';

		if( !$loadMore )
		{
			$total = $model->getCount( 'all', 'all', $options );
		}

		$count = count( $comments );

		$theme = Komento::getTheme();
		$theme->set( 'items', $comments );
		$theme->set( 'total', $total );
		$html = '';

		if( $loadMore )
		{
			$html = $theme->fetch( 'profile/sticked/list.php' );
		}
		else
		{
			$html = $theme->fetch( 'profile/sticked.php' );
		}

		$ajax->success( $html, $count, $total);
		$ajax->send();
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:47,代码来源:view.ajax.php


注:本文中的Komento::getTheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。