MDL-36302 course: Set correct URL on settings page for navigation.
This commit is contained in:
+5
-3
@@ -32,7 +32,11 @@ $categoryid = optional_param('category', 0, PARAM_INT); // course category - can
|
||||
$returnto = optional_param('returnto', 0, PARAM_ALPHANUM); // generic navigation return page switch
|
||||
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_url('/course/edit.php');
|
||||
$pageparams = array('id'=>$id);
|
||||
if (empty($id)) {
|
||||
$pageparams = array('category'=>$categoryid);
|
||||
}
|
||||
$PAGE->set_url('/course/edit.php', $pageparams);
|
||||
|
||||
// basic access control checks
|
||||
if ($id) { // editing course
|
||||
@@ -46,7 +50,6 @@ if ($id) { // editing course
|
||||
$category = $DB->get_record('course_categories', array('id'=>$course->category), '*', MUST_EXIST);
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
require_capability('moodle/course:update', $coursecontext);
|
||||
$PAGE->url->param('id',$id);
|
||||
|
||||
} else if ($categoryid) { // creating new course in this category
|
||||
$course = null;
|
||||
@@ -54,7 +57,6 @@ if ($id) { // editing course
|
||||
$category = $DB->get_record('course_categories', array('id'=>$categoryid), '*', MUST_EXIST);
|
||||
$catcontext = get_context_instance(CONTEXT_COURSECAT, $category->id);
|
||||
require_capability('moodle/course:create', $catcontext);
|
||||
$PAGE->url->param('category',$categoryid);
|
||||
$PAGE->set_context($catcontext);
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user