mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-36302 course: Set correct URL on settings page for navigation.
This commit is contained in:
parent
3546b9f4d2
commit
736a655135
1 changed files with 5 additions and 3 deletions
|
@ -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 = context_course::instance($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 = context_coursecat::instance($category->id);
|
||||
require_capability('moodle/course:create', $catcontext);
|
||||
$PAGE->url->param('category',$categoryid);
|
||||
$PAGE->set_context($catcontext);
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue