Permalink
Browse files

Merge branch 'MDL-28735-m22' of git://github.com/ankitagarwal/moodle …

…into MOODLE_22_STABLE
  • Loading branch information...
2 parents ead5f37 + 958f4ff commit 390c3bc54a16f1e427d2813e8ed290273cb9cedd Sam Hemelryk committed Apr 30, 2012
Showing with 11 additions and 4 deletions.
  1. +3 −1 calendar/renderer.php
  2. +7 −2 calendar/set.php
  3. +1 −1 calendar/view.php
View
@@ -135,7 +135,9 @@ public function complete_layout() {
* @return string
*/
public function fake_block_filters($courseid, $day, $month, $year, $view, $courses) {
- return html_writer::tag('div', calendar_filter_controls($this->page->url), array('class'=>'calendar_filters filters'));
+ $returnurl = $this->page->url;
+ $returnurl->param('course', $courseid);
+ return html_writer::tag('div', calendar_filter_controls($returnurl), array('class'=>'calendar_filters filters'));
}
/**
View
@@ -45,8 +45,13 @@
$var = required_param('var', PARAM_ALPHA);
$return = clean_param(base64_decode(required_param('return', PARAM_RAW)), PARAM_URL);
-
-$url = new moodle_url('/calendar/set.php', array('return'=>base64_encode($return),'var'=>$var, 'sesskey'=>sesskey()));
+$courseid = optional_param('id', -1, PARAM_INT);
+if ($courseid != -1) {
+ $return = new moodle_url($return, array('course' => $courseid));
+} else {
+ $return = new moodle_url($return);
+}
+$url = new moodle_url('/calendar/set.php', array('return'=>base64_encode($return->out(false)), 'course' => $courseid, 'var'=>$var, 'sesskey'=>sesskey()));
$PAGE->set_url($url);
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
View
@@ -127,7 +127,7 @@
echo $renderer->show_day($calendar);
break;
case 'month':
- echo $renderer->show_month_detailed($calendar);
+ echo $renderer->show_month_detailed($calendar, $url);
break;
case 'upcoming':
$defaultlookahead = CALENDAR_DEFAULT_UPCOMING_LOOKAHEAD;

0 comments on commit 390c3bc

Please sign in to comment.