当前位置: 首页>>代码示例>>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;未经允许,请勿转载。