From ad83f25e94b67b92c6df5bbb25ea29f1602a1f5e Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Mon, 9 Jul 2018 10:56:48 +0800 Subject: [PATCH] MDL-43334 backup: Lanuage for cancel Cancel backup buttons need clear lang strings. --- backup/backup.php | 6 +++++- backup/util/ui/base_moodleform.class.php | 2 +- lang/en/backup.php | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backup/backup.php b/backup/backup.php index 3df327aa24a33..c1b1f648f509e 100644 --- a/backup/backup.php +++ b/backup/backup.php @@ -34,6 +34,7 @@ $courseid = required_param('id', PARAM_INT); $sectionid = optional_param('section', null, PARAM_INT); $cmid = optional_param('cm', null, PARAM_INT); +$cancel = optional_param('cancel', '', PARAM_ALPHA); /** * Part of the forms in stages after initial, is POST never GET */ @@ -104,7 +105,10 @@ $PAGE->set_heading($heading); $renderer = $PAGE->get_renderer('core','backup'); -echo $OUTPUT->header(); +if (empty($cancel)) { + // Do not print the header if user cancelled the process, as we are going to redirect the user. + echo $OUTPUT->header(); +} // Prepare a progress bar which can display optionally during long-running // operations while setting up the UI. diff --git a/backup/util/ui/base_moodleform.class.php b/backup/util/ui/base_moodleform.class.php index 70198fd06f7fe..5d8d646fb9e59 100644 --- a/backup/util/ui/base_moodleform.class.php +++ b/backup/util/ui/base_moodleform.class.php @@ -391,7 +391,7 @@ public function display() { $config->title = get_string('confirmcancel', 'backup'); } $config->question = get_string('confirmcancelquestion', 'backup'); - $config->yesLabel = get_string('confirmcancelyes', 'backup'); + $config->yesLabel = $config->title; $config->noLabel = get_string('confirmcancelno', 'backup'); $config->closeButtonTitle = get_string('close', 'editor'); $PAGE->requires->yui_module( diff --git a/lang/en/backup.php b/lang/en/backup.php index abaf88e7859a9..39feee500eae7 100644 --- a/lang/en/backup.php +++ b/lang/en/backup.php @@ -124,8 +124,8 @@ $string['confirmcancelimport'] = 'Cancel import'; $string['confirmcancelquestion'] = 'Are you sure you wish to cancel? Any information you have entered will be lost.'; -$string['confirmcancelyes'] = 'Cancel'; -$string['confirmcancelno'] = 'Stay'; +$string['confirmcancelyes'] = 'Cancel backup'; +$string['confirmcancelno'] = 'Do not cancel'; $string['confirmnewcoursecontinue'] = 'New course warning'; $string['confirmnewcoursecontinuequestion'] = 'A temporary (hidden) course will be created by the course restoration process. To abort restoration click cancel. Do not close the browser while restoring.'; $string['coursecategory'] = 'Category the course will be restored into';