You are here

public function SearchApiViewsHandlerArgumentFulltext::options_form in Search API 7

Extend the options form a bit.

Overrides SearchApiViewsHandlerArgument::options_form

File

contrib/search_api_views/includes/handler_argument_fulltext.inc, line 26
Contains SearchApiViewsHandlerArgumentFulltext.

Class

SearchApiViewsHandlerArgumentFulltext
Views argument handler class for handling fulltext fields.

Code

public function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['help']['#markup'] = t('Note: You can change how search keys are parsed under "Advanced" > "Query settings".');
  $fields = $this
    ->getFulltextFields();
  if (!empty($fields)) {
    $form['fields'] = array(
      '#type' => 'select',
      '#title' => t('Searched fields'),
      '#description' => t('Select the fields that will be searched. If no fields are selected, all available fulltext fields will be searched.'),
      '#options' => $fields,
      '#size' => min(4, count($fields)),
      '#multiple' => TRUE,
      '#default_value' => $this->options['fields'],
    );
    $form['conjunction'] = array(
      '#title' => t('Operator'),
      '#description' => t('Determines how multiple keywords entered for the search will be combined.'),
      '#type' => 'radios',
      '#options' => array(
        'AND' => t('Contains all of these words'),
        'OR' => t('Contains any of these words'),
      ),
      '#default_value' => $this->options['conjunction'],
    );
  }
  else {
    $form['fields'] = array(
      '#type' => 'value',
      '#value' => array(),
    );
  }
}