Permalink
Browse files

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

…ODLE_22_STABLE
  • Loading branch information...
2 parents 24d215d + efc8baa commit 6a992d7d86bee13da7e789cd5c051eb08248ca69 @danpoltawski danpoltawski committed Nov 27, 2012
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,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 6a992d7

Please sign in to comment.