You are here

public function GridStackSettingsForm::getPluginOptions in GridStack 8.2

Returns available plugins for select options.

1 call to GridStackSettingsForm::getPluginOptions()
GridStackSettingsForm::buildForm in modules/gridstack_ui/src/Form/GridStackSettingsForm.php
Implements \Drupal\Core\Form\FormInterface::buildForm().

File

modules/gridstack_ui/src/Form/GridStackSettingsForm.php, line 219

Class

GridStackSettingsForm
Defines the GridStack admin settings form.

Namespace

Drupal\gridstack_ui\Form

Code

public function getPluginOptions() {
  if (!isset($this->pluginOptions)) {
    $options = [];
    foreach ($this->manager
      ->engineManager()
      ->loadMultiple() as $plugin) {
      if ($plugin
        ->get('hidden') === 'true') {
        continue;
      }
      $options[$plugin
        ->getPluginId()] = $plugin
        ->label();
    }
    ksort($options);
    $this->pluginOptions = $options;
  }
  return $this->pluginOptions;
}