Mercurial > hg > isophonics-drupal-site
annotate core/modules/quickedit/src/Ajax/FieldFormSavedCommand.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\quickedit\Ajax; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Core\Ajax\BaseCommand; |
Chris@0 | 6 |
Chris@0 | 7 /** |
Chris@0 | 8 * AJAX command to indicate a field was saved into PrivateTempStore without |
Chris@0 | 9 * validation errors and pass the rerendered field to Quick Edit's JavaScript |
Chris@0 | 10 * app. |
Chris@0 | 11 */ |
Chris@0 | 12 class FieldFormSavedCommand extends BaseCommand { |
Chris@0 | 13 |
Chris@0 | 14 /** |
Chris@0 | 15 * The same re-rendered edited field, but in different view modes. |
Chris@0 | 16 * |
Chris@0 | 17 * @var array |
Chris@0 | 18 */ |
Chris@0 | 19 protected $other_view_modes; |
Chris@0 | 20 |
Chris@0 | 21 /** |
Chris@0 | 22 * Constructs a FieldFormSavedCommand object. |
Chris@0 | 23 * |
Chris@0 | 24 * @param string $data |
Chris@0 | 25 * The re-rendered edited field to pass on to the client side. |
Chris@0 | 26 * @param array $other_view_modes |
Chris@0 | 27 * The same re-rendered edited field, but in different view modes, for other |
Chris@0 | 28 * instances of the same field on the user's page. Keyed by view mode. |
Chris@0 | 29 */ |
Chris@0 | 30 public function __construct($data, $other_view_modes = []) { |
Chris@0 | 31 parent::__construct('quickeditFieldFormSaved', $data); |
Chris@0 | 32 |
Chris@0 | 33 $this->other_view_modes = $other_view_modes; |
Chris@0 | 34 } |
Chris@0 | 35 |
Chris@0 | 36 /** |
Chris@0 | 37 * {@inheritdoc} |
Chris@0 | 38 */ |
Chris@0 | 39 public function render() { |
Chris@0 | 40 return [ |
Chris@0 | 41 'command' => $this->command, |
Chris@0 | 42 'data' => $this->data, |
Chris@0 | 43 'other_view_modes' => $this->other_view_modes, |
Chris@0 | 44 ]; |
Chris@0 | 45 } |
Chris@0 | 46 |
Chris@0 | 47 } |