From 3a08f0e5647829eb3d4adc2d86db031e697973a8 Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 5 Jul 2024 11:58:14 +0200 Subject: [PATCH] feat: Add dynamic script integration for exp360 module Introduced a dynamic content management function to enhance the exp360 module's capabilities. This function injects necessary scripts dynamically, improving the modularity and maintainability of the exp360 activities. By adding Bootstrap dependencies and specific scripts directly into the content management info, the changes ensure that the module leverages required resources efficiently. --- lib.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib.php b/lib.php index 5463d01..6ed97d7 100644 --- a/lib.php +++ b/lib.php @@ -42,3 +42,17 @@ function exp360_delete_instance($id) return true; } + +function mod_exp360_cm_info_dynamic(cm_info $cm) +{ + global $PAGE, $DB; + + if ($cm->modname !== 'exp360') { + return; + } + + $script = ""; + + $cm->set_no_view_link(); + $cm->set_content($script); +}