Skip to content
Browse files

Use get_site() to get site's course number.

Site course  could be different from course '1' in older installations.
  • Loading branch information...
1 parent ed90bc4 commit fbb869e97e63a1f8718a1dbb6e5a9f4816c232ed paca70 committed
Showing with 3 additions and 4 deletions.
  1. +3 −4 blocks/calendar_month/block_calendar_month.php
View
7 blocks/calendar_month/block_calendar_month.php
@@ -14,7 +14,8 @@ function get_content() {
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 @@ function get_content() {
// 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']));

0 comments on commit fbb869e

Please sign in to comment.
Something went wrong with that request. Please try again.