mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
FIxed some holes with hidden categories bug 1093
This commit is contained in:
parent
e8d768968e
commit
92c26858ed
2 changed files with 19 additions and 6 deletions
|
@ -33,6 +33,9 @@
|
||||||
$adminediting = (isadmin() and $creatorediting);
|
$adminediting = (isadmin() and $creatorediting);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if (!$category->visible) {
|
||||||
|
error(get_string('notavailable', 'error'));
|
||||||
|
}
|
||||||
$navbaritem = print_course_search("", true, "navbar");
|
$navbaritem = print_course_search("", true, "navbar");
|
||||||
$adminediting = false;
|
$adminediting = false;
|
||||||
$creatorediting = false;
|
$creatorediting = false;
|
||||||
|
@ -203,14 +206,23 @@
|
||||||
/// Print out all the sub-categories
|
/// Print out all the sub-categories
|
||||||
|
|
||||||
if ($subcategories = get_records("course_categories", "parent", $category->id)) {
|
if ($subcategories = get_records("course_categories", "parent", $category->id)) {
|
||||||
echo "<table align=\"center\" border=0 cellspacing=2 cellpadding=4 class=\"generalbox\">";
|
$firstentry = true;
|
||||||
echo "<tr><th>".get_string("subcategories")."</th></tr>";
|
|
||||||
echo "<tr><td nowrap>";
|
|
||||||
foreach ($subcategories as $subcategory) {
|
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 />";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ $string['groupunknown'] = 'Group $a not associated to specified course';
|
||||||
$string['invalidfieldname'] = '\"$a\" is not a valid field name';
|
$string['invalidfieldname'] = '\"$a\" is not a valid field name';
|
||||||
$string['missingfield'] = 'Field \"$a\" is missing';
|
$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['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['restricteduser'] = 'Sorry, but your current account \"$a\" is restricted from doing that.';
|
||||||
$string['unknowncourse'] = 'Unknown course named \"$a\"';
|
$string['unknowncourse'] = 'Unknown course named \"$a\"';
|
||||||
$string['usernotaddederror'] = 'User \"$a\" not added - unknown error';
|
$string['usernotaddederror'] = 'User \"$a\" not added - unknown error';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue