Skip to content

Commit

Permalink
WR440693 Additional plugin support
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonThornett committed Sep 19, 2024
1 parent 36ceb3c commit f1e5661
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions classes/frequency.php
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,8 @@ public function get_day_events(int $courseid, string $date, array $modules): arr
}
}

$sources = get_sources();

// Get additional information and format the event data.
foreach ($events as $event) {
$context = context::instance_by_id($event->contextid, IGNORE_MISSING);
Expand All @@ -1125,10 +1127,14 @@ public function get_day_events(int $courseid, string $date, array $modules): arr
$event->usercount = count($this->get_event_users($event->contextid, $event->module));
$event->timelimit =
($event->timelimit == 0) ? '-' : round(($event->timelimit / 60));
$event->dashurl = '';

$dashurl = new \moodle_url('/local/assessfreq/', ['activityid' => $context->instanceid], 'activity_dashboard');
$event->dashurl = $dashurl->out();

/* @var $source source_base */
$source = $sources[$event->module];
if (method_exists($source, 'get_activity_dashboard')) {
$dashurl = new \moodle_url('/local/assessfreq/', ['activityid' => $context->instanceid], 'activity_dashboard');
$event->dashurl = $dashurl->out();
}
$event->courseshortname = $course->shortname;

$dayevents[] = $event;
Expand Down
2 changes: 1 addition & 1 deletion classes/source_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function get_instance() : source_base {
abstract public function get_module() : string;

/**
* Return the
* Return the module table. By default, this is the module name, however some mods use a different table.
* @return string
*/
public function get_module_table() : string {
Expand Down

0 comments on commit f1e5661

Please sign in to comment.