1 views_plugin_style_jump_menu.inc | views_plugin_style_jump_menu::options_form(&$form, &$form_state) |
Render the given style.
Overrides views_plugin_style::options_form
File
- core/
modules/ views/ plugins/ views_plugin_style_jump_menu.inc, line 30 - Contains the table style plugin.
Class
- views_plugin_style_jump_menu
- Style plugin to render each item as a row in a table.
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$handlers = $this->display->handler->get_handlers('field');
if (empty($handlers)) {
$form['error_markup'] = array(
'#markup' => t('You need at least one field before you can configure your jump menu settings'),
'#prefix' => '<div class="error messages">',
'#suffix' => '</div>',
);
return;
}
$form['markup'] = array(
'#markup' => t('To properly configure a jump menu, you must select one field that will represent the path to utilize. You should then set that field to exclude. All other displayed fields will be part of the menu. Please note that all HTML will be stripped from this output as select boxes cannot show HTML.'),
'#prefix' => '<div class="form-item description">',
'#suffix' => '</div>',
);
foreach ($handlers as $id => $handler) {
$options[$id] = $handler->ui_name();
}
$form['path'] = array(
'#type' => 'select',
'#title' => t('Path field'),
'#options' => $options,
'#default_value' => $this->options['path'],
);
$form['hide'] = array(
'#type' => 'checkbox',
'#title' => t('Hide the "Go" button'),
'#default_value' => !empty($this->options['hide']),
'#description' => t('If hidden, this button will only be hidden for users with javascript and the page will automatically jump when the select is changed.'),
);
$form['text'] = array(
'#type' => 'textfield',
'#title' => t('Button text'),
'#default_value' => $this->options['text'],
);
$form['label'] = array(
'#type' => 'textfield',
'#title' => t('Selector label'),
'#default_value' => $this->options['label'],
'#description' => t('The text that will appear as the the label of the selector element. If blank no label tag will be used.'),
);
$form['choose'] = array(
'#type' => 'textfield',
'#title' => t('Choose text'),
'#default_value' => $this->options['choose'],
'#description' => t('The text that will appear as the selected option in the jump menu.'),
);
$form['inline'] = array(
'#type' => 'checkbox',
'#title' => t('Set this field to display inline'),
'#default_value' => !empty($this->options['inline']),
);
$form['default_value'] = array(
'#type' => 'checkbox',
'#title' => t('Select the current contextual filter value'),
'#default_value' => !empty($this->options['default_value']),
'#description' => t('If checked, the current path will be displayed as the default option in the jump menu, if applicable.'),
);
}