You are here

public function VerticalTabsStyle::buildOptionsForm in Views vertical tabs style plugin 8

Provide a form to edit options for this plugin.

Overrides StylePluginBase::buildOptionsForm

File

src/Plugin/views/style/VerticalTabsStyle.php, line 76
Contains \Drupal\views_vertical_tabs\Plugin\views\style\VerticalTabsStyle.

Class

VerticalTabsStyle
Defines a style plugin that renders the full view as vertical_tabs.

Namespace

Drupal\views_vertical_tabs\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $options = array(
    '' => $this
      ->t('- None -'),
  );
  $field_labels = $this->displayHandler
    ->getFieldLabels(TRUE);
  $options += $field_labels;
  $form['title'] = array(
    '#type' => 'select',
    '#title' => $this
      ->t('Tab Title'),
    '#options' => $options,
    '#default_value' => $this->options['title'],
    '#description' => $this
      ->t('Choose the title of each tab.'),
    '#weight' => -49,
  );
  $form['summary'] = array(
    '#type' => 'select',
    '#title' => $this
      ->t('Tab Summary'),
    '#options' => $options,
    '#default_value' => $this->options['summary'],
    '#description' => $this
      ->t('Optional tab summary.'),
    '#weight' => -48,
  );
  $form['description'] = array(
    '#type' => 'select',
    '#title' => $this
      ->t('Fieldset Description'),
    '#options' => $options,
    '#default_value' => $this->options['description'],
    '#description' => $this
      ->t('Optional tab description.'),
    '#weight' => -47,
  );
}