mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Merge branch 'MDL-43538-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
5c876ed21f
@ -256,12 +256,12 @@ M.util.show_confirm_dialog = function(e, args) {
|
||||
simpledialog.hide();
|
||||
|
||||
if (args.callback) {
|
||||
// args comes from PHP, so callback will be a string, needs to be evaluated by JS
|
||||
var callback = null;
|
||||
if (Y.Lang.isFunction(args.callback)) {
|
||||
callback = args.callback;
|
||||
} else {
|
||||
callback = eval('('+args.callback+')');
|
||||
Y.log('Callbacks to show_confirm_dialog must now be functions. Please update your code to pass in a function instead.',
|
||||
'warn', 'M.util.show_confirm_dialog');
|
||||
}
|
||||
|
||||
if (Y.Lang.isObject(args.scope)) {
|
||||
|
@ -93,13 +93,19 @@ class confirm_action extends component_action {
|
||||
*
|
||||
* @param string $message The message to display to the user when they are shown
|
||||
* the confirm dialogue.
|
||||
* @param string $callback The method to call when the user confirms the action.
|
||||
* @param string $callback Deprecated since 2.7
|
||||
* @param string $continuelabel The string to use for he continue button
|
||||
* @param string $cancellabel The string to use for the cancel button
|
||||
*/
|
||||
public function __construct($message, $callback = null, $continuelabel = null, $cancellabel = null) {
|
||||
if ($callback !== null) {
|
||||
debugging('The callback argument to new confirm_action() has been deprecated.' .
|
||||
' If you need to use a callback, please write Javascript to use moodle-core-notification-confirmation ' .
|
||||
'and attach to the provided events.',
|
||||
DEBUG_DEVELOPER);
|
||||
}
|
||||
parent::__construct('click', 'M.util.show_confirm_dialog', array(
|
||||
'message' => $message, 'callback' => $callback,
|
||||
'message' => $message,
|
||||
'continuelabel' => $continuelabel, 'cancellabel' => $cancellabel));
|
||||
}
|
||||
}
|
||||
@ -197,4 +203,4 @@ class popup_action extends component_action {
|
||||
|
||||
return $jsoptions;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,9 @@ YUI:
|
||||
JavaSript:
|
||||
* The findChildNodes global function has been deprecated. Y.all should
|
||||
be used instead.
|
||||
* The callback argument to confirm_action and M.util.show_confirm_dialog has been deprecated. If you need to write a
|
||||
confirmation which includes a callback, please use moodle-core-notification-confirmation and attach callbacks to the
|
||||
events provided.
|
||||
|
||||
* New locking api and admin settings to configure the system locking type.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user