summaryrefslogtreecommitdiff
path: root/utils/modules.php
diff options
context:
space:
mode:
authordeva <deva>2009-03-23 18:41:22 +0000
committerdeva <deva>2009-03-23 18:41:22 +0000
commiteec8fdf3fd36f6f8511bdb4bea0899f82bf3f6ab (patch)
treeeefac33e9ef9980c81fd6200a437f39c12e63ba8 /utils/modules.php
parent93a934051be4af5f61e28d98650808fcc701ae91 (diff)
First attempt on a modularized plugin system, complete with admin, and parameters.
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;
+}
?>