You are here

public function GridStackAdmin::getOptionsetsByGroupOptions in GridStack 8.2

Returns available options for select options.

1 call to GridStackAdmin::getOptionsetsByGroupOptions()
GridStackAdmin::buildSettingsForm in src/Form/GridStackAdmin.php
Returns all settings form elements.

File

src/Form/GridStackAdmin.php, line 204

Class

GridStackAdmin
Provides reusable admin functions or form elements.

Namespace

Drupal\gridstack\Form

Code

public function getOptionsetsByGroupOptions($group = '') {
  if (!isset($this->optionsetOptions[$group])) {
    $optionsets = [];
    foreach ($this->manager
      ->entityLoadMultiple('gridstack') as $key => $entity) {

      // Exludes Boostrap/ Foundation grids which only work for LB.
      if ($group && $group == 'js' && $entity
        ->getOption('use_framework')) {
        continue;
      }
      $optionsets[$key] = Html::escape($entity
        ->label());
    }
    ksort($optionsets);
    $this->optionsetOptions[$group] = $optionsets;
  }
  return $this->optionsetOptions[$group];
}