function UnicornEditor::validateImageUploadSettings

Same name and namespace in other branches
  1. 9 core/modules/editor/tests/modules/editor_test/src/Plugin/Editor/UnicornEditor.php \Drupal\editor_test\Plugin\Editor\UnicornEditor::validateImageUploadSettings()
  2. 10 core/modules/editor/tests/modules/editor_test/src/Plugin/Editor/UnicornEditor.php \Drupal\editor_test\Plugin\Editor\UnicornEditor::validateImageUploadSettings()

Render API callback: Image upload handler for confirmation form.

This function is assigned as a #element_validate callback.

Moves the text editor's image upload settings into $editor->image_upload.

See also

editor_image_upload_settings_form()

File

core/modules/editor/tests/modules/editor_test/src/Plugin/Editor/UnicornEditor.php, line 60

Class

UnicornEditor
Defines a Unicorn-powered text editor for Drupal (for testing purposes).

Namespace

Drupal\editor_test\Plugin\Editor

Code

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

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