]> git.mjollnir.org Git - moodle.git/commitdiff
Don't show "No courses in this category" if there are sub-categories
authormoodler <moodler>
Tue, 11 Jan 2005 08:00:26 +0000 (08:00 +0000)
committermoodler <moodler>
Tue, 11 Jan 2005 08:00:26 +0000 (08:00 +0000)
course/category.php

index 920ad1a22b5a79708d3cce3ea93eebbccce3f5e3..b0356a24875c5a8992fb400ce9ff434c27b87042 100644 (file)
         $firstentry = true;
         foreach ($subcategories as $subcategory) {
             if ($subcategory->visible or iscreator()) {
+                $subcategorieswereshown = true;
                 if ($firstentry) {
                     echo '<table align="center" border="0" cellspacing="2" cellpadding="4" class="generalbox">';
                     echo '<tr><th>'.get_string('subcategories').'</th></tr>';
     $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%");