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


PHP FlexicontentFields::createFilterValues方法代碼示例

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


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

示例1: createFilter


//.........這裏部分代碼省略.........
         $view_join = '';
         $view_where = '';
         $filters_where = array();
         // *** Limiting of displayed filter values according to current category filtering, but show all field values if filter is active
         if ($isCategoryView) {
             // category view, use parameter to decide if limitting filter values
             global $fc_catview;
             if ($faceted_filter) {
                 $view_join = @$fc_catview['join_clauses'];
                 $view_where = $fc_catview['where_conf_only'];
                 $filters_where = $fc_catview['filters_where'];
                 $view_total = isset($fc_catview['view_total']) ? $fc_catview['view_total'] : 0;
                 if ($fc_catview['alpha_where']) {
                     $filters_where['alpha'] = $fc_catview['alpha_where'];
                 }
                 // we use count bellow ... so add it only if it is non-empty
             }
         } else {
             if ($isSearchView) {
                 // search view, use parameter to decide if limitting filter values
                 global $fc_searchview;
                 if (empty($fc_searchview)) {
                     return array();
                 }
                 // search view plugin disabled ?
                 if ($faceted_filter) {
                     $view_join = $fc_searchview['join_clauses'];
                     $view_where = $fc_searchview['where_conf_only'];
                     $filters_where = $fc_searchview['filters_where'];
                     $view_total = isset($fc_searchview['view_total']) ? $fc_searchview['view_total'] : 0;
                 }
             }
         }
         $createFilterValues = !$isSearchView ? 'createFilterValues' : 'createFilterValuesSearch';
         // This is hack for filter core properties to be filterable in search view without being added to the adv search index
         if ($filter->field_type == 'coreprops' && $view == 'search') {
             $createFilterValues = 'createFilterValues';
         }
         // Get filter values considering PAGE configuration (regardless of ACTIVE filters)
         if ($apply_cache) {
             $results_page = $itemcache->call(array('FlexicontentFields', $createFilterValues), $filter, $view_join, $view_where, array(), $indexed_elements, $search_prop);
         } else {
             if (!$isSearchView) {
                 $results_page = FlexicontentFields::createFilterValues($filter, $view_join, $view_where, array(), $indexed_elements, $search_prop);
             } else {
                 $results_page = FlexicontentFields::createFilterValuesSearch($filter, $view_join, $view_where, array(), $indexed_elements, $search_prop);
             }
         }
         // Get filter values considering ACTIVE filters, but only if there is at least ONE filter active
         $faceted_max_item_limit = 10000;
         if ($faceted_filter == 2 && count($filters_where)) {
             if ($view_total <= $faceted_max_item_limit) {
                 // DO NOT cache at this point the filter combinations are endless, so they will produce big amounts of cached data, that will be rarely used ...
                 if (!$isSearchView) {
                     $results_active = FlexicontentFields::createFilterValues($filter, $view_join, $view_where, $filters_where, $indexed_elements, $search_prop);
                 } else {
                     $results_active = FlexicontentFields::createFilterValuesSearch($filter, $view_join, $view_where, $filters_where, $indexed_elements, $search_prop);
                 }
             } else {
                 if ($faceted_overlimit_msg === null) {
                     // Set a notice message about not counting item per filter values and instead showing item TOTAL of current category / view
                     $faceted_overlimit_msg = 1;
                     $filter_messages = JRequest::getVar('filter_message', array());
                     $filter_messages[] = JText::sprintf('FLEXI_FACETED_ITEM_LIST_OVER_LIMIT', $faceted_max_item_limit, $view_total);
                     JRequest::setVar('filter_messages', $filter_messages);
                 }
開發者ID:jakesyl,項目名稱:flexicontent,代碼行數:67,代碼來源:flexicontent.fields.php

示例2: createFilter


//.........這裏部分代碼省略.........
            $filters_where = array();
            $text_search = '';
            $view_total = 0;
            // *** Limiting of displayed filter values according to current category filtering, but show all field values if filter is active
            if ($isCategoryView) {
                // category view, use parameter to decide if limitting filter values
                global $fc_catview;
                if ($faceted_filter) {
                    $view_join = @$fc_catview['join_clauses'];
                    $view_join_n_text = @$fc_catview['join_clauses_with_text'];
                    $view_where = @$fc_catview['where_conf_only'];
                    $filters_where = @$fc_catview['filters_where'];
                    $text_search = $fc_catview['search'];
                    $view_total = isset($fc_catview['view_total']) ? $fc_catview['view_total'] : 0;
                }
            } else {
                if ($isSearchView) {
                    // search view, use parameter to decide if limitting filter values
                    global $fc_searchview;
                    if (empty($fc_searchview)) {
                        return array();
                    }
                    // search view plugin disabled ?
                    if ($faceted_filter) {
                        $view_join = $fc_searchview['join_clauses'];
                        $view_join_n_text = $fc_searchview['join_clauses_with_text'];
                        $view_where = $fc_searchview['where_conf_only'];
                        $filters_where = $fc_searchview['filters_where'];
                        $text_search = $fc_searchview['search'];
                        $view_total = isset($fc_searchview['view_total']) ? $fc_searchview['view_total'] : 0;
                    }
                }
            }
            $createFilterValues = !$isSearchView ? 'createFilterValues' : 'createFilterValuesSearch';
            // This is hack for filter core properties to be filterable in search view without being added to the adv search index
            if ($filter->field_type == 'coreprops' && $view == 'search') {
                $createFilterValues = 'createFilterValues';
            }
            // Get filter values considering PAGE configuration (regardless of ACTIVE filters)
            if ($apply_cache) {
                $results_page = $itemcache->call(array('FlexicontentFields', $createFilterValues), $filter, $view_join, $view_where, array(), $indexed_elements, $search_prop);
            } else {
                if (!$isSearchView) {
                    $results_page = FlexicontentFields::createFilterValues($filter, $view_join, $view_where, array(), $indexed_elements, $search_prop);
                } else {
                    $results_page = FlexicontentFields::createFilterValuesSearch($filter, $view_join, $view_where, array(), $indexed_elements, $search_prop);
                }
            }
            // Get filter values considering ACTIVE filters, but only if there is at least ONE filter active
            $faceted_max_item_limit = 10000;
            if ($faceted_filter == 2) {
                if ($view_total <= $faceted_max_item_limit) {
                    // DO NOT cache at this point the filter combinations are endless, so they will produce big amounts of cached data, that will be rarely used ...
                    // but if only a single filter is active we can get the cached result of it ... because its own filter_where is not used for the filter itself
                    if (!$text_search && (count($filters_where) == 0 || count($filters_where) == 1 && isset($filters_where[$filter->id]))) {
                        $results_active = $results_page;
                    } else {
                        if (!$isSearchView) {
                            $results_active = FlexicontentFields::createFilterValues($filter, $view_join_n_text, $view_where, $filters_where, $indexed_elements, $search_prop);
                        } else {
                            $results_active = FlexicontentFields::createFilterValuesSearch($filter, $view_join_n_text, $view_where, $filters_where, $indexed_elements, $search_prop);
                        }
                    }
                } else {
                    if ($faceted_overlimit_msg === null) {
                        // Set a notice message about not counting item per filter values and instead showing item TOTAL of current category / view
開發者ID:benediktharter,項目名稱:flexicontent-cck,代碼行數:67,代碼來源:flexicontent.fields.php


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