You are here

public function AccordionTabs::optionsForm in Quick Tabs 8.3

Return form elements used on the edit/add from.

Return value

array The options used for displaying tabs.

Overrides TabRendererBase::optionsForm

File

quicktabs_accordion/src/Plugin/TabRenderer/AccordionTabs.php, line 25

Class

AccordionTabs
Provides an 'AccordionTabs' tab renderer.

Namespace

Drupal\quicktabs_accordion\Plugin\TabRenderer

Code

public function optionsForm(QuickTabsInstance $instance) {
  $options = $instance
    ->getOptions()['accordion_tabs'];
  $form = [];
  $form['jquery_ui'] = [
    '#type' => 'fieldset',
    '#title' => $this
      ->t('JQuery UI options'),
  ];
  $form['jquery_ui']['collapsible'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Collapsible'),
    '#default_value' => $options['jquery_ui']['collapsible'] != NULL && $instance
      ->getRenderer() == 'accordion_tabs' ? $options['jquery_ui']['collapsible'] : 0,
  ];
  $form['jquery_ui']['heightStyle'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('JQuery UI HeightStyle'),
    '#options' => [
      'auto' => $this
        ->t('auto'),
      'fill' => $this
        ->t('fill'),
      'content' => $this
        ->t('content'),
    ],
    '#default_value' => $options['jquery_ui']['heightStyle'] != NULL && $instance
      ->getRenderer() == 'accordion_tabs' ? $options['jquery_ui']['heightStyle'] : 'auto',
  ];
  return $form;
}