Permalink
Browse files

Merge branch 'MDL-36302-23' of git://github.com/damyon/moodle into MO…

…ODLE_23_STABLE
  • Loading branch information...
2 parents 89ac5e8 + 520b7df commit db7f46ad3adf4cb44cdc81d2a814e50c294722d5 @danpoltawski danpoltawski committed Nov 27, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 course/edit.php
View
@@ -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,15 +50,13 @@
$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;
require_login();
$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 {

0 comments on commit db7f46a

Please sign in to comment.