function DrupalImage::validateImageUploadSettings

Same name and namespace in other branches
  1. 9 core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php \Drupal\ckeditor\Plugin\CKEditorPlugin\DrupalImage::validateImageUploadSettings()

#element_validate handler for the "image_upload" element in settingsForm().

Moves the text editor's image upload settings from the DrupalImage plugin's own settings into $editor->image_upload.

See also

\Drupal\editor\Form\EditorImageDialog

editor_image_upload_settings_form()

File

core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php, line 82

Class

DrupalImage
Defines the "drupalimage" plugin.

Namespace

Drupal\ckeditor\Plugin\CKEditorPlugin

Code

public function validateImageUploadSettings(array $element, FormStateInterface $form_state) {
    $settings =& $form_state->getValue([
        'editor',
        'settings',
        'plugins',
        'drupalimage',
        'image_upload',
    ]);
    $form_state->get('editor')
        ->setImageUploadSettings($settings);
    $form_state->unsetValue([
        'editor',
        'settings',
        'plugins',
        'drupalimage',
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.