summaryrefslogtreecommitdiff
path: root/utils/modules.php
diff options
context:
space:
mode:
Diffstat (limited to 'utils/modules.php')
-rw-r--r--utils/modules.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/utils/modules.php b/utils/modules.php
index 62e64d3..4c34228 100644
--- a/utils/modules.php
+++ b/utils/modules.php
@@ -1,17 +1,15 @@
<?php
-$MODULES_DIR = $UTIL_DIR . "/modules";
-
-// Module includes
-include_once($MODULES_DIR . "/news.php");
-include_once($MODULES_DIR . "/events.php");
-
$modules = array();
-$newsmodule = new News($DATA_DIR . "/news.xml");
-$eventsmodule = new Events($DATA_DIR . "/events.xml");
-
-$modules["news"] = $newsmodule;
-$modules["events"] = $eventsmodule;
+/**
+ * Iterate all defined modules, and load them into the global array.
+ * FIXME: Make this lazy (load on demand)
+ */
+foreach($MODULES as $modulename) {
+ include_once($MODULES_DIR . "/" . $modulename . ".php");
+ $module = call_user_func($modulename . "_init");
+ $modules[$modulename] = $module;
+}
?>