From: paca70 Date: Mon, 30 Aug 2004 06:03:29 +0000 (+0000) Subject: Use get_site() to get site's course number. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=fbb869e97e63a1f8718a1dbb6e5a9f4816c232ed;p=moodle.git Use get_site() to get site's course number. Site course could be different from course '1' in older installations. --- diff --git a/blocks/calendar_month/block_calendar_month.php b/blocks/calendar_month/block_calendar_month.php index aa04c241e9..bbf15814d5 100644 --- a/blocks/calendar_month/block_calendar_month.php +++ b/blocks/calendar_month/block_calendar_month.php @@ -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']));