]> git.mjollnir.org Git - moodle.git/commitdiff
Quick fix for bug 1303 ... but I'll come back to this today
authormoodler <moodler>
Tue, 4 May 2004 01:58:20 +0000 (01:58 +0000)
committermoodler <moodler>
Tue, 4 May 2004 01:58:20 +0000 (01:58 +0000)
calendar/event.php

index ba6f05d05035e27556b89403a0e23ef24e9f0c11..83d98df884b9b450d30632e0df8ea8f8edf90074 100644 (file)
 
     // Let's see if we are supposed to provide a referring course link
     // but NOT for the front page
-    if($SESSION->cal_course_referer > 1 &&
-      ($shortname = get_field('course', 'shortname', 'id', $SESSION->cal_course_referer)) !== false) {
-        // If we know about the referring course, show a return link
-        $nav = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$SESSION->cal_course_referer.'">'.$shortname.'</a> -> '.$nav;
+
+    if (!empty($SESSION->cal_course_referer)) {
+        if ($course = get_record('course', 'id', $SESSION->cal_course_referer)) {
+            $shortname = $course->shortname;
+            $nav = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$SESSION->cal_course_referer.'">'.$shortname.'</a> -> '.$nav;
+        }
+    } else {
+        $nav = '';
     }
 
     print_header(get_string('calendar', 'calendar').': '.$title, $site->fullname, $nav.' -> '.$title,