diff --git a/classes/event/assessable_uploaded.php b/classes/event/assessable_uploaded.php index 27a80f77..f791bc7e 100644 --- a/classes/event/assessable_uploaded.php +++ b/classes/event/assessable_uploaded.php @@ -54,35 +54,6 @@ public function get_description() { "'$this->contextinstanceid'."; } - /** - * Legacy event data if get_legacy_eventname() is not empty. - * - * @return \stdClass - */ - protected function get_legacy_eventdata() { - $eventdata = new \stdClass(); - $eventdata->modulename = 'hsuforum'; - $eventdata->name = $this->other['triggeredfrom']; - $eventdata->cmid = $this->contextinstanceid; - $eventdata->itemid = $this->objectid; - $eventdata->courseid = $this->courseid; - $eventdata->userid = $this->userid; - $eventdata->content = $this->other['content']; - if ($this->other['pathnamehashes']) { - $eventdata->pathnamehashes = $this->other['pathnamehashes']; - } - return $eventdata; - } - - /** - * Return the legacy event name. - * - * @return string - */ - public static function get_legacy_eventname() { - return 'assessable_content_uploaded'; - } - /** * Return localised event name. * diff --git a/classes/event/course_module_viewed.php b/classes/event/course_module_viewed.php index c58c335f..4cf30824 100644 --- a/classes/event/course_module_viewed.php +++ b/classes/event/course_module_viewed.php @@ -56,16 +56,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/view.php', array('f' => $this->objectid)); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - return array($this->courseid, 'hsuforum', 'view forum', 'view.php?f=' . $this->objectid, - $this->objectid, $this->contextinstanceid); - } - public static function get_objectid_mapping() { return array('db' => 'hsuforum', 'restore' => 'hsuforum'); } diff --git a/classes/event/course_searched.php b/classes/event/course_searched.php index 81e38833..ab92f422 100644 --- a/classes/event/course_searched.php +++ b/classes/event/course_searched.php @@ -82,18 +82,6 @@ public function get_url() { array('id' => $this->courseid, 'search' => $this->other['searchterm'])); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - // The legacy log table expects a relative path to /mod/hsuforum/. - $logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/')); - - return array($this->courseid, 'hsuforum', 'search', $logurl, $this->other['searchterm']); - } - /** * Custom validation. * diff --git a/classes/event/discussion_created.php b/classes/event/discussion_created.php index f3279c4e..16a9bf67 100644 --- a/classes/event/discussion_created.php +++ b/classes/event/discussion_created.php @@ -80,19 +80,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/discuss.php', array('d' => $this->objectid)); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - - // The legacy log table expects a relative path to /mod/hsuforum/. - $logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/')); - - return array($this->courseid, 'hsuforum', 'add discussion', $logurl, $this->objectid, $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/discussion_deleted.php b/classes/event/discussion_deleted.php index 4c4fd0b6..c29b3c76 100644 --- a/classes/event/discussion_deleted.php +++ b/classes/event/discussion_deleted.php @@ -81,16 +81,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/view.php', array('id' => $this->contextinstanceid)); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - return array($this->courseid, 'hsuforum', 'delete discussion', 'view.php?id=' . $this->contextinstanceid, - $this->other['forumid'], $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/discussion_moved.php b/classes/event/discussion_moved.php index e1e388a8..7a81a5eb 100644 --- a/classes/event/discussion_moved.php +++ b/classes/event/discussion_moved.php @@ -81,16 +81,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/discuss.php', array('d' => $this->objectid)); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - return array($this->courseid, 'hsuforum', 'move discussion', 'discuss.php?d=' . $this->objectid, - $this->objectid, $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/discussion_pinned.php b/classes/event/discussion_pinned.php index 353ed369..d859608e 100644 --- a/classes/event/discussion_pinned.php +++ b/classes/event/discussion_pinned.php @@ -70,17 +70,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/discuss.php', array('d' => $this->objectid)); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - // The legacy log table expects a relative path to /mod/hsuforum/. - $logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/')); - return array($this->courseid, 'hsuforum', 'pin discussion', $logurl, $this->objectid, $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/discussion_unpinned.php b/classes/event/discussion_unpinned.php index 8db82a0b..b046ba6a 100644 --- a/classes/event/discussion_unpinned.php +++ b/classes/event/discussion_unpinned.php @@ -70,17 +70,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/discuss.php', array('d' => $this->objectid)); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - // The legacy log table expects a relative path to /mod/hsuforum/. - $logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/')); - return array($this->courseid, 'hsuforum', 'unpin discussion', $logurl, $this->objectid, $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/discussion_viewed.php b/classes/event/discussion_viewed.php index 5f280a46..98cb5b21 100644 --- a/classes/event/discussion_viewed.php +++ b/classes/event/discussion_viewed.php @@ -75,16 +75,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/discuss.php', array('d' => $this->objectid)); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - return array($this->courseid, 'hsuforum', 'view discussion', 'discuss.php?d=' . $this->objectid, - $this->objectid, $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/post_created.php b/classes/event/post_created.php index e662c5ac..78749171 100644 --- a/classes/event/post_created.php +++ b/classes/event/post_created.php @@ -91,18 +91,6 @@ public function get_url() { return $url; } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - // The legacy log table expects a relative path to /mod/hsuforum/. - $logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/')); - - return array($this->courseid, 'hsuforum', 'add post', $logurl, $this->other['forumid'], $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/post_deleted.php b/classes/event/post_deleted.php index baa60538..8a8e1505 100644 --- a/classes/event/post_deleted.php +++ b/classes/event/post_deleted.php @@ -90,18 +90,6 @@ public function get_url() { return $url; } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - // The legacy log table expects a relative path to /mod/hsuforum/. - $logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/')); - - return array($this->courseid, 'hsuforum', 'delete post', $logurl, $this->objectid, $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/post_updated.php b/classes/event/post_updated.php index 79225a9d..9bfebf7b 100644 --- a/classes/event/post_updated.php +++ b/classes/event/post_updated.php @@ -91,18 +91,6 @@ public function get_url() { return $url; } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - // The legacy log table expects a relative path to /mod/hsuforum/. - $logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/')); - - return array($this->courseid, 'hsuforum', 'update post', $logurl, $this->objectid, $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/readtracking_disabled.php b/classes/event/readtracking_disabled.php index c48e6b80..5423ae4a 100644 --- a/classes/event/readtracking_disabled.php +++ b/classes/event/readtracking_disabled.php @@ -79,16 +79,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/view.php', array('f' => $this->other['forumid'])); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - return array($this->courseid, 'hsuforum', 'stop tracking', 'view.php?f=' . $this->other['forumid'], - $this->other['forumid'], $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/readtracking_enabled.php b/classes/event/readtracking_enabled.php index 1e4852bf..08e24197 100644 --- a/classes/event/readtracking_enabled.php +++ b/classes/event/readtracking_enabled.php @@ -79,16 +79,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/view.php', array('f' => $this->other['forumid'])); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - return array($this->courseid, 'hsuforum', 'start tracking', 'view.php?f=' . $this->other['forumid'], - $this->other['forumid'], $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/subscribers_viewed.php b/classes/event/subscribers_viewed.php index ca5045f9..f3e44228 100644 --- a/classes/event/subscribers_viewed.php +++ b/classes/event/subscribers_viewed.php @@ -80,16 +80,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/subscribers.php', array('id' => $this->other['forumid'])); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - return array($this->courseid, 'hsuforum', 'view subscribers', 'subscribers.php?id=' . $this->other['forumid'], - $this->other['forumid'], $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/subscription_created.php b/classes/event/subscription_created.php index f5f7b214..f824c931 100644 --- a/classes/event/subscription_created.php +++ b/classes/event/subscription_created.php @@ -80,16 +80,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/subscribers.php', array('id' => $this->other['forumid'])); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - return array($this->courseid, 'hsuforum', 'subscribe', 'view.php?f=' . $this->other['forumid'], - $this->other['forumid'], $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/subscription_deleted.php b/classes/event/subscription_deleted.php index d22174e9..866845d9 100644 --- a/classes/event/subscription_deleted.php +++ b/classes/event/subscription_deleted.php @@ -80,16 +80,6 @@ public function get_url() { return new \moodle_url('/mod/hsuforum/subscribers.php', array('id' => $this->other['forumid'])); } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - return array($this->courseid, 'hsuforum', 'unsubscribe', 'view.php?f=' . $this->other['forumid'], - $this->other['forumid'], $this->contextinstanceid); - } - /** * Custom validation. * diff --git a/classes/event/user_report_viewed.php b/classes/event/user_report_viewed.php index df481c84..10c66321 100644 --- a/classes/event/user_report_viewed.php +++ b/classes/event/user_report_viewed.php @@ -88,18 +88,6 @@ public function get_url() { return $url; } - /** - * Return the legacy event log data. - * - * @return array|null - */ - protected function get_legacy_logdata() { - // The legacy log table expects a relative path to /mod/hsuforum/. - $logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/')); - - return array($this->courseid, 'hsuforum', 'user report', $logurl, $this->relateduserid); - } - /** * Custom validation. * diff --git a/hide_duplicated.css b/hide_duplicated.css new file mode 100644 index 00000000..2d18f3df --- /dev/null +++ b/hide_duplicated.css @@ -0,0 +1,4 @@ +#page-mod-hsuforum-post .activity-description, +#page-mod-hsuforum-post [role="main"] h2 { + display: none; +} \ No newline at end of file diff --git a/post.php b/post.php index ed18b3c5..2702c696 100644 --- a/post.php +++ b/post.php @@ -578,15 +578,19 @@ } else { $formheading = get_string('yournewtopic', 'hsuforum'); // Hide duplicated hsuforum description when creating a new discussion topic, see INT-18928. - $hidehtml = ''; - $hidehtml .= html_writer::start_tag('style', array('type' => 'text/css')) . "\n"; - $hidehtml .= ' - #page-mod-hsuforum-post .activity-description, - #page-mod-hsuforum-post [role="main"] h2 { - display: none; - };'; - $hidehtml .= html_writer::end_tag('style') . "\n"; - echo $hidehtml; + + // This breaks the page as it renders before the DOCTYPE. + // Switched to an external stylesheet. +// $hidehtml = ''; +// $hidehtml .= html_writer::start_tag('style', array('type' => 'text/css')) . "\n"; +// $hidehtml .= ' +// #page-mod-hsuforum-post .activity-description, +// #page-mod-hsuforum-post [role="main"] h2 { +// display: none; +// };'; +// $hidehtml .= html_writer::end_tag('style') . "\n"; +// echo $hidehtml; + $PAGE->requires->css(new moodle_url('/mod/hsuforum/hide_duplicated.css')); } }