You are here

public function Tabs::settingsForm in Field Group: Easy Responsive Tabs to Accordion 8

File

src/Plugin/field_group/FieldGroupFormatter/Tabs.php, line 91

Class

Tabs
Plugin implementation of the 'ertta_tabs' formatter.

Namespace

Drupal\field_group_easy_responsive_tabs\Plugin\field_group\FieldGroupFormatter

Code

public function settingsForm() {
  $form = parent::settingsForm();
  $form['type'] = [
    '#title' => $this
      ->t('Type'),
    '#type' => 'select',
    '#options' => [
      'default' => $this
        ->t('Horizontal'),
      'vertical' => $this
        ->t('Vertical'),
      'accordion' => $this
        ->t('Accordion'),
    ],
    '#default_value' => $this
      ->getSetting('type'),
  ];
  $form['width'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Width'),
    '#description' => $this
      ->t('auto or any custom width.'),
    '#default_value' => $this
      ->getSetting('width'),
    '#size' => 10,
  ];
  $form['fit'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Fit'),
    '#description' => $this
      ->t('100% fits in a container'),
    '#default_value' => $this
      ->getSetting('fit'),
    '#options' => [
      0 => $this
        ->t('No'),
      1 => $this
        ->t('Yes'),
    ],
  ];
  $form['closed'] = [
    '#title' => $this
      ->t('Closed'),
    '#description' => $this
      ->t('Close the panels on start, the options "accordion" and "tabs" keep them closed in there respective view types.'),
    '#type' => 'select',
    '#options' => [
      0 => $this
        ->t('No'),
      1 => $this
        ->t('Yes'),
    ],
    '#default_value' => $this
      ->getSetting('closed'),
  ];
  $form['active_bg'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Active tab bg'),
    '#description' => $this
      ->t('Background color for active tabs in this group.'),
    '#default_value' => $this
      ->getSetting('active_bg'),
    '#size' => 10,
  ];
  $form['inactive_bg'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Inactive tab bg'),
    '#description' => $this
      ->t('Background color for inactive tabs in this group.'),
    '#default_value' => $this
      ->getSetting('inactive_bg'),
    '#size' => 10,
  ];
  $form['active_border_color'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Active border color'),
    '#description' => $this
      ->t('Border color for active tabs heads in this group.'),
    '#default_value' => $this
      ->getSetting('active_border_color'),
    '#size' => 10,
  ];
  $form['active_content_border_color'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('IActive content border color'),
    '#description' => $this
      ->t('Border color for active tabs contect in this group so that it matches the tab head border.'),
    '#default_value' => $this
      ->getSetting('active_content_border_color'),
    '#size' => 10,
  ];
  $form['id'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('The tab groups ID'),
    '#description' => $this
      ->t('The tab groups identifier *This should be a unique name for each tab group and should not be defined in any styling or css file.'),
    '#default_value' => $this
      ->getSetting('id'),
    '#weight' => 10,
    '#element_validate' => [
      'field_group_validate_id',
    ],
  ];
  return $form;
}