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


PHP FinderHelperLanguage::isMultiLanguage方法代码示例

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


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

示例1: select

 /**
  * Method to generate filters using select box drop down controls.
  *
  * @param   FinderIndexerQuery  $query    A FinderIndexerQuery object.
  * @param   array               $options  An array of options.
  *
  * @return  mixed  A rendered HTML widget on success, null otherwise.
  *
  * @since   2.5
  */
 public static function select($query, $options)
 {
     $user = JFactory::getUser();
     $groups = implode(',', $user->getAuthorisedViewLevels());
     $filter = null;
     // Get the configuration options.
     $classSuffix = $options->get('class_suffix', null);
     $loadMedia = $options->get('load_media', true);
     $showDates = $options->get('show_date_filters', false);
     // Try to load the results from cache.
     $cache = JFactory::getCache('com_finder', '');
     $cacheId = 'filter_select_' . serialize(array($query->filter, $options, $groups, JFactory::getLanguage()->getTag()));
     // Check the cached results.
     if (!($branches = $cache->get($cacheId))) {
         $db = JFactory::getDBO();
         $sql = $db->getQuery(true);
         // Load the predefined filter if specified.
         if (!empty($query->filter)) {
             $sql->select($db->quoteName('f') . '.' . $db->quoteName('data') . ', ' . $db->quoteName('f') . '.' . $db->quoteName('params'));
             $sql->from($db->quoteName('#__finder_filters') . ' AS f');
             $sql->where($db->quoteName('f') . '.' . $db->quoteName('filter_id') . ' = ' . (int) $query->filter);
             // Load the filter data.
             $db->setQuery($sql);
             $filter = $db->loadObject();
             // Check for an error.
             if ($db->getErrorNum()) {
                 return null;
             }
             // Initialize the filter parameters.
             if ($filter) {
                 $registry = new JRegistry();
                 $registry->loadString($filter->params);
                 $filter->params = $registry;
             }
         }
         // Build the query to get the branch data and the number of child nodes.
         $sql->clear();
         $sql->select('t.*, count(c.id) AS children');
         $sql->from($db->quoteName('#__finder_taxonomy') . ' AS t');
         $sql->join('INNER', $db->quoteName('#__finder_taxonomy') . ' AS c ON c.parent_id = t.id');
         $sql->where($db->quoteName('t') . '.' . $db->quoteName('parent_id') . ' = 1');
         $sql->where($db->quoteName('t') . '.' . $db->quoteName('state') . ' = 1');
         $sql->where($db->quoteName('t') . '.' . $db->quoteName('access') . ' IN (' . $groups . ')');
         $sql->where($db->quoteName('c') . '.' . $db->quoteName('state') . ' = 1');
         $sql->where($db->quoteName('t') . '.' . $db->quoteName('access') . ' IN (' . $groups . ')');
         $sql->group($db->quoteName('t') . '.' . $db->quoteName('id'));
         $sql->order('t.ordering, t.title');
         // Limit the branch children to a predefined filter.
         if (!empty($filter->data)) {
             $sql->where('c.id IN(' . $filter->data . ')');
         }
         // Load the branches.
         $db->setQuery($sql);
         $branches = $db->loadObjectList('id');
         // Check for an error.
         if ($db->getErrorNum()) {
             return null;
         }
         // Check that we have at least one branch.
         if (count($branches) === 0) {
             return null;
         }
         // Iterate through the branches and build the branch groups.
         foreach ($branches as $bk => $bv) {
             // If the multi-lang plug-in is enabled then drop the language branch.
             if ($bv->title == 'Language' && FinderHelperLanguage::isMultiLanguage()) {
                 continue;
             }
             // Build the query to get the child nodes for this branch.
             $sql->clear();
             $sql->select('t.*');
             $sql->from($db->quoteName('#__finder_taxonomy') . ' AS t');
             $sql->where($db->quoteName('t') . '.' . $db->quoteName('parent_id') . ' = ' . (int) $bk);
             $sql->where($db->quoteName('t') . '.' . $db->quoteName('state') . ' = 1');
             $sql->where($db->quoteName('t') . '.' . $db->quoteName('access') . ' IN (' . $groups . ')');
             $sql->order('t.ordering, t.title');
             // Limit the nodes to a predefined filter.
             if (!empty($filter->data)) {
                 $sql->where('t.id IN(' . $filter->data . ')');
             }
             // Load the branches.
             $db->setQuery($sql);
             $branches[$bk]->nodes = $db->loadObjectList('id');
             // Check for an error.
             if ($db->getErrorNum()) {
                 return null;
             }
             // Translate branch nodes if possible.
             $language = JFactory::getLanguage();
             foreach ($branches[$bk]->nodes as $node_id => $node) {
//.........这里部分代码省略.........
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:101,代码来源:filter.php

示例2: elseif

						<small>(<?php 
        echo $item->num_children;
        ?>
)</small>
					<?php 
    } elseif ($item->num_nodes > 0) {
        ?>
						<small>(<?php 
        echo $item->num_nodes;
        ?>
)</small>
					<?php 
    }
    ?>
					<?php 
    if ($this->escape(trim($title, '**')) == 'Language' && FinderHelperLanguage::isMultiLanguage()) {
        ?>
						<strong><?php 
        echo JText::_('COM_FINDER_MAPS_MULTILANG');
        ?>
</strong>
					<?php 
    }
    ?>
				</td>
				<td class="center nowrap">
					<?php 
    echo JHtml::_('jgrid.published', $item->state, $i, 'maps.', $canChange, 'cb');
    ?>
				</td>
			</tr>
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:31,代码来源:default.php


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