當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FlexicontentFields::getFilterValuesSearch方法代碼示例

本文整理匯總了PHP中FlexicontentFields::getFilterValuesSearch方法的典型用法代碼示例。如果您正苦於以下問題:PHP FlexicontentFields::getFilterValuesSearch方法的具體用法?PHP FlexicontentFields::getFilterValuesSearch怎麽用?PHP FlexicontentFields::getFilterValuesSearch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FlexicontentFields的用法示例。


在下文中一共展示了FlexicontentFields::getFilterValuesSearch方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createFilterValuesSearch

 static function createFilterValuesSearch($filter, $view_join, $view_where, $filters_where, $indexed_elements, $search_prop)
 {
     $faceted_filter = $filter->parameters->get('faceted_filter_s', 2);
     $display_filter_as = $filter->parameters->get('display_filter_as_s', 0);
     // Filter Type of Display
     $filter_as_range = in_array($display_filter_as, array(2, 3));
     $lang_filter_values = $filter->parameters->get('lang_filter_values', 1);
     //$show_matching_items = $filter->parameters->get( 'show_matching_items_s', 1 );
     //$show_matches = $filter_as_range || !$faceted_filter ?  0  :  $show_matching_items;
     $filter->filter_isindexed = (bool) $indexed_elements;
     $_results = FlexicontentFields::getFilterValuesSearch($filter, $view_join, $view_where, $filters_where);
     $results =& $_results;
     // Language filter labels
     if ($lang_filter_values) {
         foreach ($results as $i => $result) {
             $results[$i]->text = JText::_($result->text);
         }
     }
     // Skip sorting for indexed elements, DB query or element entry is responsible
     // for ordering indexable fields, also skip if ordering is done by the filter
     if (!$indexed_elements && empty($filter->filter_orderby)) {
         uksort($results, 'strnatcasecmp');
     }
     return $results;
 }
開發者ID:jakesyl,項目名稱:flexicontent,代碼行數:25,代碼來源:flexicontent.fields.php

示例2: createFilterValuesSearch

 static function createFilterValuesSearch($filter, $view_join, $view_where, $filters_where, $indexed_elements, $search_prop)
 {
     $faceted_filter = $filter->parameters->get('faceted_filter_s', 2);
     $display_filter_as = $filter->parameters->get('display_filter_as_s', 0);
     // Filter Type of Display
     $isRange = in_array($display_filter_as, array(2, 3, 8));
     $lang_filter_values = $filter->parameters->get('lang_filter_values', 1);
     $show_matching_items = $filter->parameters->get('show_matching_items_s', 1);
     $show_matches = $isRange || !$faceted_filter ? 0 : $show_matching_items;
     $filter->filter_isindexed = (bool) $indexed_elements;
     if ($faceted_filter || !$indexed_elements) {
         $_results = FlexicontentFields::getFilterValuesSearch($filter, $view_join, $view_where, $filters_where);
         //echo "<pre>". $filter->label.": ". print_r($_results, true) ."\n\n</pre>";
     }
     // Support of value-indexed fields
     if (!$faceted_filter && $indexed_elements) {
         // Clone 'indexed_elements' because they maybe modified
         $results = array();
         foreach ($indexed_elements as $i => $result) {
             $results[$i] = clone $result;
         }
     } else {
         if ($indexed_elements && is_array($indexed_elements)) {
             // Limit indexed element according to DB results found
             $results = array_intersect_key($indexed_elements, $_results);
             //echo "<pre>". $filter->label.": ". print_r($indexed_elements, true) ."\n\n</pre>";
             if ($faceted_filter == 2 && $show_matches) {
                 foreach ($results as $i => $result) {
                     $result->found = $_results[$i]->found;
                     // Clone 'indexed_elements' because they maybe modified
                     $results[$i] = clone $result;
                 }
             }
         } else {
             $results =& $_results;
         }
     }
     // Language filter values/labels (for indexed fields this is already done)
     if ($lang_filter_values && !$indexed_elements) {
         foreach ($results as $i => $result) {
             $results[$i]->text = JText::_($result->text);
         }
     }
     // Skip sorting for indexed elements, DB query or element entry is responsible
     // for ordering indexable fields, also skip if ordering is done by the filter
     if (!$indexed_elements && empty($filter->filter_orderby_adv)) {
         uksort($results, 'strnatcasecmp');
         if ($filter->parameters->get('reverse_filter_order', 0)) {
             $results = array_reverse($results, true);
         }
     }
     return $results;
 }
開發者ID:benediktharter,項目名稱:flexicontent-cck,代碼行數:53,代碼來源:flexicontent.fields.php


注:本文中的FlexicontentFields::getFilterValuesSearch方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。