function views_handler_filter::init
Provide some extra help to get the operator/value easier to use.
This likely has to be overridden by filters which are more complex than simple operator/value.
Overrides views_handler::init
2 calls to views_handler_filter::init()
- views_handler_filter_entity_bundle::init in handlers/
views_handler_filter_entity_bundle.inc - Provide some extra help to get the operator/value easier to use.
- views_handler_filter_many_to_one::init in handlers/
views_handler_filter_many_to_one.inc - Provide some extra help to get the operator/value easier to use.
2 methods override views_handler_filter::init()
- views_handler_filter_entity_bundle::init in handlers/
views_handler_filter_entity_bundle.inc - Provide some extra help to get the operator/value easier to use.
- views_handler_filter_many_to_one::init in handlers/
views_handler_filter_many_to_one.inc - Provide some extra help to get the operator/value easier to use.
File
-
handlers/
views_handler_filter.inc, line 86
Class
- views_handler_filter
- Base class for filters.
Code
public function init(&$view, &$options) {
parent::init($view, $options);
$this->operator = $this->options['operator'];
$this->value = $this->options['value'];
$this->group_info = $this->options['group_info']['default_group'];
// Compatibility: The new UI changed several settings.
if (!empty($options['exposed']) && !empty($options['expose']['optional']) && !isset($options['expose']['required'])) {
$this->options['expose']['required'] = !$options['expose']['optional'];
}
if (!empty($options['exposed']) && !empty($options['expose']['single']) && !isset($options['expose']['multiple'])) {
$this->options['expose']['multiple'] = !$options['expose']['single'];
}
if (!empty($options['exposed']) && !empty($options['expose']['operator']) && !isset($options['expose']['operator_id'])) {
$this->options['expose']['operator_id'] = $options['expose']['operator_id'] = $options['expose']['operator'];
}
if ($this->multiple_exposed_input()) {
$this->group_info = NULL;
if (!empty($options['group_info']['default_group_multiple'])) {
$this->group_info = array_filter($options['group_info']['default_group_multiple']);
}
$this->options['expose']['multiple'] = TRUE;
}
// If there are relationships in the view, allow empty should be true
// so that we can do IS NULL checks on items. Not all filters respect
// allow empty, but string and numeric do and that covers enough.
if ($this->view->display_handler
->get_option('relationships')) {
$this->definition['allow empty'] = TRUE;
}
}