MDL-30811 core: Replace use of continue_button with redirect
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user