]> git.mjollnir.org Git - moodle.git/commitdiff
course/lib: print_courses() - no need to worry about sitecourse
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:49:23 +0000 (07:49 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:49:23 +0000 (07:49 +0000)
get_courses_wmanagers() excludes the sitecourse, so we no longer
check for it. And check explicitly for an empty course array.

course/lib.php

index 54eded80bd2d1873dbf72b89b97fb2d98de2a06f..62478e271d19435e3b13c35974bdde202aad3f7a 100644 (file)
@@ -1776,9 +1776,9 @@ function print_courses($category, $hidesitecourse = false) {
                                             array('password','summary','currency'));
     }
 
-    if ($courses) {
+    if (count($courses) > 0) {
         foreach ($courses as $course) {
-            if ($hidesitecourse and ($course->id == SITEID)) {
+            if ($hidesitecourse) {
                 continue;
             }
             if ($course->visible == 1