MDL-77174 mod_quiz: Switch from YUI dialogue to utility modal
This commit is contained in:
@@ -707,11 +707,12 @@ abstract class attempts_report_table extends \table_sql {
|
||||
'data-action' => 'toggle',
|
||||
'data-togglegroup' => $this->togglegroup,
|
||||
'data-toggle' => 'action',
|
||||
'disabled' => true
|
||||
'disabled' => true,
|
||||
'data-modal' => 'confirmation',
|
||||
'data-modal-type' => 'delete',
|
||||
'data-modal-content-str' => json_encode(['deleteattemptcheck', 'quiz']),
|
||||
];
|
||||
echo html_writer::empty_tag('input', $deletebuttonparams);
|
||||
$PAGE->requires->event_handler('#deleteattemptsbutton', 'click', 'M.util.show_confirm_dialog',
|
||||
['message' => get_string('deleteattemptcheck', 'quiz')]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -417,7 +417,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
// Create the confirmation dialogue.
|
||||
require(['core/notification'], function(Notification) {
|
||||
Notification.saveCancelPromise(
|
||||
M.util.get_string('confirmation', 'admin'),
|
||||
M.util.get_string('confirm', 'moodle'),
|
||||
M.util.get_string('confirmremovequestion', 'quiz', qtypename),
|
||||
M.util.get_string('yes', 'moodle')
|
||||
).then(function() {
|
||||
@@ -522,7 +522,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
|
||||
require(['core/notification'], function(Notification) {
|
||||
Notification.saveCancelPromise(
|
||||
M.util.get_string('confirmation', 'admin'),
|
||||
M.util.get_string('confirm', 'moodle'),
|
||||
M.util.get_string('areyousureremoveselected', 'quiz'),
|
||||
M.util.get_string('yes', 'moodle')
|
||||
).then(function() {
|
||||
@@ -929,9 +929,10 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
|
||||
* @chainable
|
||||
*/
|
||||
delete_section_with_confirmation: function(ev, button, activity) {
|
||||
ev.preventDefault();
|
||||
require(['core/notification'], function(Notification) {
|
||||
Notification.saveCancelPromise(
|
||||
M.util.get_string('confirmation', 'admin'),
|
||||
M.util.get_string('confirm', 'moodle'),
|
||||
M.util.get_string('confirmremovesectionheading', 'quiz', activity.getData('sectionname')),
|
||||
M.util.get_string('yes', 'moodle')
|
||||
).then(function() {
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
@@ -417,7 +417,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
// Create the confirmation dialogue.
|
||||
require(['core/notification'], function(Notification) {
|
||||
Notification.saveCancelPromise(
|
||||
M.util.get_string('confirmation', 'admin'),
|
||||
M.util.get_string('confirm', 'moodle'),
|
||||
M.util.get_string('confirmremovequestion', 'quiz', qtypename),
|
||||
M.util.get_string('yes', 'moodle')
|
||||
).then(function() {
|
||||
@@ -522,7 +522,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
|
||||
require(['core/notification'], function(Notification) {
|
||||
Notification.saveCancelPromise(
|
||||
M.util.get_string('confirmation', 'admin'),
|
||||
M.util.get_string('confirm', 'moodle'),
|
||||
M.util.get_string('areyousureremoveselected', 'quiz'),
|
||||
M.util.get_string('yes', 'moodle')
|
||||
).then(function() {
|
||||
@@ -929,9 +929,10 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
|
||||
* @chainable
|
||||
*/
|
||||
delete_section_with_confirmation: function(ev, button, activity) {
|
||||
ev.preventDefault();
|
||||
require(['core/notification'], function(Notification) {
|
||||
Notification.saveCancelPromise(
|
||||
M.util.get_string('confirmation', 'admin'),
|
||||
M.util.get_string('confirm', 'moodle'),
|
||||
M.util.get_string('confirmremovesectionheading', 'quiz', activity.getData('sectionname')),
|
||||
M.util.get_string('yes', 'moodle')
|
||||
).then(function() {
|
||||
|
||||
+2
-2
@@ -184,7 +184,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
// Create the confirmation dialogue.
|
||||
require(['core/notification'], function(Notification) {
|
||||
Notification.saveCancelPromise(
|
||||
M.util.get_string('confirmation', 'admin'),
|
||||
M.util.get_string('confirm', 'moodle'),
|
||||
M.util.get_string('confirmremovequestion', 'quiz', qtypename),
|
||||
M.util.get_string('yes', 'moodle')
|
||||
).then(function() {
|
||||
@@ -289,7 +289,7 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
|
||||
require(['core/notification'], function(Notification) {
|
||||
Notification.saveCancelPromise(
|
||||
M.util.get_string('confirmation', 'admin'),
|
||||
M.util.get_string('confirm', 'moodle'),
|
||||
M.util.get_string('areyousureremoveselected', 'quiz'),
|
||||
M.util.get_string('yes', 'moodle')
|
||||
).then(function() {
|
||||
|
||||
+2
-1
@@ -108,9 +108,10 @@ Y.extend(SECTIONTOOLBOX, TOOLBOX, {
|
||||
* @chainable
|
||||
*/
|
||||
delete_section_with_confirmation: function(ev, button, activity) {
|
||||
ev.preventDefault();
|
||||
require(['core/notification'], function(Notification) {
|
||||
Notification.saveCancelPromise(
|
||||
M.util.get_string('confirmation', 'admin'),
|
||||
M.util.get_string('confirm', 'moodle'),
|
||||
M.util.get_string('confirmremovesectionheading', 'quiz', activity.getData('sectionname')),
|
||||
M.util.get_string('yes', 'moodle')
|
||||
).then(function() {
|
||||
|
||||
Reference in New Issue
Block a user