You are here

public function GridStackAdmin::buildSettingsForm in GridStack 8.2

Same name and namespace in other branches
  1. 8 src/Form/GridStackAdmin.php \Drupal\gridstack\Form\GridStackAdmin::buildSettingsForm()

Returns all settings form elements.

Some settings might be required by Outlayer, such as style.

File

src/Form/GridStackAdmin.php, line 79

Class

GridStackAdmin
Provides reusable admin functions or form elements.

Namespace

Drupal\gridstack\Form

Code

public function buildSettingsForm(array &$form, $definition = []) {
  $definition['namespace'] = 'gridstack';
  $definition['skins'] = $this
    ->getSkinOptions();
  $definition['style'] = !empty($definition['style']);
  $definition['grid_form'] = !empty($definition['grid_form']);
  $definition['optionsets'] = $this
    ->getOptionsetsByGroupOptions('js');
  foreach ([
    'background',
    'caches',
    'fieldable_form',
    'vanilla',
  ] as $key) {
    $definition[$key] = isset($definition[$key]) ? $definition[$key] : TRUE;
  }
  $definition['layouts'] = isset($definition['layouts']) ? array_merge($this
    ->getLayoutOptions(), $definition['layouts']) : $this
    ->getLayoutOptions();
  $this
    ->openingForm($form, $definition);
  $this
    ->mainForm($form, $definition);
  $this
    ->closingForm($form, $definition);
}