Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/Ajax/OpenModalDialogCommand.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Core\Ajax; | |
4 | |
5 /** | |
6 * Defines an AJAX command to open certain content in a dialog in a modal dialog. | |
7 * | |
8 * @ingroup ajax | |
9 */ | |
10 class OpenModalDialogCommand extends OpenDialogCommand { | |
11 /** | |
12 * Constructs an OpenModalDialog object. | |
13 * | |
14 * The modal dialog differs from the normal modal provided by | |
15 * OpenDialogCommand in that a modal prevents other interactions on the page | |
16 * until the modal has been completed. Drupal provides a built-in modal for | |
17 * this purpose, so no selector needs to be provided. | |
18 * | |
19 * @param string $title | |
20 * The title of the dialog. | |
21 * @param string|array $content | |
22 * The content that will be placed in the dialog, either a render array | |
23 * or an HTML string. | |
24 * @param array $dialog_options | |
25 * (optional) Settings to be passed to the dialog implementation. Any | |
26 * jQuery UI option can be used. See http://api.jqueryui.com/dialog. | |
27 * @param array|null $settings | |
28 * (optional) Custom settings that will be passed to the Drupal behaviors | |
29 * on the content of the dialog. If left empty, the settings will be | |
30 * populated automatically from the current request. | |
31 */ | |
32 public function __construct($title, $content, array $dialog_options = [], $settings = NULL) { | |
33 $dialog_options['modal'] = TRUE; | |
34 parent::__construct('#drupal-modal', $title, $content, $dialog_options, $settings); | |
35 } | |
36 | |
37 } |