public function CKEditorPluginManager::injectPluginSettingsForm

Injects the CKEditor plugins settings forms as a vertical tabs subform.

Parameters

array &$form: A reference to an associative array containing the structure of the form.

array &$form_state: A reference to a keyed array containing the current state of the form.

\Drupal\editor\Plugin\Core\Entity\Editor $editor: A configured text editor object.

File

drupal/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php, line 132
Contains \Drupal\ckeditor\CKEditorPluginManager.

Class

CKEditorPluginManager
CKEditor Plugin manager.

Namespace

Drupal\ckeditor

Code

public function injectPluginSettingsForm(array &$form, array &$form_state, Editor $editor) {
  $definitions = $this
    ->getDefinitions();
  foreach (array_keys($definitions) as $plugin_id) {
    $plugin = $this
      ->createInstance($plugin_id);
    if ($plugin instanceof CKEditorPluginConfigurableInterface) {
      $plugin_settings_form = array();
      $form['plugins'][$plugin_id] = array(
        '#type' => 'details',
        '#title' => $definitions[$plugin_id]['label'],
        '#group' => 'editor][settings][plugin_settings',
      );
      $form['plugins'][$plugin_id] += $plugin
        ->settingsForm($plugin_settings_form, $form_state, $editor);
    }
  }
}