FIxed some holes with hidden categories bug 1093

This commit is contained in:
moodler 2004-03-20 12:21:08 +00:00
parent e8d768968e
commit 92c26858ed
2 changed files with 19 additions and 6 deletions

View file

@ -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 "<table align=\"center\" border=0 cellspacing=2 cellpadding=4 class=\"generalbox\">";
echo "<tr><th>".get_string("subcategories")."</th></tr>";
echo "<tr><td nowrap>";
$firstentry = true;
foreach ($subcategories as $subcategory) {
echo "<a href=\"category.php?id=$subcategory->id\">$subcategory->name</a><br />";
if ($subcategory->visible or iscreator()) {
if ($firstentry) {
echo "<table align=\"center\" border=0 cellspacing=2 cellpadding=4 class=\"generalbox\">";
echo "<tr><th>".get_string("subcategories")."</th></tr>";
echo "<tr><td nowrap>";
$firstentry = false;
}
$catlinkcss = $subcategory->visible ? "" : " class=\"dimmed\" ";
echo "<a $catlinkcss href=\"category.php?id=$subcategory->id\">$subcategory->name</a><br />";
}
}
if (!$firstentry) {
echo "</td></tr></table>";
echo "<br />";
}
echo "</td></tr></table>";
echo "<br />";
}

View file

@ -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';