You are here

function flexiform_handler_filter_tags::accept_exposed_input in Flexiform 7

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

Overrides views_handler_filter_in_operator::accept_exposed_input

File

includes/views/handlers/flexiform_handler_filter_tags.inc, line 75
Contains handler for tags filter on flexiform views.

Class

flexiform_handler_filter_tags
@file Contains handler for tags filter on flexiform views.

Code

function accept_exposed_input($input) {
  if (empty($this->options['exposed'])) {
    return TRUE;
  }

  // If view is an attachment and is inheriting exposed filters, then assume
  // exposed input has already been validated
  if (!empty($this->view->is_attachment) && $this->view->display_handler
    ->uses_exposed()) {
    $this->validated_exposed_input = (array) $this->view->exposed_raw_input[$this->options['expose']['identifier']];
  }

  // If it's non-required and there's no value don't bother filtering.
  if (!$this->options['expose']['required'] && empty($this->validated_exposed_input)) {
    return FALSE;
  }
  $rc = parent::accept_exposed_input($input);
  if ($rc) {

    // If we have previously validated input, override.
    if (!$this
      ->is_a_group() && isset($this->validated_exposed_input)) {
      $this->value = $this->validated_exposed_input;
    }
  }
  return $rc;
}