} if ($forum->can_grade() && empty($download)) { forumngfeature_userposts_display_user_grade($cm->id, $forum, $user, $groupid); } if (!$student && empty($download)) { // Display link to the discussion. print link_arrow_left($prevpage, 'list.php?id=' . $cmid); } else { if (empty($download)) { // Display link to the forum view. $url = '../../view.php?id=' . $cmid; print link_arrow_left($forum->get_name(), $url); } } if (!empty($download)) { $table->downloadable = false; $table->setup($download); foreach ($data as $row) { $table->add_data($row); } $table->finish_output(); } if (empty($download)) { // Display footer. print $out->footer(); } $params = array('context' => $forum->get_context(), 'objectid' => $forum->get_id(), 'relateduserid' => $user->id, 'other' => array('url' => 'user.php?' . $pageurl->get_query_string(false))); $event = \forumngfeature_userposts\event\participation_viewed::create($params); $event->add_record_snapshot('course_modules', $forum->get_course_module()); $event->add_record_snapshot('course', $forum->get_course()); $event->trigger();