MDL-30811 core: Replace use of continue_button with redirect

This commit is contained in:
Andrew Nicols
2016-02-29 09:05:58 +08:00
parent d954b54f9e
commit 372d6b923b
8 changed files with 35 additions and 60 deletions
+2 -18
View File
@@ -87,13 +87,9 @@ if ($mform && ($mform->is_cancelled() || !empty($CFG->preventscheduledtaskchange
try {
\core\task\manager::configure_scheduled_task($task);
$url = $PAGE->url;
$url->params(array('success'=>get_string('changessaved')));
redirect($url);
redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS);
} catch (Exception $e) {
$url = $PAGE->url;
$url->params(array('error'=>$e->getMessage()));
redirect($url);
redirect($PAGE->url, $e->getMessage(), null, \core\output\notification::NOTIFY_ERROR);
}
} else {
echo $OUTPUT->header();
@@ -104,19 +100,7 @@ if ($mform && ($mform->is_cancelled() || !empty($CFG->preventscheduledtaskchange
} else {
echo $OUTPUT->header();
$error = optional_param('error', '', PARAM_NOTAGS);
if ($error) {
echo $OUTPUT->notification($error, 'notifyerror');
}
$success = optional_param('success', '', PARAM_NOTAGS);
if ($success) {
echo $OUTPUT->notification($success, 'notifysuccess');
}
$tasks = core\task\manager::get_all_scheduled_tasks();
echo $renderer->scheduled_tasks_table($tasks);
echo $OUTPUT->footer();
}