From 762edec90399b08350b3f4695f1ff33e3f493070 Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 5 Jul 2024 12:44:26 +0200 Subject: [PATCH] refactor: remove deprecated event observers and modal HTML Cleanup of obsolete event observer functions and modal HTML code. This streamlines the codebase by eliminating unused PHP event observer definitions and redundant embedded modal HTML in JS file. Enhances maintainability and reduces potential overhead. No functionality should be directly impacted. --- README.md | 0 db/events.php | 5 ----- global.js | 23 ----------------------- lib.php | 26 +------------------------- 4 files changed, 1 insertion(+), 53 deletions(-) create mode 100644 README.md delete mode 100644 db/events.php diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/db/events.php b/db/events.php deleted file mode 100644 index 3ed930f..0000000 --- a/db/events.php +++ /dev/null @@ -1,5 +0,0 @@ - - - - -`; - - // Append the modal HTML to the document body - document.body.insertAdjacentHTML('beforeend', modalHTML); - // Function to load a script into the DOM function loadScript(url, integrity, crossorigin) { return new Promise((resolve, reject) => { diff --git a/lib.php b/lib.php index 8237aff..9efb66b 100644 --- a/lib.php +++ b/lib.php @@ -57,28 +57,4 @@ function mod_exp360_cm_info_dynamic(cm_info $cm) $cm->set_no_view_link(); $cm->set_content($modals . $script); -} - -/** - * Event observer for mod_exp360. - */ -function mod_exp360_event_observer($event) -{ - global $PAGE; - $PAGE->requires->js('/mod/exp360/global.js'); -} - -/** - * Returns the list of event observers. - * - * @return array - */ -function mod_exp360_get_event_observers() -{ - return [ - [ - 'eventname' => '\core\event\course_viewed', - 'callback' => 'mod_exp360_event_observer', - ], - ]; -} +} \ No newline at end of file