Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Ajax / OpenModalDialogCommand.php
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   /**
13    * Constructs an OpenModalDialog object.
14    *
15    * The modal dialog differs from the normal modal provided by
16    * OpenDialogCommand in that a modal prevents other interactions on the page
17    * until the modal has been completed. Drupal provides a built-in modal for
18    * this purpose, so no selector needs to be provided.
19    *
20    * @param string $title
21    *   The title of the dialog.
22    * @param string|array $content
23    *   The content that will be placed in the dialog, either a render array
24    *   or an HTML string.
25    * @param array $dialog_options
26    *   (optional) Settings to be passed to the dialog implementation. Any
27    *   jQuery UI option can be used. See http://api.jqueryui.com/dialog.
28    * @param array|null $settings
29    *   (optional) Custom settings that will be passed to the Drupal behaviors
30    *   on the content of the dialog. If left empty, the settings will be
31    *   populated automatically from the current request.
32    */
33   public function __construct($title, $content, array $dialog_options = [], $settings = NULL) {
34     $dialog_options['modal'] = TRUE;
35     parent::__construct('#drupal-modal', $title, $content, $dialog_options, $settings);
36   }
37
38 }