class OpenModalDialogCommand

Defines an AJAX command to open certain content in a dialog in a modal dialog.

Hierarchy

Expanded class hierarchy of OpenModalDialogCommand

4 files declare their use of OpenModalDialogCommand
AjaxCommandsUnitTest.php in drupal/core/modules/system/lib/Drupal/system/Tests/Ajax/AjaxCommandsUnitTest.php
Definition of Drupal\system\Tests\Ajax\AjaxCommandsUnitTest.
ajax_test.module in drupal/core/modules/system/tests/modules/ajax_test/ajax_test.module
Helper module for Ajax framework tests.
config.admin.inc in drupal/core/modules/config/config.admin.inc
Admin page callbacks for the config module.
ConfigController.php in drupal/core/modules/config/lib/Drupal/config/Controller/ConfigController.php
Contains \Drupal\config\Controller\ConfigController

File

drupal/core/lib/Drupal/Core/Ajax/OpenModalDialogCommand.php, line 15
Contains \Drupal\Core\Ajax\OpenModalDialogCommand.

Namespace

Drupal\Core\Ajax
View source
class OpenModalDialogCommand extends OpenDialogCommand {

  /**
   * Constructs an OpenModalDialog object.
   *
   * The modal dialog differs from the normal modal provided by
   * OpenDialogCommand in that a modal prevents other interactions on the page
   * until the modal has been completed. Drupal provides a built-in modal for
   * this purpose, so no selector needs to be provided.
   *
   * @param string $title
   *   The title of the dialog.
   * @param string $html
   *   HTML that will be placed in the dialog.
   * @param array $dialog_options
   *   (optional) Settings to be passed to the dialog implementation. Any
   *   jQuery UI option can be used. See http://api.jqueryui.com/dialog.
   * @param array|null $settings
   *   (optional) Custom settings that will be passed to the Drupal behaviors
   *   on the content of the dialog. If left empty, the settings will be
   *   populated automatically from the current request.
   */
  public function __construct($title, $html, array $dialog_options = array(), $settings = NULL) {
    $dialog_options['modal'] = TRUE;
    parent::__construct('#drupal-modal', $title, $html, $dialog_options, $settings);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OpenDialogCommand::$dialogOptions protected property Stores dialog-specific options passed directly to jQuery UI dialogs. Any jQuery UI option can be used. See http://api.jqueryui.com/dialog.
OpenDialogCommand::$html protected property HTML content that will placed in the dialog.
OpenDialogCommand::$selector protected property The selector of the dialog.
OpenDialogCommand::$settings protected property Custom settings that will be passed to the Drupal behaviors on the content of the dialog.
OpenDialogCommand::$title protected property The title of the dialog.
OpenDialogCommand::getDialogOptions public function Returns the dialog options.
OpenDialogCommand::render public function Implements \Drupal\Core\Ajax\CommandInterface:render(). Overrides CommandInterface::render
OpenDialogCommand::setDialogOption public function Sets a single dialog option value.
OpenDialogCommand::setDialogOptions public function Sets the dialog options array.
OpenDialogCommand::setDialogTitle public function Sets the dialog title (an alias of setDialogOptions).
OpenModalDialogCommand::__construct public function Constructs an OpenModalDialog object. Overrides OpenDialogCommand::__construct