You are here

public function SearchApiViewsHandlerFilterEntity::value_form in Search API 7

Provide a form for setting the filter value.

Overrides SearchApiViewsHandlerFilter::value_form

2 calls to SearchApiViewsHandlerFilterEntity::value_form()
SearchApiViewsHandlerFilterTaxonomyTerm::value_form in contrib/search_api_views/includes/handler_filter_taxonomy_term.inc
Provide a form for setting the filter value.
SearchApiViewsHandlerFilterUser::value_form in contrib/search_api_views/includes/handler_filter_user.inc
Provide a form for setting the filter value.
2 methods override SearchApiViewsHandlerFilterEntity::value_form()
SearchApiViewsHandlerFilterTaxonomyTerm::value_form in contrib/search_api_views/includes/handler_filter_taxonomy_term.inc
Provide a form for setting the filter value.
SearchApiViewsHandlerFilterUser::value_form in contrib/search_api_views/includes/handler_filter_user.inc
Provide a form for setting the filter value.

File

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

Class

SearchApiViewsHandlerFilterEntity
Views filter handler class for entities.

Code

public function value_form(&$form, &$form_state) {
  parent::value_form($form, $form_state);
  if (!is_array($this->value)) {
    $this->value = $this->value ? array(
      $this->value,
    ) : array();
  }

  // Set the correct default value in case the admin-set value is used (and a
  // value is present). The value is used if the form is either not exposed,
  // or the exposed form wasn't submitted yet. (There doesn't seem to be an
  // easier way to check for that.)
  if ($this->value && (empty($form_state['input']) || !empty($form_state['input']['live_preview']))) {
    $form['value']['#default_value'] = $this
      ->ids_to_strings($this->value);
  }
}