function views_handler_filter::init
3.x views_handler_filter.inc | views_handler_filter::init(&$view, &$options) |
2.x views_handler_filter.inc | views_handler_filter::init(&$view, $options) |
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
1 call to views_handler_filter::init()
- 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.
1 method overrides views_handler_filter::init()
- 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 33
Class
- views_handler_filter
- Base class for filters.
Code
function init(&$view, $options) {
parent::init($view, $options);
$this->operator = $this->options['operator'];
$this->value = $this->options['value'];
// Compatibility: Set use_operator to true if the old way of using
// the operator is set and use_operator is NULL (was never set).
if (!empty($options['exposed']) && !empty($options['expose']['operator']) && !isset($options['expose']['use_operator'])) {
$this->options['expose']['use_operator'] = 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;
}
}