mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-69400 mod_forum: Added calender event refreshing.
This commit is contained in:
parent
5500d143f4
commit
7d0c60eecf
1 changed files with 17 additions and 0 deletions
|
@ -7021,3 +7021,20 @@ function mod_forum_core_calendar_get_event_action_string(string $eventtype): str
|
|||
return get_string('requiresaction', 'calendar', $modulename);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This callback will check the provided instance of this module
|
||||
* and make sure there are up-to-date events created for it.
|
||||
*
|
||||
* @param int $courseid Not used.
|
||||
* @param stdClass $instance Forum module instance.
|
||||
* @param stdClass $cm Course module object.
|
||||
*/
|
||||
function forum_refresh_events(int $courseid, stdClass $instance, stdClass $cm): void {
|
||||
global $CFG;
|
||||
|
||||
// This function is called by cron and we need to include the locallib for calls further down.
|
||||
require_once($CFG->dirroot . '/mod/forum/locallib.php');
|
||||
|
||||
forum_update_calendar($instance, $cm->id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue