function onAdvSearchDisplayFilter(&$filter, $value = '', $formName = 'searchForm') { if ($filter->iscore != 1) { return; } if ($filter->field_type == 'maintext' || $filter->field_type == 'title') { $filter->parameters->set('display_filter_as_s', 1); // Only supports a basic filter of single text search input } $indexed_elements = in_array($filter->field_type, array('tags', 'createdby', 'modifiedby', 'created', 'modified', 'type')); if ($filter->field_type == 'categories' || $filter->field_type == 'title') { plgFlexicontent_fieldsCore::onDisplayFilter($filter, $value, $formName); } else { FlexicontentFields::createFilter($filter, $value, $formName, $indexed_elements); } }
function onAdvSearchDisplayFilter(&$filter, $value = '', $formName = 'searchForm') { if ($filter->iscore != 1) { return; } if ($filter->field_type == 'maintext' || $filter->field_type == 'title') { $filter->parameters->set('display_filter_as_s', 1); // Only supports a basic filter of single text search input } // This will make filter values to be retrieved from the value_id DB column $indexed_elements = in_array($filter->field_type, array('type', 'state', 'tags', 'categories', 'created', 'createdby', 'modified', 'modifiedby')); if ($filter->field_type == 'categories' || $filter->field_type == 'title') { plgFlexicontent_fieldsCore::onDisplayFilter($filter, $value, $formName, $isSearchView = 1); } else { if ($filter->field_type == 'created' || $filter->field_type == 'modified') { $filter->filter_orderby_adv = ' ORDER BY value_id'; // we can use a date type cast here, but it is not needed due to the format of value_id FlexicontentFields::createFilter($filter, $value, $formName, $indexed_elements); } else { $filter->filter_orderby_adv = null; // default will order by value and not by label FlexicontentFields::createFilter($filter, $value, $formName, $indexed_elements); } } }
function onAdvSearchDisplayFilter(&$filter, $value = '', $formName = 'searchForm') { if ($filter->iscore != 1) { return; } if ($filter->field_type == 'maintext' || $filter->field_type == 'title') { $filter->parameters->set('display_filter_as_s', 1); // Only supports a basic filter of single text search input } $indexed_elements = in_array($filter->field_type, array('tags', 'createdby', 'modifiedby', 'created', 'modified', 'type')); if ($filter->field_type == 'categories' || $filter->field_type == 'title') { plgFlexicontent_fieldsCore::onDisplayFilter($filter, $value, $formName, $isSearchView = 1); } else { if ($filter->field_type == 'created' || $filter->field_type == 'modified') { $filter->filter_orderby_adv = ' ORDER BY value_id'; // we can use a date type cast here, but it is not needed due to the format of value_id FlexicontentFields::createFilter($filter, $value, $formName, $indexed_elements); } else { $filter->filter_orderby_adv = null; // use default, no ordering done to improve speed, it will be done inside PHP code FlexicontentFields::createFilter($filter, $value, $formName, $indexed_elements); } } }