summaryrefslogtreecommitdiff
path: root/utils/modules/pages.php
diff options
context:
space:
mode:
authordeva <deva>2010-01-28 13:45:42 +0000
committerdeva <deva>2010-01-28 13:45:42 +0000
commit55b8d42b6422f24196078c8adb6a2a59861d0ef4 (patch)
tree922cb7c3ed395ac28279d5091d057b9f30bcdbfa /utils/modules/pages.php
parent657b191f6b4ae00d714fffe6911d8999d0a99873 (diff)
Lazy load on modules.
Diffstat (limited to 'utils/modules/pages.php')
-rw-r--r--utils/modules/pages.php14
1 files changed, 3 insertions, 11 deletions
diff --git a/utils/modules/pages.php b/utils/modules/pages.php
index 99c8142..d3ee0aa 100644
--- a/utils/modules/pages.php
+++ b/utils/modules/pages.php
@@ -1,6 +1,8 @@
<?php
/* -*- Mode: php; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+global $UTIL_DIR;
+
include_once($UTIL_DIR . "/convert.php");
include_once($UTIL_DIR . "/markdown.php");
include_once($UTIL_DIR . "/modules.php");
@@ -26,17 +28,7 @@ class Page {
$modulecodes = array_unique($res[1]);
foreach($modulecodes as $modulecode) {
- $m = explode("?", $modulecode);
- $module = $m[0];
- $params = explode(",", $m[1]);
- if($modules[$module]) {
- $modulestr = $modules[$module]->run($params);
- } else {
- $modulestr = "<p><strong>CMS ERROR: Could not find module: [[" . $modulecode . "]]</strong></p>";
- }
-
- $str = str_replace("[[" . $modulecode . "]]", $modulestr, $str);
-
+ $str = str_replace("[[" . $modulecode . "]]", runModule($modulecode), $str);
}
}