function views_handler_filter::accept_exposed_input

Same name in other branches
  1. 7.x-3.x handlers/views_handler_filter.inc \views_handler_filter::accept_exposed_input()

Check to see if input from the exposed filters should change the behavior of this filter.

Overrides views_handler::accept_exposed_input

2 calls to views_handler_filter::accept_exposed_input()
views_handler_filter_in_operator::accept_exposed_input in handlers/views_handler_filter_in_operator.inc
Check to see if input from the exposed filters should change the behavior of this filter.
views_handler_filter_numeric::accept_exposed_input in handlers/views_handler_filter_numeric.inc
Do some minor translation of the exposed input
2 methods override views_handler_filter::accept_exposed_input()
views_handler_filter_in_operator::accept_exposed_input in handlers/views_handler_filter_in_operator.inc
Check to see if input from the exposed filters should change the behavior of this filter.
views_handler_filter_numeric::accept_exposed_input in handlers/views_handler_filter_numeric.inc
Do some minor translation of the exposed input

File

handlers/views_handler_filter.inc, line 484

Class

views_handler_filter
Base class for filters.

Code

function accept_exposed_input($input) {
    if (empty($this->options['exposed'])) {
        return TRUE;
    }
    if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator']) && isset($input[$this->options['expose']['operator']])) {
        $this->operator = $input[$this->options['expose']['operator']];
    }
    if (!empty($this->options['expose']['identifier'])) {
        $value = $input[$this->options['expose']['identifier']];
        // Various ways to check for the absence of optional input.
        if (!empty($this->options['expose']['optional'])) {
            if (($this->operator == 'empty' || $this->operator == 'not empty') && $value === '') {
                $value = ' ';
            }
            if ($this->operator != 'empty' && $this->operator != 'not empty') {
                if ($value == 'All' || $value === array()) {
                    return FALSE;
                }
            }
            if (!empty($this->no_single) && $value === '') {
                return FALSE;
            }
        }
        if (isset($value)) {
            $this->value = $value;
            if (empty($this->no_single) && !empty($this->options['expose']['single'])) {
                $this->value = array(
                    $value,
                );
            }
        }
        else {
            return FALSE;
        }
    }
    return TRUE;
}