From 2b1223ecf0894dc5856744e7aa266b2ab89fca20 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Wed, 3 Feb 2010 12:12:02 +0100 Subject: Move page template parsing to an own function --- inc/common.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'inc/common.php') 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 + */ +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. * -- cgit v1.2.3