Added Entity and Entity Reference Revisions which got dropped somewhere along the...
[yaffs-website] / web / core / modules / editor / src / Ajax / EditorDialogSave.php
1 <?php
2
3 namespace Drupal\editor\Ajax;
4
5 use Drupal\Core\Ajax\CommandInterface;
6
7 /**
8  * Provides an AJAX command for saving the contents of an editor dialog.
9  *
10  * This command is implemented in editor.dialog.js in
11  * Drupal.AjaxCommands.prototype.editorDialogSave.
12  */
13 class EditorDialogSave implements CommandInterface {
14
15   /**
16    * An array of values that will be passed back to the editor by the dialog.
17    *
18    * @var string
19    */
20   protected $values;
21
22   /**
23    * Constructs a EditorDialogSave object.
24    *
25    * @param string $values
26    *   The values that should be passed to the form constructor in Drupal.
27    */
28   public function __construct($values) {
29     $this->values = $values;
30   }
31
32   /**
33    * {@inheritdoc}
34    */
35   public function render() {
36     return [
37       'command' => 'editorDialogSave',
38       'values' => $this->values,
39     ];
40   }
41
42 }