"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/modules/editor/src/Ajax/EditorDialogSave.php" (26 Nov 2020, 851 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "EditorDialogSave.php" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 9.0.8_vs_9.1.0-rc1.

    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 }