MDL-64708 cohort: Return url is not used anywhere in core.

This commit is contained in:
Dan Marsden 2019-05-01 13:23:15 +12:00 committed by Jenkins
parent 2904a7f851
commit c509d10821
2 changed files with 2 additions and 10 deletions

View File

@ -28,7 +28,6 @@ require_once($CFG->dirroot.'/cohort/upload_form.php');
require_once($CFG->libdir . '/csvlib.class.php');
$contextid = optional_param('contextid', 0, PARAM_INT);
$returnurl = optional_param('returnurl', '', PARAM_URL);
require_login();
@ -56,13 +55,9 @@ if ($context->contextlevel == CONTEXT_COURSECAT) {
navigation_node::override_active_url(new moodle_url('/cohort/index.php', array()));
}
$uploadform = new cohort_upload_form(null, array('contextid' => $context->id, 'returnurl' => $returnurl));
$uploadform = new cohort_upload_form(null, array('contextid' => $context->id));
if ($returnurl) {
$returnurl = new moodle_url($returnurl);
} else {
$returnurl = new moodle_url('/cohort/index.php', array('contextid' => $context->id));
}
$returnurl = new moodle_url('/cohort/index.php', array('contextid' => $context->id));
if ($uploadform->is_cancelled()) {
redirect($returnurl);

View File

@ -48,9 +48,6 @@ class cohort_upload_form extends moodleform {
$mform = $this->_form;
$data = (object)$this->_customdata;
$mform->addElement('hidden', 'returnurl');
$mform->setType('returnurl', PARAM_URL);
$mform->addElement('header', 'cohortfileuploadform', get_string('uploadafile'));
$filepickeroptions = array();