You are here

class EditorDialogSave in Zircon Profile 8.0

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

2 files declare their use of EditorDialogSave
EditorImageDialog.php in core/modules/editor/src/Form/EditorImageDialog.php
Contains \Drupal\editor\Form\EditorImageDialog.
EditorLinkDialog.php in core/modules/editor/src/Form/EditorLinkDialog.php
Contains \Drupal\editor\Form\EditorLinkDialog.

File

core/modules/editor/src/Ajax/EditorDialogSave.php, line 18
Contains \Drupal\editor\Ajax\EditorDialogSave.

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 a 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 array(
      '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 a EditorDialogSave object.