You are here

function dialog_command_open_modal_dialog in Dialog 7.2

Creates a Drupal Ajax 'open modal dialog' command.

The modal dialog differs from the normal modal provided by dialog_command_open_dialog 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.

Parameters

string $title: The title of the dialog.

string|array $content: The content that will be placed in the dialog, either a render array or an HTML string.

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.

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.

Return value

array An array suitable for use with the ajax_render() function.

1 call to dialog_command_open_modal_dialog()
dialog_test_dialog_contents in tests/dialog_test.module
Menu callback: Returns the contents for dialogs opened by dialog_test_dialog().

File

includes/dialog.commands.inc, line 108
AJAX commands.

Code

function dialog_command_open_modal_dialog($title, $content, array $dialog_options = array(), $settings = NULL) {
  $dialog_options['modal'] = TRUE;
  return dialog_command_open_dialog('#drupal-modal', $title, $content, $dialog_options, $settings);
}