MDL-36621 calendar: Display subscription info in calendar event popups

This commit is contained in:
Ankit Agarwal 2012-12-27 16:05:24 +08:00
parent 8a7326ed4e
commit 07c03ff96a
2 changed files with 10 additions and 2 deletions

View File

@ -314,7 +314,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
if (!isset($events[$eventid])) {
continue;
}
$event = $events[$eventid];
$event = new calendar_event($events[$eventid]);
$popupalt = '';
$component = 'moodle';
if(!empty($event->modulename)) {
@ -335,7 +335,14 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
$popupcontent .= html_writer::start_tag('div');
$popupcontent .= $OUTPUT->pix_icon($popupicon, $popupalt, $component);
$popupcontent .= html_writer::link($dayhref, format_string($event->name, true));
$name = format_string($event->name, true);
if (!empty($event->subscription)) {
$a = new stdClass();
$a->name = $name;
$a->source = $event->subscription->name;
$name = get_string('namewithsource', 'calendar', $a);
}
$popupcontent .= html_writer::link($dayhref, $name);
$popupcontent .= html_writer::end_tag('div');
}

View File

@ -125,6 +125,7 @@ $string['monthly'] = 'Monthly';
$string['monthlyview'] = 'Monthly view';
$string['monthnext'] = 'Next month';
$string['monththis'] = 'This month';
$string['namewithsource'] = '{$a->name}({$a->source})';
$string['never'] = 'Never';
$string['newevent'] = 'New event';
$string['notitle'] = 'no title';