. /** * The mod_forum course module viewed event. * * @package mod_forum * @copyright 2014 Dan Poltawski * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace mod_forum\event; defined('MOODLE_INTERNAL') || die(); /** * The mod_forum course module viewed event class. * * @package mod_forum * @since Moodle 2.7 * @copyright 2014 Dan Poltawski * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class course_module_viewed extends \core\event\course_module_viewed { /** * Init method. * * @return void */ protected function init() { $this->data['crud'] = 'r'; $this->data['edulevel'] = self::LEVEL_PARTICIPATING; $this->data['objecttable'] = 'forum'; } /** * Get URL related to the action * * @return \moodle_url */ public function get_url() { return new \moodle_url('/mod/forum/view.php', array('f' => $this->objectid)); } /** * Return the legacy event log data. * * @return array|null */ protected function get_legacy_logdata() { return array($this->courseid, 'forum', 'view forum', 'view.php?f=' . $this->objectid, $this->objectid, $this->contextinstanceid); } }