1 views_handler_field_search_score.inc views_handler_field_search_score::options_form(&$form, &$form_state)

Default options form that provides the label widget that all fields should have.

Overrides views_handler_field_numeric::options_form

File

core/modules/search/views/views_handler_field_search_score.inc, line 22
Definition of views_handler_field_search_score.

Class

views_handler_field_search_score
Field handler to provide simple renderer that allows linking to a node.

Code

function options_form(&$form, &$form_state) {
  $style_options = $this->view->display_handler->get_option('style_options');
  if (isset($style_options['default']) && $style_options['default'] == $this->options['id']) {
    $handlers = $this->view->display_handler->get_handlers('field');
    $options = array('' => t('No alternate'));
    foreach ($handlers as $id => $handler) {
      $options[$id] = $handler->ui_name();
    }

    $form['alternate_sort'] = array(
      '#type' => 'select',
      '#title' => t('Alternative sort'),
      '#description' => t('Pick an alternative default table sort field to use when the search score field is unavailable.'),
      '#options' => $options,
      '#default_value' => $this->options['alternate_sort'],
    );

    $form['alternate_order'] = array(
      '#type' => 'select',
      '#title' => t('Alternate sort order'),
      '#options' => array('asc' => t('Ascending'), 'desc' => t('Descending')),
      '#default_value' => $this->options['alternate_order'],
    );
  }

  parent::options_form($form, $form_state);
}