summaryrefslogtreecommitdiff
path: root/utils/pages.php
diff options
context:
space:
mode:
authordeva <deva>2009-03-23 09:19:13 +0000
committerdeva <deva>2009-03-23 09:19:13 +0000
commit93a934051be4af5f61e28d98650808fcc701ae91 (patch)
tree75e22f28c1fbb1fca50cb1d6955261b6b2667ed6 /utils/pages.php
parent9059fdbae945e9ba925254203f835ad02907cfa2 (diff)
Restructured the files and formats of the modules.
Diffstat (limited to 'utils/pages.php')
-rw-r--r--utils/pages.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/utils/pages.php b/utils/pages.php
index 60156b8..0ab52a8 100644
--- a/utils/pages.php
+++ b/utils/pages.php
@@ -23,12 +23,15 @@ class Page {
$str = Markdown($this->content);
- if(preg_match_all("/\[\[([a-zA-Z0-9_]+)\]\]/", $str, $res)) {
+ if(preg_match_all("/\[\[([\?,a-zA-Z0-9_]+)\]\]/", $str, $res)) {
$modulecodes = array_unique($res[1]);
foreach($modulecodes as $modulecode) {
- if($modules[$modulecode]) {
- $modulestr = $modules[$modulecode]->run($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>";
}
@@ -98,4 +101,4 @@ class Pages {
}
}
-?> \ No newline at end of file
+?>