annotate core/lib/Drupal/Core/Ajax/OpenModalDialogCommand.php @ 13:5fb285c0d0e3

Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've been lucky to get away with this so far, as we don't support self-registration which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5 was vulnerable to.
author Chris Cannam
date Mon, 23 Apr 2018 09:33:26 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Core\Ajax;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * Defines an AJAX command to open certain content in a dialog in a modal dialog.
Chris@0 7 *
Chris@0 8 * @ingroup ajax
Chris@0 9 */
Chris@0 10 class OpenModalDialogCommand extends OpenDialogCommand {
Chris@0 11 /**
Chris@0 12 * Constructs an OpenModalDialog object.
Chris@0 13 *
Chris@0 14 * The modal dialog differs from the normal modal provided by
Chris@0 15 * OpenDialogCommand in that a modal prevents other interactions on the page
Chris@0 16 * until the modal has been completed. Drupal provides a built-in modal for
Chris@0 17 * this purpose, so no selector needs to be provided.
Chris@0 18 *
Chris@0 19 * @param string $title
Chris@0 20 * The title of the dialog.
Chris@0 21 * @param string|array $content
Chris@0 22 * The content that will be placed in the dialog, either a render array
Chris@0 23 * or an HTML string.
Chris@0 24 * @param array $dialog_options
Chris@0 25 * (optional) Settings to be passed to the dialog implementation. Any
Chris@0 26 * jQuery UI option can be used. See http://api.jqueryui.com/dialog.
Chris@0 27 * @param array|null $settings
Chris@0 28 * (optional) Custom settings that will be passed to the Drupal behaviors
Chris@0 29 * on the content of the dialog. If left empty, the settings will be
Chris@0 30 * populated automatically from the current request.
Chris@0 31 */
Chris@0 32 public function __construct($title, $content, array $dialog_options = [], $settings = NULL) {
Chris@0 33 $dialog_options['modal'] = TRUE;
Chris@0 34 parent::__construct('#drupal-modal', $title, $content, $dialog_options, $settings);
Chris@0 35 }
Chris@0 36
Chris@0 37 }