MDL-69400 mod_forum: Added calender event refreshing.

This commit is contained in:
Adrian Greeve
2022-07-06 12:42:47 +08:00
parent fda6e143af
commit 69ce532809
+17
View File
@@ -6989,3 +6989,20 @@ function forum_grading_areas_list() {
'forum' => get_string('grade_forum_header', 'forum'),
];
}
/**
* 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);
}