You are here

public function OptionsFormHelperTrait::getFieldsetElement in FullCalendar 8.4

Same name and namespace in other branches
  1. 8.5 src/Plugin/fullcalendar/type/OptionsFormHelperTrait.php \Drupal\fullcalendar\Plugin\fullcalendar\type\OptionsFormHelperTrait::getFieldsetElement()
  2. 8.2 src/Plugin/fullcalendar/type/OptionsFormHelperTrait.php \Drupal\fullcalendar\Plugin\fullcalendar\type\OptionsFormHelperTrait::getFieldsetElement()

Build a fieldset form element.

Parameters

string $title: The title of the fieldset.

string $description: The description.

bool $open: If TRUE, the fieldset is open when the form loads.

string $fieldset: The name of the parent fieldset.

array $states: The FAPI states property.

Return value

array Drupal FAPI array.

1 call to OptionsFormHelperTrait::getFieldsetElement()
FullCalendar::buildOptionsForm in src/Plugin/fullcalendar/type/FullCalendar.php

File

src/Plugin/fullcalendar/type/OptionsFormHelperTrait.php, line 190

Class

OptionsFormHelperTrait

Namespace

Drupal\fullcalendar\Plugin\fullcalendar\type

Code

public function getFieldsetElement($title, $description = '', $open = FALSE, $fieldset = '', array $states = []) {
  $details = [
    '#type' => 'details',
    '#title' => $title,
    '#collapsible' => TRUE,
    '#open' => $open,
    '#prefix' => '<div class="clearfix" style="overflow: hidden;">',
    '#suffix' => '</div>',
  ];
  if ($description) {
    $details['#description'] = $description;
  }
  if ($fieldset) {
    $details['#fieldset'] = $fieldset;
  }
  if ($states) {
    $details['#states'] = $states;
  }
  return $details;
}