You are here

class EditorDialogSave in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/editor/src/Ajax/EditorDialogSave.php \Drupal\editor\Ajax\EditorDialogSave

Provides an AJAX command for saving the contents of an editor dialog.

This command is implemented in editor.dialog.js in Drupal.AjaxCommands.prototype.editorDialogSave.

Hierarchy

Expanded class hierarchy of EditorDialogSave

4 files declare their use of EditorDialogSave
EditorImageDialog.php in core/modules/editor/src/Form/EditorImageDialog.php
EditorLinkDialog.php in core/modules/editor/src/Form/EditorLinkDialog.php
EditorMediaDialog.php in core/modules/media/src/Form/EditorMediaDialog.php
MediaLibraryEditorOpener.php in core/modules/media_library/src/MediaLibraryEditorOpener.php

File

core/modules/editor/src/Ajax/EditorDialogSave.php, line 13

Namespace

Drupal\editor\Ajax
View source
class EditorDialogSave implements CommandInterface {

  /**
   * An array of values that will be passed back to the editor by the dialog.
   *
   * @var string
   */
  protected $values;

  /**
   * Constructs an EditorDialogSave object.
   *
   * @param string $values
   *   The values that should be passed to the form constructor in Drupal.
   */
  public function __construct($values) {
    $this->values = $values;
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    return [
      'command' => 'editorDialogSave',
      'values' => $this->values,
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EditorDialogSave::$values protected property An array of values that will be passed back to the editor by the dialog.
EditorDialogSave::render public function Return an array to be run through json_encode and sent to the client. Overrides CommandInterface::render
EditorDialogSave::__construct public function Constructs an EditorDialogSave object.