Merge branch '41502-28' of git://github.com/samhemelryk/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 8 Jul 2014 22:51:22 +0000 (00:51 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 8 Jul 2014 22:51:22 +0000 (00:51 +0200)
1  2 
course/management.php

diff --combined course/management.php
@@@ -69,10 -69,12 +69,10 @@@ if ($courseid) 
  } else {
      $course = null;
      $courseid = null;
 -    $category = null;
 -    $categoryid = null;
 -    if ($viewmode === 'default') {
 -        $viewmode = 'categories';
 -    }
 -    $context = $systemcontext;
 +    $category = coursecat::get_default();
 +    $categoryid = $category->id;
 +    $context = context_coursecat::instance($category->id);
 +    $url->param('categoryid', $category->id);
  }
  
  // Check if there is a selected category param, and if there is apply it.
@@@ -233,7 -235,6 +233,6 @@@ if ($action !== false && confirm_sesske
              if (!$category->can_delete()) {
                  throw new moodle_exception('permissiondenied', 'error', '', null, 'coursecat::can_resort');
              }
-             require_once($CFG->dirroot.'/course/delete_category_form.php');
              $mform = new core_course_deletecategory_form(null, $category);
              if ($mform->is_cancelled()) {
                  redirect($PAGE->url);