function location_handler_filter_location_country::accept_exposed_input in Location 6.3
Same name and namespace in other branches
- 7.5 handlers/location_handler_filter_location_country.inc \location_handler_filter_location_country::accept_exposed_input()
- 7.3 handlers/location_handler_filter_location_country.inc \location_handler_filter_location_country::accept_exposed_input()
File
- handlers/
location_handler_filter_location_country.inc, line 96
Class
- location_handler_filter_location_country
- Filter on country.
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_id']) && isset($input[$this->options['expose']['operator_id']])) {
$this->operator = $input[$this->options['expose']['operator_id']];
}
if (!empty($this->options['expose']['identifier'])) {
$value = $input[$this->options['expose']['identifier']];
if (empty($this->options['expose']['required'])) {
if ($value == 'All' || $value === array()) {
if (empty($this->options['value']) || !empty($this->options['value']) && empty($this->options['expose']['reduce'])) {
return FALSE;
}
else {
$value = $this->options['value'];
}
}
if (!empty($this->always_multiple) && $value === '') {
return FALSE;
}
}
if (isset($value)) {
$this->value = $value;
if (empty($this->always_multiple) && empty($this->options['expose']['multiple'])) {
$this->value = array(
$value,
);
}
}
else {
return FALSE;
}
}
return TRUE;
}