diff options
author | Adrian Lang <lang@cosmocode.de> | 2010-02-03 12:12:02 +0100 |
---|---|---|
committer | Adrian Lang <lang@cosmocode.de> | 2010-02-03 12:13:11 +0100 |
commit | 2b1223ecf0894dc5856744e7aa266b2ab89fca20 (patch) | |
tree | cd6362512dfe1e2e38fc46aa66094cd35f1ec34b | |
parent | c1b2e736c1da490219a060dd52104c4f88e70f7e (diff) | |
download | rpg-2b1223ecf0894dc5856744e7aa266b2ab89fca20.tar.gz rpg-2b1223ecf0894dc5856744e7aa266b2ab89fca20.tar.bz2 |
Move page template parsing to an own function
-rw-r--r-- | inc/common.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/inc/common.php b/inc/common.php index 9cadb56fd..a8ac6f7de 100644 --- a/inc/common.php +++ b/inc/common.php @@ -808,7 +808,6 @@ function rawWiki($id,$rev=''){ function pageTemplate($data){ $id = $data[0]; global $conf; - global $INFO; $path = dirname(wikiFN($id)); @@ -825,7 +824,16 @@ function pageTemplate($data){ $path = substr($path, 0, strrpos($path, '/')); } } - if(!$tpl) return ''; + return isset($tpl) ? parsePageTemplate($tpl, $id) : ''; +} + +/** + * Performs common page template replacements + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function parsePageTemplate($tpl, $id) { + global $INFO; // replace placeholders $file = noNS($id); @@ -868,7 +876,6 @@ function pageTemplate($data){ return $tpl; } - /** * Returns the raw Wiki Text in three slices. * |