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


PHP FinderIndexerHelper::getDefaultLanguage方法代码示例

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


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

示例1: _index

 /**
  * Method to index an item. The item must be a FinderIndexerResult object.
  *
  * @param	object		The item to index as an FinderIndexerResult object.
  * @throws	Exception on database error.
  */
 protected function _index(FinderIndexerResult $item)
 {
     // Build the necessary route and path information.
     $item->url = $this->_getURL($item->topic);
     $item->itemid = '100065';
     $item->route = $item->url . '&post=' . $item->id . '&Itemid=' . $item->itemid . '#p' . $item->id;
     $item->path = FinderIndexerHelper::getContentPath($item->route);
     // Add the meta-data processing instructions.
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'display_name');
     // Strip slashes!
     $item->title = stripslashes($item->title);
     $item->summary = stripslashes($item->summary);
     $item->display_name = stripslashes($item->display_name);
     $item->text = FinderIndexerHelper::prepareContent($item->summary);
     // Translate the access group to an access level.
     //$item->cat_access = $this->_getAccessLevel($item->cat_access);
     // Inherit state and access form the category.
     $item->state = 1;
     $item->access = 0;
     // Set the language.
     $item->language = FinderIndexerHelper::getDefaultLanguage();
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', 'Forum Post');
     // Add the author taxonomy data.
     if (!empty($item->author)) {
         $item->addTaxonomy('Forum User', $item->display_name);
     }
     // Index the item.
     FinderIndexer::index($item);
 }
开发者ID:ravenlife,项目名称:Ninjaboard,代码行数:36,代码来源:ninjaboard_posts.php

示例2: __construct

 /**
  * Method to instantiate the query object.
  *
  * @param   array  $options  An array of query options.
  *
  * @since   2.5
  * @throws  Exception on database error.
  */
 public function __construct($options)
 {
     // Get the input string.
     $this->input = isset($options['input']) ? $options['input'] : null;
     // Get the empty query setting.
     $this->empty = isset($options['empty']) ? (bool) $options['empty'] : false;
     // Get the input language.
     $this->language = !empty($options['language']) ? $options['language'] : FinderIndexerHelper::getDefaultLanguage();
     $this->language = FinderIndexerHelper::getPrimaryLanguage($this->language);
     // Get the matching mode.
     $this->mode = 'AND';
     // Initialize the temporary date storage.
     $this->dates = new JRegistry();
     // Populate the temporary date storage.
     if (isset($options['date1']) && !empty($options['date1'])) {
         $this->dates->set('date1', $options['date1']);
     }
     if (isset($options['date2']) && !empty($options['date1'])) {
         $this->dates->set('date2', $options['date2']);
     }
     if (isset($options['when1']) && !empty($options['date1'])) {
         $this->dates->set('when1', $options['when1']);
     }
     if (isset($options['when2']) && !empty($options['date1'])) {
         $this->dates->set('when2', $options['when2']);
     }
     // Process the static taxonomy filters.
     if (isset($options['filter']) && !empty($options['filter'])) {
         $this->processStaticTaxonomy($options['filter']);
     }
     // Process the dynamic taxonomy filters.
     if (isset($options['filters']) && !empty($options['filters'])) {
         $this->processDynamicTaxonomy($options['filters']);
     }
     // Get the date filters.
     $d1 = $this->dates->get('date1');
     $d2 = $this->dates->get('date2');
     $w1 = $this->dates->get('when1');
     $w2 = $this->dates->get('when2');
     // Process the date filters.
     if (!empty($d1) || !empty($d2)) {
         $this->processDates($d1, $d2, $w1, $w2);
     }
     // Process the input string.
     $this->processString($this->input, $this->language, $this->mode);
     // Get the number of matching terms.
     foreach ($this->included as $token) {
         $this->terms += count($token->matches);
     }
     // Remove the temporary date storage.
     unset($this->dates);
     /*
      * Lastly, determine whether this query can return a result set.
      */
     // Check if we have a query string.
     if (!empty($this->input)) {
         $this->search = true;
     } elseif ($this->empty && (!empty($this->filter) || !empty($this->filters) || !empty($this->date1) || !empty($this->date2))) {
         $this->search = true;
     } else {
         $this->search = false;
     }
 }
开发者ID:01J,项目名称:topm,代码行数:71,代码来源:query.php

示例3: populateState

 /**
  * Method to auto-populate the model state.  Calling getState in this method will result in recursion.
  *
  * @param   string  $ordering   An optional ordering field.
  * @param   string  $direction  An optional direction (asc|desc).
  *
  * @return  void
  *
  * @since   2.5
  */
 protected function populateState($ordering = null, $direction = null)
 {
     // Get the configuration options.
     $app = JFactory::getApplication();
     $input = $app->input;
     $params = JComponentHelper::getParams('com_finder');
     $user = JFactory::getUser();
     // Get the query input.
     $this->setState('input', $input->request->get('q', '', 'string'));
     // Set the query language
     if (JLanguageMultilang::isEnabled()) {
         $lang = JFactory::getLanguage()->getTag();
     } else {
         $lang = FinderIndexerHelper::getDefaultLanguage();
     }
     $lang = FinderIndexerHelper::getPrimaryLanguage($lang);
     $this->setState('language', $lang);
     // Load the list state.
     $this->setState('list.start', 0);
     $this->setState('list.limit', 10);
     // Load the parameters.
     $this->setState('params', $params);
     // Load the user state.
     $this->setState('user.id', (int) $user->get('id'));
 }
开发者ID:educakanchay,项目名称:kanchay,代码行数:35,代码来源:suggestions.php

示例4: testGetDefaultLanguage

 /**
  * Tests the getDefaultLanguage method
  *
  * @return  void
  *
  * @since   3.0
  */
 public function testGetDefaultLanguage()
 {
     $this->assertThat(FinderIndexerHelper::getDefaultLanguage(), $this->StringContains('en-GB'), 'The default language is en-GB');
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:11,代码来源:FinderIndexerHelperTest.php

示例5: testGetDefaultLanguage

 /**
  * Tests the getDefaultLanguage method
  *
  * @return  void
  *
  * @since   3.0
  */
 public function testGetDefaultLanguage()
 {
     $this->assertEquals('en-GB', FinderIndexerHelper::getDefaultLanguage(), 'The default language is en-GB');
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:11,代码来源:FinderIndexerHelperTest.php


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