You are here

public static function BootstrapQuickTabs::optionsForm in Bootstrap Quick Tabs 7

Build admin form.

Overrides QuickRenderer::optionsForm

File

./BootstrapQuickTabs.inc, line 16
Extends Quicktabs module's core functions.

Class

BootstrapQuickTabs
Renders the content using the Bootstrap Tabs widget.

Code

public static function optionsForm($qt) {
  $form = array();
  $form['tabstyle'] = array(
    '#default_value' => isset($qt->renderer) && $qt->renderer == 'bootstrap_tabs' && isset($qt->options['tabstyle']) && $qt->options['tabstyle'] ? $qt->options['tabstyle'] : 'tabs',
    '#description' => t('Choose the style of tab to use from %bootstrap', array(
      '%bootstrap' => l(t('Bootstrap'), 'https://getbootstrap.com/docs/3.3/components/#nav'),
    )),
    '#options' => array(
      'tabs' => t('Tabs'),
      'pills' => t('Pills'),
    ),
    '#title' => t('Style of tabs'),
    '#type' => 'radios',
  );
  $form['tabposition'] = array(
    '#default_value' => isset($qt->renderer) && $qt->renderer == 'bootstrap_tabs' && isset($qt->options['tabposition']) && $qt->options['tabposition'] ? $qt->options['tabposition'] : 'basic',
    '#description' => t('Choose the position of tab to use from %bootstrap', array(
      '%bootstrap' => l(t('Bootstrap'), 'https://getbootstrap.com/docs/3.3/components/#nav'),
    )),
    '#options' => array(
      'basic' => t('Tabs/pills on the top'),
      'left' => t('Tabs/pills on the left'),
      'right' => t('Tabs /pills on the right'),
      'below' => t('Tabs/pills on the bottom'),
      'justified' => t('Tabs/pills justified on the top'),
      'stacked' => t('Tabs/pills stacked'),
    ),
    '#title' => t('Position of tabs'),
    '#type' => 'radios',
  );
  $default_effects = array();
  if (isset($qt->renderer) && $qt->renderer == 'bootstrap_tabs' && isset($qt->options['tabeffects']) && $qt->options['tabeffects']) {
    $default_effects[] = 'fade';
  }
  $form['tabeffects'] = array(
    '#default_value' => $default_effects,
    '#description' => t('Select fade effect on or off %bootstrap', array(
      '%bootstrap' => l(t('Bootstrap'), 'https://getbootstrap.com/docs/3.3/javascript/#tabs'),
    )),
    '#options' => array(
      'fade' => t('Fade'),
    ),
    '#title' => t('Effect of tabs'),
    '#type' => 'checkboxes',
  );
  return $form;
}