commit 945e2031dd9b7d026ccb80691a1153a7dbc19b11 Author: Nathan Haug Date: Wed Mar 13 17:12:05 2013 -0700 1870764-75 diff --git a/core/lib/Drupal/Core/Ajax/CloseModalDialogCommand.php b/core/lib/Drupal/Core/Ajax/CloseModalDialogCommand.php index 85c4057..0897700 100644 --- a/core/lib/Drupal/Core/Ajax/CloseModalDialogCommand.php +++ b/core/lib/Drupal/Core/Ajax/CloseModalDialogCommand.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Ajax\CloseDialogCommand. + * Contains \Drupal\Core\Ajax\CloseModalDialogCommand. */ namespace Drupal\Core\Ajax; @@ -14,7 +14,7 @@ */ class CloseModalDialogCommand extends CloseDialogCommand { /** - * Constructs a CloseDialogCommand object. + * Constructs a CloseModalDialogCommand object. */ public function __construct() { $this->selector = '#drupal-modal'; diff --git a/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php b/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php index 45a4b25..45115df 100644 --- a/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php +++ b/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php @@ -36,14 +36,16 @@ class OpenDialogCommand implements CommandInterface { protected $html; /** - * Stores dialog-specific options passed directly to jQuery UI dialogs. + * Stores dialog-specific options passed directly to jQuery UI dialogs. Any + * jQuery UI option can be used. See http://api.jqueryui.com/dialog. * * @var array */ protected $dialogOptions; /** - * Other settings that will be passed to the behavior. + * Custom settings that will be passed to the Drupal behaviors on the content + * of the dialog. * * @var array */ @@ -62,7 +64,9 @@ class OpenDialogCommand implements CommandInterface { * (optional) Options 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) Other settings that will be passed to the behavior. + * (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($selector, $title, $html, array $dialog_options = array(), $settings = NULL) { $dialog_options += array('title' => $title); @@ -77,7 +81,7 @@ public function __construct($selector, $title, $html, array $dialog_options = ar * * @return array */ - public function getdialogOptions() { + public function getDialogOptions() { return $this->dialogOptions; } @@ -85,9 +89,10 @@ public function getdialogOptions() { * Sets the dialog options array. * * @param array $dialog_options - * An array of keys passed to the Drupal.dialog javascript object. + * Options to be passed to the dialog implementation. Any jQuery UI option + * can be used. See http://api.jqueryui.com/dialog. */ - public function setdialogOptions($dialog_options) { + public function setDialogOptions($dialog_options) { $this->dialogOptions = $dialog_options; } @@ -95,9 +100,10 @@ public function setdialogOptions($dialog_options) { * Sets a single dialog option value. * * @param string $key - * Key of the dialog option. + * Key of the dialog option. Any jQuery UI option can be used. + * See http://api.jqueryui.com/dialog. * @param mixed $value - * The value of the option. + * Option to be passed to the dialog implementation. */ public function setDialogOption($key, $value) { $this->dialogOptions[$key] = $value; @@ -106,7 +112,7 @@ public function setDialogOption($key, $value) { /** * Sets the dialog title (an alias of setDialogOptions). * - * @param mixed $title + * @param string $title * The new title of the dialog. */ public function setDialogTitle($title) { diff --git a/core/lib/Drupal/Core/Ajax/OpenModalDialogCommand.php b/core/lib/Drupal/Core/Ajax/OpenModalDialogCommand.php index fe1afe7..c78406e 100644 --- a/core/lib/Drupal/Core/Ajax/OpenModalDialogCommand.php +++ b/core/lib/Drupal/Core/Ajax/OpenModalDialogCommand.php @@ -29,7 +29,9 @@ class OpenModalDialogCommand extends OpenDialogCommand { * (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) Other settings that will be passed to the behavior. + * (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; diff --git a/core/lib/Drupal/Core/Ajax/SetDialogOptionCommand.php b/core/lib/Drupal/Core/Ajax/SetDialogOptionCommand.php index b4f5454..088c63b 100644 --- a/core/lib/Drupal/Core/Ajax/SetDialogOptionCommand.php +++ b/core/lib/Drupal/Core/Ajax/SetDialogOptionCommand.php @@ -24,30 +24,31 @@ class SetDialogOptionCommand implements CommandInterface { * * @var string */ - protected $option_name; + protected $optionName; /** * A jQuery UI dialog option value. * * @var mixed */ - protected $option_value; + protected $optionValue; /** - * Constructs a CloseDialogCommand object. + * Constructs a SetDialogOptionCommand object. * * @param string $selector - * The selector of the dialog to close. + * The selector of the dialog whose title will be set. If set to an empty + * value, the default modal dialog will be selected. * @param string $option_name * The name of the option to set. May be any jQuery UI dialog option. - * See See http://api.jqueryui.com/dialog. + * See http://api.jqueryui.com/dialog. * @param mixed $option_value * The value of the option to be passed to the dialog. */ - public function __construct($selector = NULL, $option_name, $option_value) { + public function __construct($selector, $option_name, $option_value) { $this->selector = $selector ? $selector : '#drupal-modal'; - $this->option_name = $option_name; - $this->option_value = $option_value; + $this->optionName = $option_name; + $this->optionValue = $option_value; } /** @@ -57,8 +58,8 @@ public function render() { return array( 'command' => 'setDialogOption', 'selector' => $this->selector, - 'optionName' => $this->option_name, - 'optionValue' => $this->option_value, + 'optionName' => $this->optionName, + 'optionValue' => $this->optionValue, ); } diff --git a/core/lib/Drupal/Core/Ajax/SetDialogTitleCommand.php b/core/lib/Drupal/Core/Ajax/SetDialogTitleCommand.php index d7aaf88..b928e1e 100644 --- a/core/lib/Drupal/Core/Ajax/SetDialogTitleCommand.php +++ b/core/lib/Drupal/Core/Ajax/SetDialogTitleCommand.php @@ -18,13 +18,14 @@ class SetDialogTitleCommand extends SetDialogOptionCommand { * Constructs a SetDialogTitleCommand object. * * @param string $selector - * The selector of the dialog whose title will be set. + * The selector of the dialog whose title will be set. If set to an empty + * value, the default modal dialog will be selected. * @param string $title * The title that will be set on the dialog. */ - public function __construct($selector = NULL, $title) { + public function __construct($selector, $title) { $this->selector = $selector ? $selector : '#drupal-modal'; - $this->option_name = 'title'; - $this->option_value = $title; + $this->optionName = 'title'; + $this->optionValue = $title; } } diff --git a/core/lib/Drupal/Core/Ajax/SetWindowLocationCommand.php b/core/lib/Drupal/Core/Ajax/SetWindowLocationCommand.php index a4ee25a..28c4f40 100644 --- a/core/lib/Drupal/Core/Ajax/SetWindowLocationCommand.php +++ b/core/lib/Drupal/Core/Ajax/SetWindowLocationCommand.php @@ -22,7 +22,7 @@ class SetWindowLocationCommand implements CommandInterface { protected $url; /** - * Constructs an OpenDialog object. + * Constructs an SetWindowLocationCommand object. * * @param string $url * The URL that will be loaded into window.location. This should be a full diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php index 5b801f8..32aea71 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php @@ -14,7 +14,7 @@ class DialogTest extends AjaxTestBase { public static function getInfo() { return array( 'name' => 'AJAX dialogs commands', - 'description' => 'Performs tests on opening and manipulate dialogs via AJAX commands.', + 'description' => 'Performs tests on opening and manipulating dialogs via AJAX commands.', 'group' => 'AJAX', ); }