From 92c26858edd09ec10b18dab3477d0fcdc5b05f65 Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 20 Mar 2004 12:21:08 +0000 Subject: [PATCH] FIxed some holes with hidden categories bug 1093 --- course/category.php | 24 ++++++++++++++++++------ lang/en/error.php | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/course/category.php b/course/category.php index 619b91d6fc..a555b2fd94 100644 --- a/course/category.php +++ b/course/category.php @@ -33,6 +33,9 @@ $adminediting = (isadmin() and $creatorediting); } else { + if (!$category->visible) { + error(get_string('notavailable', 'error')); + } $navbaritem = print_course_search("", true, "navbar"); $adminediting = false; $creatorediting = false; @@ -203,14 +206,23 @@ /// Print out all the sub-categories if ($subcategories = get_records("course_categories", "parent", $category->id)) { - echo ""; - echo ""; - echo "
".get_string("subcategories")."
"; + $firstentry = true; foreach ($subcategories as $subcategory) { - echo "id\">$subcategory->name
"; + if ($subcategory->visible or iscreator()) { + if ($firstentry) { + echo ""; + echo ""; + echo "
".get_string("subcategories")."
"; + $firstentry = false; + } + $catlinkcss = $subcategory->visible ? "" : " class=\"dimmed\" "; + echo "id\">$subcategory->name
"; + } + } + if (!$firstentry) { + echo "
"; + echo "
"; } - echo "
"; - echo "
"; } diff --git a/lang/en/error.php b/lang/en/error.php index 4792e9903c..2daf7401db 100755 --- a/lang/en/error.php +++ b/lang/en/error.php @@ -9,6 +9,7 @@ $string['groupunknown'] = 'Group $a not associated to specified course'; $string['invalidfieldname'] = '\"$a\" is not a valid field name'; $string['missingfield'] = 'Field \"$a\" is missing'; $string['modulerequirementsnotmet'] = 'Module \"$a->modulename\" ($a->moduleversion) could not be installed. It requires a newer version of Moodle (currently you are using $a->currentmoodle, you need $a->requiremoodle).'; +$string['notavailable'] = 'That is not currently available'; $string['restricteduser'] = 'Sorry, but your current account \"$a\" is restricted from doing that.'; $string['unknowncourse'] = 'Unknown course named \"$a\"'; $string['usernotaddederror'] = 'User \"$a\" not added - unknown error'; -- 2.39.5