Skip to content

Commit

Permalink
MDL-36621 calendar: Display subscription info in calendar event popups
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitagarwal committed Jan 17, 2013
1 parent 8a7326e commit 07c03ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions calendar/lib.php
Expand Up @@ -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)) {
Expand All @@ -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');
}

Expand Down
1 change: 1 addition & 0 deletions lang/en/calendar.php
Expand Up @@ -125,6 +125,7 @@
$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';
Expand Down

0 comments on commit 07c03ff

Please sign in to comment.