]> git.mjollnir.org Git - moodle.git/commitdiff
Modified the behavior of upcoming events block to be the same as month block,
authordefacer <defacer>
Fri, 7 May 2004 10:42:11 +0000 (10:42 +0000)
committerdefacer <defacer>
Fri, 7 May 2004 10:42:11 +0000 (10:42 +0000)
even though there is no way to go from it to the detailed month view right now.

blocks/calendar_upcoming/block_calendar_upcoming.php

index b68d8f2d16df8b0d1d6423285caf933cc9b1e794..9c261c104108336211d6f80553eb51161fdcb048 100644 (file)
@@ -36,15 +36,24 @@ class CourseBlock_calendar_upcoming extends MoodleBlock {
         // We 'll need this later
         calendar_set_referring_course($courseshown);
 
+        if($courseshown !== false) {
+            // By default, the course filter will show this course only
+            $SESSION->cal_show_course = $courseshown;
+        }
+
+        // [pj] Let's leave this in, the above may not be the final solution
+        /*
         if($courseshown !== false && is_int($SESSION->cal_show_course) && $SESSION->cal_show_course != $courseshown) {
             // There is a filter in action that shows events from a course other than the current
-            // Obviously we have to cut it out
-            $SESSION->cal_show_course = true;
-
-        else if($courseshown !== false && is_array($SESSION->cal_show_course) && !in_array($courseshown, $SESSION->cal_show_course)) {
+            // Change it to show only the current course
+            $SESSION->cal_show_course = $courseshown;
+        }
+        else if($courseshown !== false && is_array($SESSION->cal_show_course) && !in_array($courseshown, $SESSION->cal_show_course)) {
             // Same as above, only there are many courses being shown. Unfortunately, not this one.
-            $SESSION->cal_show_course = true;
+            // Change it to show only the current course
+            $SESSION->cal_show_course = $courseshown;
         }
+        */
 
         // Be VERY careful with the format for default courses arguments!
         // Correct formatting is [courseid] => 1 to be concise with moodlelib.php functions.