]> git.mjollnir.org Git - moodle.git/commitdiff
Make sure course list block is never empty.
authorgustav_delius <gustav_delius>
Tue, 1 Jun 2004 09:47:28 +0000 (09:47 +0000)
committergustav_delius <gustav_delius>
Tue, 1 Jun 2004 09:47:28 +0000 (09:47 +0000)
blocks/course_list/block_course_list.php

index 7dfc134624a0bf3896ab9c25b1d114bbc4b035a6..ec2c56726c669b8c7dfa93952a52b3ee1e22a59b 100644 (file)
@@ -71,7 +71,9 @@ class CourseBlock_course_list extends MoodleBlock {
                 }
                 $this->title = get_string('mycourses');
                 $this->content->footer = "<a href=\"$CFG->wwwroot/course/index.php\">".get_string("fulllistofcourses")."</a>...";
-                return $this->content;
+                if ($this->content->items) { // make sure we don't return an empty list
+                    return $this->content;
+                }
             }
         }