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


PHP Komento::joomlaVersion方法代码示例

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


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

示例1: display

 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $user = JFactory::getUser();
     $mainframe = JFactory::getApplication();
     if (Komento::joomlaVersion() >= '1.6') {
         if (!$user->authorise('komento.manage.pendings', 'com_komento')) {
             $mainframe->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             $mainframe->close();
         }
     }
     $filter_component = $mainframe->getUserStateFromRequest('com_komento.pending.filter_component', 'filter_component', '*', 'string');
     $search = $mainframe->getUserStateFromRequest('com_komento.pending.search', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     $order = $mainframe->getUserStateFromRequest('com_komento.pending.filter_order', 'filter_order', 'created', 'cmd');
     $orderDirection = $mainframe->getUserStateFromRequest('com_komento.pending.filter_order_Dir', 'filter_order_Dir', 'DESC', 'word');
     // Set Options
     $options['published'] = 2;
     $options['no_tree'] = 1;
     $options['no_child'] = 1;
     // Get data from the model
     $commentsModel = Komento::getModel('comments');
     $comments = $commentsModel->getData($options);
     $pagination = $commentsModel->getPagination();
     $this->assignRef('comments', $comments);
     $this->assignRef('pagination', $pagination);
     $this->assign('search', $search);
     $this->assign('order', $order);
     $this->assign('orderDirection', $orderDirection);
     $this->assign('component', $this->getComponentState($filter_component));
     $this->assign('columns', Komento::getConfig('com_komento_pending_columns', false));
     $this->assign('columnCount', 2);
     parent::display($tpl);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:34,代码来源:view.html.php

示例2: registerToolbar

 function registerToolbar()
 {
     $parentId = JRequest::getVar('parentid', 0);
     // JToolBarHelper::title( text, iconfilename )
     if ($parentId) {
         if ($parentId) {
             $parent = Komento::getTable('comments');
             $parent->load($parentId);
         }
         JToolBarHelper::title(JText::_('COM_KOMENTO_COMMENTS_TITLE_CHILD_OF') . $parentId, 'comments');
         JToolBarHelper::back(JText::_('COM_KOMENTO_BACK'), 'index.php?option=com_komento&view=comments&parentid=' . $parent->parent_id);
     } else {
         JToolBarHelper::title(JText::_('COM_KOMENTO_COMMENTS_TITLE'), 'comments');
         JToolBarHelper::back(JText::_('COM_KOMENTO_ADMIN_HOME'), 'index.php?option=com_komento');
     }
     JToolBarHelper::divider();
     if (Komento::joomlaVersion() >= '3.0') {
         JToolBarHelper::custom('stick', 'star', '', JText::_('COM_KOMENTO_STICK'));
         JToolBarHelper::custom('unstick', 'star-empty', '', JText::_('COM_KOMENTO_UNSTICK'));
     } else {
         JToolBarHelper::custom('stick', 'kmt-stick', '', JText::_('COM_KOMENTO_STICK'));
         JToolBarHelper::custom('unstick', 'kmt-unstick', '', JText::_('COM_KOMENTO_UNSTICK'));
     }
     JToolBarHelper::divider();
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     JToolBarHelper::divider();
     JToolBarHelper::deleteList();
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:29,代码来源:view.html.php

示例3: __construct

	public function __construct()
	{
		$version 	= Komento::joomlaVersion();
		$className	= $version >= '2.5' ? 'KomentoDatabaseJoomla30' : 'KomentoDatabaseJoomla15';

		$this->helper 	= new $className();
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:database.php

示例4: form

 public function form($tpl = null)
 {
     $user = JFactory::getUser();
     $mainframe = JFactory::getApplication();
     if (Komento::joomlaVersion() >= '1.6') {
         if (!$user->authorise('komento.manage.acl', 'com_komento')) {
             $mainframe->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             $mainframe->close();
         }
     }
     $component = JRequest::getString('component', '');
     if ($component == '') {
         $mainframe->redirect('index.php?option=com_komento&view=acl');
     }
     $components = $this->getComponentState($component);
     $id = $mainframe->getUserStateFromRequest('com_komento.acl.id', 'id', '0');
     $type = JRequest::getCmd('type', 'usergroup');
     $usergroups = '';
     if ($type == 'usergroup') {
         $usergroups = $this->getUsergroupState($id);
     }
     $type = JRequest::getCmd('type');
     $id = JRequest::getInt('id');
     $model = Komento::getModel('acl', true);
     $model->updateUserGroups($component);
     $rulesets = $model->getData($component, $type, $id);
     $this->assignRef('rulesets', $rulesets);
     $this->assignRef('component', $component);
     $this->assignRef('components', $components);
     $this->assignRef('type', $type);
     $this->assignRef('id', $id);
     $this->assignRef('usergroups', $usergroups);
     parent::display($tpl);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:34,代码来源:view.html.php

示例5: __construct

 public function __construct($config = array())
 {
     $document = JFactory::getDocument();
     //load dialog stylesheet in backend
     KomentoDocumentHelper::loadHeaders();
     $config = Komento::getConfig();
     $konfig = Komento::getKonfig();
     $toolbar = JToolbar::getInstance('toolbar');
     $toolbar->addButtonPath(KOMENTO_ADMIN_ROOT . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images');
     if ($document->getType() == 'html') {
         require_once KOMENTO_CLASSES . DIRECTORY_SEPARATOR . 'configuration.php';
         $configuration = KomentoConfiguration::getInstance();
         $configuration->attach();
     }
     $version = str_ireplace('.', '', Komento::komentoVersion());
     $document->addScript(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/js/admin.js?' . $version);
     $document->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/css/reset.css?' . $version);
     $document->addStyleSheet(rtrim(JURI::root(), '/') . '/components/com_komento/assets/css/common.css?' . $version);
     $document->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/css/style.css?' . $version);
     // For the sake of loading the core.js in Joomla 1.6 (1.6.2 onwards)
     if (Komento::joomlaVersion() >= '1.6') {
         JHTML::_('behavior.framework');
     }
     parent::__construct($config);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:25,代码来源:controller.php

示例6: toFormat

	public function toFormat( $format='%Y-%m-%d %H:%M:%S' )
	{
		if( Komento::joomlaVersion() >= '3.0' )
		{
			if( JString::stristr( $format, '%' ) !== false )
			{
				Komento::import( 'helper', 'date' );
				$format = KomentoDateHelper::strftimeToDate( $format );
			}

			return $this->date->format( $format, true );
		}
		else
		{
			// There is no way to have cross version working, except for detecting % in the format
			if( JString::stristr( $format , '%' ) === false )
			{
				if( Komento::isJoomla15() )
				{
					// forced fallback for Joomla 15 if format doesn't have %
					$format = '%c';
				}
				else
				{
					return $this->date->format( $format , true );
				}

			}

			return $this->date->toFormat( $format, true );
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:date.php

示例7: display

 function display($tpl = null)
 {
     $user = JFactory::getUser();
     $mainframe = JFactory::getApplication();
     if (Komento::joomlaVersion() >= '1.6') {
         if (!$user->authorise('komento.manage.migrators', 'com_komento')) {
             $mainframe->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             $mainframe->close();
         }
     }
     parent::display($tpl);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:12,代码来源:view.html.php

示例8: addButton

    public function addButton($link, $image, $text, $description = '', $newWindow = false, $acl = '', $notification = 0)
    {
        if (!empty($acl) && Komento::joomlaVersion() >= '1.6') {
            if (!JFactory::getUser()->authorise('komento.manage.' . $acl, 'com_komento')) {
                return '';
            }
        }
        $target = $newWindow ? ' target="_blank"' : '';
        $bubble = $notification > 0 ? '<b>' . $notification . '</b>' : '';
        ?>
	<li>
		<a href="<?php 
        echo $link;
        ?>
"<?php 
        echo $target;
        ?>
>
			<img src="<?php 
        echo JURI::root();
        ?>
administrator/components/com_komento/assets/images/cpanel/<?php 
        echo $image;
        ?>
" width="32" />
			<span class="item-title">
				<span><?php 
        echo $text;
        ?>
</span>
				<?php 
        if ($notification > 0) {
            ?>
					<b><?php 
            echo $notification;
            ?>
</b>
				<?php 
        }
        ?>
			</span>
		</a>
		<div class="item-description">
			<div class="tipsArrow"></div>
			<div class="tipsBody"><?php 
        echo $description;
        ?>
</div>
		</div>
	</li>
<?php 
    }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:52,代码来源:view.html.php

示例9: getTheme

 /**
  * Determines if needed to load the bootstrap or joomla version
  * of the theme file.
  *
  * @since	3.7
  * @access	public
  * @author	Mark Lee <mark@stackideas.com>
  */
 public function getTheme()
 {
     $version = Komento::joomlaVersion();
     if ($version >= '3.0') {
         JHtmlSidebar::addEntry(JText::_('COM_TEMPLATES_SUBMENU_STYLES'), 'index.php?option=com_templates&view=styles', true);
         JHtmlSidebar::addEntry(JText::_('COM_TEMPLATES_SUBMENU_TEMPLATES'), 'index.php?option=com_templates&view=templates', false);
         if (method_exists($this, 'addSidebar')) {
             $this->addSidebar();
         }
         return 'bootstrap';
     }
     return 'joomla';
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:21,代码来源:views.php

示例10: getCategories

 public function getCategories()
 {
     $db = Komento::getDBO();
     $query = 'SELECT a.id, a.title, a.level, a.parent_id' . ' FROM `#__categories` AS a' . ' WHERE a.extension = ' . $db->quote('com_content') . ' AND a.parent_id > 0' . ' ORDER BY a.lft';
     if (Komento::joomlaVersion() == '1.5') {
         $query = 'SELECT a.id, a.title' . ' FROM `#__categories` AS a' . ' ORDER BY a.ordering';
     }
     $db->setQuery($query);
     $categories = $db->loadObjectList();
     if (Komento::joomlaVersion() >= '1.6') {
         foreach ($categories as &$row) {
             $repeat = $row->level - 1 >= 0 ? $row->level - 1 : 0;
             $row->treename = str_repeat('.&#160;&#160;&#160;', $repeat) . ($row->level - 1 > 0 ? '|_&#160;' : '') . $row->title;
         }
     }
     return $categories;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:17,代码来源:com_tz_portfolio.php

示例11: __construct

	/**
	 * Creates a new instance of the Joomla parser.
	 *
	 * @since	1.0
	 * @access	public
	 */
	public function __construct( $contents = '' , $isFile = false )
	{
		$this->version 	= Komento::joomlaVersion();

		if( $this->version >= '3.0' )
		{
			$parser 	= JFactory::getXML( $contents , $isFile );
		}
		else
		{
			$parser 	= JFactory::getXMLParser( 'Simple' );
			$parser->loadString( $contents );
		}

		$this->parser 	= $parser;

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

示例12: __construct

	public function __construct()
	{
		$konfig = Komento::getKonfig();
		$config = Komento::getConfig();

		// @legacy: If environment is set to production, change to static.
		$environment = $konfig->get('komento_environment');
		if ($environment=='production') {
			$environment='static';
		}

		$this->fullName		= 'Komento';
		$this->shortName	= 'kmt';
		$this->environment	= $environment;
		$this->mode			= $konfig->get('komento_mode');
		$this->version		= (string) Komento::getHelper( 'Version' )->getLocalVersion();
		$this->baseUrl		= Komento::getHelper( 'Document' )->getBaseUrl();
		$this->token		= Komento::_( 'getToken' );

		$newConfig = clone $config->toObject();
		$newKonfig = clone $konfig->toObject();

		unset( $newConfig->antispam_recaptcha_private_key );
		unset( $newConfig->antispam_recaptcha_public_key );
		unset( $newConfig->antispam_akismet_key );
		unset( $newConfig->layout_phpbb_path );
		unset( $newConfig->layout_phpbb_url );
		unset( $newKonfig->layout_phpbb_path );
		unset( $newKonfig->layout_phpbb_url );

		$this->options     = array(
			"responsive"	=> (bool) $config->get('enable_responsive'),
			"jversion"		=> Komento::joomlaVersion(),
			"spinner"		=> JURI::root() . 'media/com_komento/images/loader.gif',
			"view"			=> JRequest::getString( 'view', '' ),
			"guest"			=> Komento::getProfile()->guest ? 1 : 0,
			"config"		=> $newConfig,
			"konfig"		=> $newKonfig,
			"acl"			=> Komento::getACL(),
			"element"		=> new stdClass()
		);

		parent::__construct();
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:44,代码来源:configuration.php

示例13: __construct

	public function __construct()
	{
		$this->plugin = strtolower( str_replace( 'KomentoHelper', '', get_class( $this ) ) );

		$this->pluginpath = JPATH_ROOT . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'komento';
		$this->pluginbase = rtrim( JURI::root(), '/' ) . '/plugins/komento';

		if( Komento::joomlaVersion() >= '1.6' )
		{
			$this->pluginpath .= DIRECTORY_SEPARATOR . $this->plugin;
			$this->pluginbase .= '/' . $this->plugin;
		}

		// load plugin language
		JFactory::getLanguage()->load( 'plg_komento_' . $this->plugin, JPATH_ROOT );

		// load plugin params
		$this->params = Komento::getRegistry( JPluginHelper::getPlugin( 'komento', $this->plugin )->params );
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:19,代码来源:plugin.php

示例14: registerToolbar

 public function registerToolbar()
 {
     // Set the titlebar text
     JToolBarHelper::title(JText::_('COM_KOMENTO'), 'home');
     if (Komento::joomlaVersion() >= '1.6') {
         JToolBarHelper::preferences('com_komento');
     }
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:8,代码来源:view.html.php

示例15: getEditorList

 public function getEditorList($selected)
 {
     $db = Komento::getDBO();
     // compile list of the editors
     if (Komento::joomlaVersion() >= '1.6') {
         $query = 'SELECT `element` AS value, `name` AS text' . ' FROM `#__extensions`' . ' WHERE `folder` = "editors"' . ' AND `type` = "plugin"' . ' AND `enabled` = 1' . ' ORDER BY ordering, name';
     } else {
         $query = 'SELECT element AS value, name AS text' . ' FROM #__plugins' . ' WHERE folder = "editors"' . ' AND published = 1' . ' ORDER BY ordering, name';
     }
     //echo $query;
     $db->setQuery($query);
     $editors = $db->loadObjectList();
     if (count($editors) > 0) {
         if (Komento::joomlaVersion() >= '1.6') {
             $lang = JFactory::getLanguage();
             for ($i = 0; $i < count($editors); $i++) {
                 $editor = $editors[$i];
                 $lang->load($editor->text . '.sys', JPATH_ADMINISTRATOR, null, false, false);
                 $editor->text = JText::_($editor->text);
             }
         }
     }
     // temporary. remove when wysiwyg editors are ready
     $editors = array();
     $bbcode = new stdClass();
     $bbcode->value = 'bbcode';
     $bbcode->text = JText::_('COM_KOMENTO_EDITOR_BBCODE');
     $none = new stdClass();
     $none->value = 'none';
     $none->text = JText::_('COM_KOMENTO_EDITOR_NONE');
     $editors[] = $bbcode;
     $editors[] = $none;
     return JHTML::_('select.genericlist', $editors, 'form_editor', 'class="inputbox" size="1"', 'value', 'text', $selected);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:34,代码来源:view.html.php


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