function views_plugin_style_jump_menu::options_form

3.x views_plugin_style_jump_menu.inc views_plugin_style_jump_menu::options_form(&$form, &$form_state)
2.x 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

plugins/views_plugin_style_jump_menu.inc, line 28
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(
      '#value' => t('You need at least one field before you can configure your jump menu settings'),
      '#prefix' => '<div class="error form-item description">',
      '#suffix' => '</div>',
    );
    return;
  }

  $form['markup'] = array(
    '#value' => 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['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['default_value'] = array(
    '#type' => 'checkbox',
    '#title' => t('Select the current argument.'),
    '#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.'),
  );
}