You are here

public function EditorAdvancedImage::settingsForm in Editor Advanced Image 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/CKEditorPlugin/EditorAdvancedImage.php \Drupal\editor_advanced_image\Plugin\CKEditorPlugin\EditorAdvancedImage::settingsForm()

Overrides CKEditorPluginConfigurableInterface::settingsForm

See also

\Drupal\editor\Form\EditorImageDialog

editor_image_upload_settings_form()

File

src/Plugin/CKEditorPlugin/EditorAdvancedImage.php, line 74

Class

EditorAdvancedImage
Defines the "editoradvancedimage" plugin.

Namespace

Drupal\editor_advanced_image\Plugin\CKEditorPlugin

Code

public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) {

  // Defaults.
  $settings = $editor
    ->getSettings();
  $form['default_class'] = [
    '#title' => $this
      ->t('Default image class(es)'),
    '#type' => 'textfield',
    '#default_value' => !empty($settings['plugins']['editoradvancedimage']['default_class']) ? $settings['plugins']['editoradvancedimage']['default_class'] : '',
    '#description' => $this
      ->t('A list of classes that will be added when the user adds an inline-image with CKEditor. <br>Enter one or more classes separated by spaces. Example: <code>img-responsive</code> or <code>img-fluid</code>.'),
  ];
  return $form;
}