From 65377780445bfbf00d31da113be60dae8e0a0bff Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Tue, 25 Aug 2015 22:05:33 +0800 Subject: [PATCH] MDL-49973 changed continue to delete on delete confirmations --- admin/user.php | 6 +++++- course/delete.php | 5 +++-- course/editsection.php | 2 +- question/classes/bank/view.php | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/admin/user.php b/admin/user.php index b05838c99858b..2dffa22349018 100644 --- a/admin/user.php +++ b/admin/user.php @@ -78,8 +78,12 @@ echo $OUTPUT->header(); $fullname = fullname($user, true); echo $OUTPUT->heading(get_string('deleteuser', 'admin')); + $optionsyes = array('delete'=>$delete, 'confirm'=>md5($delete), 'sesskey'=>sesskey()); - echo $OUTPUT->confirm(get_string('deletecheckfull', '', "'$fullname'"), new moodle_url($returnurl, $optionsyes), $returnurl); + $deleteurl = new moodle_url($returnurl, $optionsyes); + $deletebutton = new single_button($deleteurl, get_string('delete'), 'post'); + + echo $OUTPUT->confirm(get_string('deletecheckfull', '', "'$fullname'"), $deletebutton, $returnurl); echo $OUTPUT->footer(); die; } else if (data_submitted() and !$user->deleted) { diff --git a/course/delete.php b/course/delete.php index 31d48176d4054..1ddc12d8eafe6 100644 --- a/course/delete.php +++ b/course/delete.php @@ -76,11 +76,12 @@ $message = "{$strdeletecoursecheck}

{$coursefullname} ({$courseshortname})"; $continueurl = new moodle_url('/course/delete.php', array('id' => $course->id, 'delete' => md5($course->timemodified))); +$continuebutton = new single_button($continueurl, get_string('delete'), 'post'); $PAGE->navbar->add($strdeletecheck); $PAGE->set_title("$SITE->shortname: $strdeletecheck"); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header(); -echo $OUTPUT->confirm($message, $continueurl, $categoryurl); +echo $OUTPUT->confirm($message, $continuebutton, $categoryurl); echo $OUTPUT->footer(); -exit; \ No newline at end of file +exit; diff --git a/course/editsection.php b/course/editsection.php index 76b49eb7eed12..ea4724aecc12e 100644 --- a/course/editsection.php +++ b/course/editsection.php @@ -66,7 +66,7 @@ echo $OUTPUT->box_start('noticebox'); $optionsyes = array('id' => $id, 'confirm' => 1, 'delete' => 1, 'sesskey' => sesskey()); $deleteurl = new moodle_url('/course/editsection.php', $optionsyes); - $formcontinue = new single_button($deleteurl, get_string('continue')); + $formcontinue = new single_button($deleteurl, get_string('delete')); $formcancel = new single_button($cancelurl, get_string('cancel'), 'get'); echo $OUTPUT->confirm(get_string('confirmdeletesection', '', get_section_name($course, $sectioninfo)), $formcontinue, $formcancel); diff --git a/question/classes/bank/view.php b/question/classes/bank/view.php index 04e076d5385e7..42c17cf650436 100644 --- a/question/classes/bank/view.php +++ b/question/classes/bank/view.php @@ -923,7 +923,8 @@ public function process_actions_needing_ui() { $deleteurl = new \moodle_url($baseurl, array('deleteselected' => $questionlist, 'confirm' => md5($questionlist), 'sesskey' => sesskey())); - echo $OUTPUT->confirm(get_string('deletequestionscheck', 'question', $questionnames), $deleteurl, $baseurl); + $continue = new \single_button($deleteurl, get_string('delete'), 'post'); + echo $OUTPUT->confirm(get_string('deletequestionscheck', 'question', $questionnames), $continue, $baseurl); return true; }