Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-36302 course: Set correct URL on settings page for navigation.

  • Loading branch information...
commit 520b7df1a55e222c1b9bc70f509c725d986801ad 1 parent 55f8a9c
@damyon damyon authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 course/edit.php
View
8 course/edit.php
@@ -32,7 +32,11 @@
$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 @@
$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 @@
$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 {
Please sign in to comment.
Something went wrong with that request. Please try again.