當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。