MDL-72543 block_timeline: change the display of event names

This commit is contained in:
Simey Lameze
2021-10-07 14:05:34 +08:00
parent 43e5cc11b5
commit 9afd980b4e
14 changed files with 367 additions and 97 deletions
+23
View File
@@ -4799,3 +4799,26 @@ function mod_data_core_calendar_event_timestart_updated(\calendar_event $event,
$event->trigger();
}
}
/**
* Callback to fetch the activity event type lang string.
*
* @param string $eventtype The event type.
* @return lang_string The event type lang string.
*/
function mod_data_core_calendar_get_event_action_string(string $eventtype): string {
$modulename = get_string('modulename', 'data');
switch ($eventtype) {
case DATA_EVENT_TYPE_OPEN:
$identifier = 'calendarstart';
break;
case DATA_EVENT_TYPE_CLOSE:
$identifier = 'calendarend';
break;
default:
return get_string('requiresaction', 'calendar', $modulename);
}
return get_string($identifier, 'data', $modulename);
}