MDL-41257 calendar: Day and Upcoming-Events view not processed through text_filters...
authorMichael Milette <michael.milette@instruxmedia.com>
Tue, 19 Nov 2013 13:33:04 +0000 (08:33 -0500)
committerMichael Milette <michael.milette@instruxmedia.com>
Tue, 19 Nov 2013 13:33:04 +0000 (08:33 -0500)
This fix adds text filtering to the Calendar Day view and Upcoming Events view, specifically the event name and event description.

Signed-off-by: Michael Milette <michael.milette@instruxmedia.com>
calendar/renderer.php

index fd9b99e..1a87d58 100644 (file)
@@ -309,6 +309,7 @@ class core_calendar_renderer extends plugin_renderer_base {
         global $CFG;
 
         $event = calendar_add_event_metadata($event);
+        $context = $event->context;
 
         $anchor  = html_writer::tag('a', '', array('name'=>'event_'.$event->id));
 
@@ -331,7 +332,7 @@ class core_calendar_renderer extends plugin_renderer_base {
         if (!empty($event->referer)) {
             $table->data[0]->cells[1]->text .= html_writer::tag('div', $event->referer, array('class'=>'referer'));
         } else {
-            $table->data[0]->cells[1]->text .= html_writer::tag('div', $event->name, array('class'=>'name'));
+            $table->data[0]->cells[1]->text .= html_writer::tag('div', format_string($event->name, false, array('context' => $context)), array('class'=>'name'));
         }
         if (!empty($event->courselink)) {
             $table->data[0]->cells[1]->text .= html_writer::tag('div', $event->courselink, array('class'=>'course'));
@@ -355,7 +356,7 @@ class core_calendar_renderer extends plugin_renderer_base {
         $table->data[1]->cells[0] = new html_table_cell('&nbsp;');
         $table->data[1]->cells[0]->attributes['class'] .= 'side';
 
-        $table->data[1]->cells[1] = new html_table_cell($event->description);
+        $table->data[1]->cells[1] = new html_table_cell(format_text($event->description, $event->format, array('context' => $context)));
         $table->data[1]->cells[1]->attributes['class'] .= ' description';
         if (isset($event->cssclass)) {
             $table->data[1]->cells[1]->attributes['class'] .= ' '.$event->cssclass;