]> git.mjollnir.org Git - moodle.git/commitdiff
global $course fix; merged from MOODLE_16_STABLE
authorskodak <skodak>
Mon, 29 May 2006 05:56:28 +0000 (05:56 +0000)
committerskodak <skodak>
Mon, 29 May 2006 05:56:28 +0000 (05:56 +0000)
my/index.php

index de6ca4653d885051f1017f1ab8781bda48629bef..919a0e1abfbe9baeba9e7881f32deb5815021333 100644 (file)
@@ -1,4 +1,4 @@
-<?php  // %Id%
+<?php  // $Id$
 
     // this is the 'my moodle' page
 
 /// The main overview in the middle of the page
     $courses = get_my_courses($USER->id);
     $site = get_site();
+    $course = $site; //just in case we need the old global $course hack
 
     if (array_key_exists($site->id,$courses)) {
         unset($courses[$site->id]);
     }
 
-    foreach ($courses as $course) {
-        if (isset($USER->timeaccess) && array_key_exists($course->id,$USER->timeaccess)) {
-            $courses[$course->id]->lastaccess = $USER->timeaccess[$course->id];
+    foreach ($courses as $c) {
+        if (isset($USER->timeaccess) && array_key_exists($c->id,$USER->timeaccess)) {
+            $courses[$c->id]->lastaccess = $USER->timeaccess[$c->id];
         } else {
-            $courses[$course->id]->lastaccess = 0;
+            $courses[$c->id]->lastaccess = 0;
         }
     }