You are here

public function elasticsearch_connector_views_keyword_handler_filter::options_form in Elasticsearch Connector 7.2

Same name and namespace in other branches
  1. 7.5 modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_keyword_handler_filter.inc \elasticsearch_connector_views_keyword_handler_filter::options_form()
  2. 7 modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_keyword_handler_filter.inc \elasticsearch_connector_views_keyword_handler_filter::options_form()

Provide the basic form which calls through to subforms.

If overridden, it is best to call through to the parent, or to at least make sure all of the functions in this form are called.

Overrides views_handler_filter::options_form

File

modules/elasticsearch_connector_views/handlers/elasticsearch_connector_views_keyword_handler_filter.inc, line 22
Fulltext keyword search.

Class

elasticsearch_connector_views_keyword_handler_filter
@file Fulltext keyword search.

Code

public function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $fields = $this
    ->getFulltextFields();
  if (!empty($fields)) {
    $form['fields'] = array(
      '#type' => 'select',
      '#title' => t('Searched fields'),
      '#description' => t('Select the fields that will be searched.'),
      '#options' => $fields,
      '#size' => min(4, count($fields)),
      '#multiple' => TRUE,
      '#default_value' => $this->options['fields'],
      '#required' => TRUE,
    );
  }
  else {
    $form['fields'] = array(
      '#type' => 'value',
      '#value' => array(),
    );
  }
}