]> git.mjollnir.org Git - moodle.git/commitdiff
The course link in the breadcrumbs now mirrors the active course filter.
authordefacer <defacer>
Mon, 24 May 2004 11:40:34 +0000 (11:40 +0000)
committerdefacer <defacer>
Mon, 24 May 2004 11:40:34 +0000 (11:40 +0000)
calendar/set.php

index b4c710287cca2f2840cf4d27c06b337c71986de8..0358712e9967dd24c88f50bf54a7201201dc00c4 100644 (file)
             $id = intval($_GET['id']);
             if($id == 0) {
                 $SESSION->cal_courses_shown = array();
+                calendar_set_referring_course(0);
             }
             else if($id == 1) {
                 $SESSION->cal_courses_shown = calendar_get_default_courses(true);
+                calendar_set_referring_course(0);
             }
             else {
                 // We don't check for membership anymore: if(isstudent($id, $USER->id) || isteacher($id, $USER->id)) {
-                $SESSION->cal_courses_shown = $id;
+                if(get_record('course', 'id', $id) === false) {
+                    // There is no such course
+                    $SESSION->cal_courses_shown = array();
+                    calendar_set_referring_course(0);
+                }
+                else {
+                    calendar_set_referring_course($id);
+                    $SESSION->cal_courses_shown = $id;
+                }
             }
         break;
         case 'showgroups':