You are here

public function SearchApiViewsHandlerFilterEntity::exposed_validate in Search API 7

Validate the exposed handler form.

Overrides views_handler::exposed_validate

1 call to SearchApiViewsHandlerFilterEntity::exposed_validate()
SearchApiViewsHandlerFilterTaxonomyTerm::exposed_validate in contrib/search_api_views/includes/handler_filter_taxonomy_term.inc
Validate the exposed handler form.
1 method overrides SearchApiViewsHandlerFilterEntity::exposed_validate()
SearchApiViewsHandlerFilterTaxonomyTerm::exposed_validate in contrib/search_api_views/includes/handler_filter_taxonomy_term.inc
Validate the exposed handler form.

File

contrib/search_api_views/includes/handler_filter_entity.inc, line 125
Contains SearchApiViewsHandlerFilterEntity.

Class

SearchApiViewsHandlerFilterEntity
Views filter handler class for entities.

Code

public function exposed_validate(&$form, &$form_state) {
  if (empty($this->options['exposed']) || empty($this->options['expose']['identifier'])) {
    return;
  }
  $this->validated_exposed_input = FALSE;
  $identifier = $this->options['expose']['identifier'];
  $input = $form_state['values'][$identifier];
  if ($this->options['is_grouped'] && isset($this->options['group_info']['group_items'][$input])) {
    $this->operator = $this->options['group_info']['group_items'][$input]['operator'];
    $input = $this->options['group_info']['group_items'][$input]['value'];
  }
  if (!strlen($input)) {
    return;
  }
  $values = $this
    ->isMultiValued() ? drupal_explode_tags($input) : array(
    $input,
  );
  if (!$this->options['is_grouped'] || $this->options['is_grouped'] && $input != 'All') {
    $this->validated_exposed_input = $this
      ->validate_entity_strings($form[$identifier], $values);
  }
}