]> git.mjollnir.org Git - moodle.git/commitdiff
Adding a missing parameter to the "add new course" button. MDL-9129
authorstronk7 <stronk7>
Fri, 30 Mar 2007 15:36:52 +0000 (15:36 +0000)
committerstronk7 <stronk7>
Fri, 30 Mar 2007 15:36:52 +0000 (15:36 +0000)
Merged from MOODLE_18_STABLE

course/index.php

index ee47002bc4c6883b4b8eb9c326651d13f6f38e15..8c0d5f3a77d68d69ae548201b7550bee6cfe1c64 100644 (file)
@@ -64,7 +64,9 @@
             print_single_button('request.php', NULL, get_string('courserequest'), 'get');
         }
         if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {       // Print link to create a new course
-            print_single_button('edit.php', NULL, get_string('addnewcourse'), 'get');
+        /// Get the 1st available category
+            $options = array('category' => get_field('course_categories', 'id', 'parent', '0'));
+            print_single_button('edit.php', $options, get_string('addnewcourse'), 'get');
         }
         if (has_capability('moodle/site:approvecourse', get_context_instance(CONTEXT_SYSTEM, SITEID))  and !empty($CFG->enablecourserequests)) {
             print_single_button('pending.php',NULL, get_string('coursespending'),'get');