]> git.mjollnir.org Git - moodle.git/commitdiff
Use get_site() to get site's course number.
authorpaca70 <paca70>
Mon, 30 Aug 2004 06:03:29 +0000 (06:03 +0000)
committerpaca70 <paca70>
Mon, 30 Aug 2004 06:03:29 +0000 (06:03 +0000)
Site course  could be different from course '1' in older installations.

blocks/calendar_month/block_calendar_month.php

index aa04c241e96590cf05a112f8569435aeef09d193..bbf15814d56cc60ea7990fcb41a8c412199b7e3e 100644 (file)
@@ -14,7 +14,8 @@ class CourseBlock_calendar_month extends MoodleBlock {
         optional_variable($_GET['cal_y']);
 
         require_once($CFG->dirroot.'/calendar/lib.php');
-
+        
+        $site = get_site();
         if ($this->content !== NULL) {
             return $this->content;
         }
@@ -36,10 +37,8 @@ class CourseBlock_calendar_month extends MoodleBlock {
 
         // Be VERY careful with the format for default courses arguments!
         // Correct formatting is [courseid] => 1 to be concise with moodlelib.php functions.
-
         calendar_set_filters($courses, $group, $user, $filtercourse, $filtercourse);
-
-        if ($courseshown == 1) {
+        if ($courseshown == $site->id) {
             // For the front page
             $this->content->text .= calendar_overlib_html();
             $this->content->text .= calendar_top_controls('frontpage', array('m' => $_GET['cal_m'], 'y' => $_GET['cal_y']));