mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-1322 calendar: Add course short name in calendar event
* Add the course's short name for a course event in order to let the user know immediately which course an event belongs to. Particularly helpful for activity events.
This commit is contained in:
parent
f4a2d69631
commit
390098fa64
3 changed files with 26 additions and 1 deletions
|
@ -1457,6 +1457,15 @@ function calendar_get_mini($courses, $groups, $users, $calmonth = false, $calyea
|
|||
$name = format_string($event->name, true);
|
||||
}
|
||||
}
|
||||
// Include course's shortname into the event name, if applicable.
|
||||
if (!empty($event->courseid) && $event->courseid !== SITEID) {
|
||||
$course = get_course($event->courseid);
|
||||
$eventnameparams = (object)[
|
||||
'name' => $name,
|
||||
'course' => format_string($course->shortname, true, array('context' => $event->context))
|
||||
];
|
||||
$name = get_string('eventnameandcourse', 'calendar', $eventnameparams);
|
||||
}
|
||||
$popupcontent .= \html_writer::link($dayhref, $name);
|
||||
$popupcontent .= \html_writer::end_tag('div');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue