]> git.mjollnir.org Git - moodle.git/commitdiff
Allow Course creators to see all hidden categories and courses
authormoodler <moodler>
Wed, 3 Sep 2003 08:29:05 +0000 (08:29 +0000)
committermoodler <moodler>
Wed, 3 Sep 2003 08:29:05 +0000 (08:29 +0000)
course/lib.php
lib/datalib.php

index cdbbc1673968a7d1bc74bfa7339832c1ca454f25..b22fc98bb0a0b3822d898f5ec54e06802af4ed3d 100644 (file)
@@ -899,7 +899,7 @@ function print_whole_category_list($category=NULL, $displaylist=NULL, $parentsli
     }
 
     if ($category) {
-        if ($category->visible or isadmin()) {
+        if ($category->visible or iscreator()) {
             print_category_info($category, $depth);
         } else {
             return;  // Don't bother printing children of invisible categories
index e40fbf598db7aaf10f18dcb2b3ab287d2dfb363a..8397fb7b97d69772a35ff31576479e60431e707d 100644 (file)
@@ -1127,7 +1127,7 @@ function get_courses($categoryid="all", $sort="c.sortorder ASC", $fields="c.*")
     $teachergroup = "";
     $visiblecourses = "";
     if (!empty($USER)) {  // May need to check they are a teacher
-        if (!isadmin()) {
+        if (!iscreator()) {
             $visiblecourses = "AND ((c.visible > 0) OR (t.userid = '$USER->id' AND t.course = c.id))";
             $teachertable = ", {$CFG->prefix}user_teachers t";
             $teachergroup = "GROUP BY c.id";
@@ -1158,7 +1158,7 @@ function get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c
     $teachergroup = "";
     $visiblecourses = "";
     if (!empty($USER)) {  // May need to check they are a teacher
-        if (!isadmin()) {
+        if (!iscreator()) {
             $visiblecourses = "AND ((c.visible > 0) OR (t.userid = '$USER->id' AND t.course = c.id))";
             $teachertable = ", {$CFG->prefix}user_teachers t";
             $teachergroup = "GROUP BY c.id";
@@ -1312,10 +1312,10 @@ function get_categories($parent="none", $sort="sortorder ASC") {
         $categories = get_records("course_categories", "parent", $parent, $sort);
     }
     if ($categories) {  /// Remove unavailable categories from the list
-        $admin = isadmin();
+        $creator = iscreator();
         foreach ($categories as $key => $category) {
             if (!$category->visible) {
-                if (!$admin) {
+                if (!$creator) {
                     unset($categories[$key]);
                 }
             }