function views_handler_field_search_score::options_form in Views (for Drupal 7) 6.3
Same name and namespace in other branches
- 6.2 modules/search/views_handler_field_search_score.inc \views_handler_field_search_score::options_form()
- 7.3 modules/search/views_handler_field_search_score.inc \views_handler_field_search_score::options_form()
Default options form that provides the label widget that all fields should have.
Overrides views_handler_field_numeric::options_form
File
- modules/
search/ views_handler_field_search_score.inc, line 18
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);
}