shouldHaveVisiblePluginSettingsForm example


  private function injectPluginSettingsForm(array &$form, FormStateInterface $form_state, EditorInterface $editor): void {
    $definitions = $this->ckeditor5PluginManager->getDefinitions();
    $eventual_editor_and_format = $this->getEventualEditorWithPrimedFilterFormat($form_state$editor);

    foreach ($definitions as $plugin_id => $definition) {
      if ($definition->isConfigurable() && $this->shouldHaveVisiblePluginSettingsForm($definition$eventual_editor_and_format)) {
        $plugin = $this->ckeditor5PluginManager->getPlugin($plugin_id$editor);
        $plugin_settings_form = [];
        $form['plugins'][$plugin_id] = [
          '#type' => 'details',
          '#title' => $definition->label(),
          '#open' => TRUE,
          '#group' => 'editor][settings][plugin_settings',
          '#attributes' => [
            'data-ckeditor5-plugin-id' => $plugin_id,
          ],
        ];
        
Home | Imprint | This part of the site doesn't use cookies.