MDL-41257 calendar: Day and Upcoming-Events view not processed through text_filters() function

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>
This commit is contained in:
Michael Milette 2013-11-19 08:33:04 -05:00
parent 5e6da548d7
commit 9984132c23

View 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;