From 15cf5d2174e3fbf542c80bcddaf7881ff86397b4 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 11 Jan 2005 08:00:26 +0000 Subject: [PATCH] Don't show "No courses in this category" if there are sub-categories --- course/category.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/course/category.php b/course/category.php index 920ad1a22b..b0356a2487 100644 --- a/course/category.php +++ b/course/category.php @@ -226,6 +226,7 @@ $firstentry = true; foreach ($subcategories as $subcategory) { if ($subcategory->visible or iscreator()) { + $subcategorieswereshown = true; if ($firstentry) { echo ''; echo ''; @@ -253,7 +254,9 @@ $numcourses = count($courses); if (!$courses) { - print_heading(get_string("nocoursesyet")); + if (empty($subcategorieswereshown)) { + print_heading(get_string("nocoursesyet")); + } } else if ($numcourses <= COURSE_MAX_SUMMARIES_PER_PAGE and !$page and !$creatorediting) { print_courses($category, "80%"); -- 2.39.5
'.get_string('subcategories').'