}
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
$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";
$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";
$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]);
}
}