summaryrefslogtreecommitdiffstats
path: root/core/modules.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules.inc.php')
-rw-r--r--core/modules.inc.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/modules.inc.php b/core/modules.inc.php
index c1ebc80..395b8ad 100644
--- a/core/modules.inc.php
+++ b/core/modules.inc.php
@@ -5,7 +5,7 @@
function Uses() {
foreach(func_get_args() as $file) {
if(isset($GLOBALS['modules']->code[$file]))
- require_once($GLOBALS['modules']->code[$file]['path'] . 'code/' . $file . '.inc.php');
+ require_once($GLOBALS['modules']->GetCodePath($file));
else
die('Fatal: a required code file was not found.');
}
@@ -123,6 +123,19 @@
return $module;
}
+ function GetCodePath($name) {
+ return $this->code[$name]['path'] . 'code/' . $name . '.inc.php';
+ }
+
+ function GetPagePath($name, $type) {
+ return $this->pages[$name . '.' . $type]['path'] . 'pages/' .
+ strtr($type, array('c' => 'content', 'e' => 'editor', 'n' => 'nav')) . '/' . $name . '.xml';
+ }
+
+ function GetTemplatePath($name) {
+ return $this->templates[$name]['path'] . 'templates/' . $name . '.inc.php';
+ }
+
function Exists($name) {
return array_key_exists($name, $this->modules);
}