} 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();
// Display heading. print $out->heading(get_string('userposts', 'forumngfeature_userposts')); if ($start || $end) { $timefilter->set_data(array('start' => $start, 'end' => $end)); } // Display time filter options form. $timefilter->display(); echo $ptable->download_buttons(); // Print out participation form. if ($cangrade) { print forumngfeature_userposts_grade_form_header($cmid, $groupid); } } $ptable->downloadable = false; foreach ($data as $record) { $ptable->add_data($record); } $ptable->finish_output(); // Print out grade form footer. if ($cangrade && empty($download)) { print forumngfeature_userposts_grade_form_footer(); } if (empty($download)) { // Display link to the discussion. $url = '../../view.php?id=' . $cmid; print link_arrow_left($forum->get_name(), $url); // Display footer. print $out->footer(); $params = array('context' => $forum->get_context(), 'objectid' => $forum->get_id(), 'other' => array('url' => 'list.php?' . $thisurl->get_query_string(false))); $event = \forumngfeature_userposts\event\participation_viewed::create($params); $event->add_record_snapshot('course_modules', $forum->get_course_module());