]> git.mjollnir.org Git - moodle.git/commitdiff
Some performance improvements see bug 5032
authormoodler <moodler>
Fri, 21 Apr 2006 05:39:20 +0000 (05:39 +0000)
committermoodler <moodler>
Fri, 21 Apr 2006 05:39:20 +0000 (05:39 +0000)
course/lib.php

index 0a22a2e058d5075fea0799939c72b6345f4fd3d0..9d68ae9a5c231328434563c1cd33123058aaa8c7 100644 (file)
@@ -281,13 +281,14 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
 
     $joins = array();
 
-    if ($course->category) {
+    if ($course->id != SITEID || $modid != 0) {
         $joins[] = "l.course='$course->id'";
-    } else {
+    }
+    if ($course->id == SITEID) {
         $courses[0] = '';
-        if ($ccc = get_courses("all", "c.id ASC", "c.id,c.shortname")) {
+        if ($ccc = get_courses('all', 'c.id ASC', 'c.id,c.shortname')) {
             foreach ($ccc as $cc) {
-                $courses[$cc->id] = "$cc->shortname";
+                $courses[$cc->id] = $cc->shortname;
             }
         }
     }