mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Fix for bug 1442
- notices - course is now properly passed to calendar_filter_controls from block
This commit is contained in:
parent
d980b5da22
commit
3cb9ee3949
2 changed files with 12 additions and 11 deletions
|
@ -27,8 +27,8 @@ class CourseBlock_calendar_month extends MoodleBlock {
|
|||
// Overrides: use no course at all
|
||||
$courseshown = false;
|
||||
$filtercourse = array();
|
||||
}
|
||||
else {
|
||||
|
||||
} else {
|
||||
$courseshown = $this->course->id;
|
||||
$filtercourse = array($courseshown => 1);
|
||||
}
|
||||
|
@ -61,13 +61,13 @@ class CourseBlock_calendar_month extends MoodleBlock {
|
|||
$this->content->text .= calendar_top_controls('frontpage', array('m' => $_GET['cal_m'], 'y' => $_GET['cal_y']));
|
||||
$this->content->text .= calendar_get_mini($courses, $group, $user, $_GET['cal_m'], $_GET['cal_y']);
|
||||
// No filters for now
|
||||
}
|
||||
else {
|
||||
|
||||
} else {
|
||||
// For any other course
|
||||
$this->content->text .= calendar_overlib_html();
|
||||
$this->content->text .= calendar_top_controls('course', array('id' => $courseshown, 'm' => $_GET['cal_m'], 'y' => $_GET['cal_y']));
|
||||
$this->content->text .= calendar_get_mini($courses, $group, $user, $_GET['cal_m'], $_GET['cal_y']);
|
||||
$this->content->text .= calendar_filter_controls('course');
|
||||
$this->content->text .= calendar_filter_controls('course', '', $this->course);
|
||||
}
|
||||
|
||||
return $this->content;
|
||||
|
|
|
@ -559,10 +559,11 @@ function calendar_top_controls($type, $data) {
|
|||
return $content;
|
||||
}
|
||||
|
||||
function calendar_filter_controls($type, $vars = NULL) {
|
||||
function calendar_filter_controls($type, $vars = NULL, $course = NULL) {
|
||||
global $CFG, $SESSION, $USER;
|
||||
|
||||
$groupevents = true;
|
||||
$getvars = '';
|
||||
|
||||
switch($type) {
|
||||
case 'upcoming':
|
||||
|
@ -573,7 +574,7 @@ function calendar_filter_controls($type, $vars = NULL) {
|
|||
break;
|
||||
case 'course':
|
||||
$getvars = '&from=course&id='.$_GET['id'];
|
||||
if($course->groupmode == NOGROUPS && $course->groupmodeforce) {
|
||||
if (isset($course->groupmode) and !$course->groupmode and $course->groupmodeforce) {
|
||||
$groupevents = false;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue