You are here

public function availability_calendar_handler_filter_availability::exposed_validate in Availability Calendars 7.5

Same name and namespace in other branches
  1. 7.3 availability_calendar_handler_filter_availability.inc \availability_calendar_handler_filter_availability::exposed_validate()
  2. 7.4 views/availability_calendar_handler_filter_availability.inc \availability_calendar_handler_filter_availability::exposed_validate()

Validates our part of the exposed form.

What we accept as valid depends on the situation. Always:

  • A non empty date or duration must have a valid value.
  • If this filter is not required, both from and to/to1/duration may be empty.

For non auto-submit forms:

  • From and to/to1/duration should both be filled in or both be empty.

For auto-submit forms:

  • It may be that only 1 value is filled in. If the input is accepted and how it is processed depends on what is filled in,

{ Overrides {

_state

Parameters

array $form:

Overrides views_handler::exposed_validate

See also

accept_exposed_input()}.

views_handler::exposed_validate()}.

File

views/availability_calendar_handler_filter_availability.inc, line 386

Class

availability_calendar_handler_filter_availability
Views handler to filter on availability.

Code

public function exposed_validate(&$form, &$form_state) {
  if (empty($this->options['exposed'])) {
    return;
  }
  $this
    ->validate_value($form[$this->options['expose']['identifier']], $form_state);

  // We need this information later on in accept_exposed_input().
  $this->autoSubmit = (bool) (!empty($form_state['exposed'])) && $form_state['exposed_form_plugin']->options['autosubmit'];
}