MDL-40062 mod_forum: subscription events
[moodle.git] / mod / forum / subscribers.php
index 87c3b54..eda984f 100644 (file)
@@ -54,7 +54,12 @@ if (!has_capability('mod/forum:viewsubscribers', $context)) {
 
 unset($SESSION->fromdiscussion);
 
-add_to_log($course->id, "forum", "view subscribers", "subscribers.php?id=$forum->id", $forum->id, $cm->id);
+$params = array(
+    'context' => $context,
+    'other' => array('forumid' => $forum->id),
+);
+$event = \mod_forum\event\subscribers_viewed::create($params);
+$event->trigger();
 
 $forumoutput = $PAGE->get_renderer('mod_forum');
 $currentgroup = groups_get_activity_group($cm);