function rooms_booking_handler_unit_filter::exposed_validate in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Validate the exposed handler form.
Overrides views_handler::exposed_validate
File
- modules/
rooms_booking/ views/ rooms_booking_handler_unit_filter.inc, line 154
Class
Code
function exposed_validate(&$form, &$form_state) {
if (empty($this->options['exposed'])) {
return;
}
$identifier = $this->options['expose']['identifier'];
// We only validate if they've chosen the text field style.
if ($this->options['type'] != 'textfield') {
if ($form_state['values'][$identifier] != 'All') {
$this->validated_exposed_input = (array) $form_state['values'][$identifier];
}
return;
}
if (empty($this->options['expose']['identifier'])) {
return;
}
$values = drupal_explode_tags($form_state['values'][$identifier]);
$units = $this
->validate_unit_strings($form[$identifier], $values);
if ($units) {
$this->validated_exposed_input = $units;
}
}