From 613803ed652937a8623c78cb298ca699a0211823 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 26 Jun 2008 10:22:30 -0400 Subject: [PATCH] Use the BSTemplate::$preParseHook for global templates --- global.php | 5 ----- includes/functions.php | 13 ++++++++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/global.php b/global.php index 76fcbbf..a8c19ca 100755 --- a/global.php +++ b/global.php @@ -70,11 +70,6 @@ if (!(defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true)) BSTemplate::cache(array_merge($globaltemplates, (array)$fetchtemplates)); BSApp::debug('time for tpl cache: ' . BSFunctions::fetch_microtime_diff($start)); - - $header = BSTemplate::fetch('header')->evaluate(); - $doctype = BSTemplate::fetch('doctype')->evaluate(); - $headinclude = BSTemplate::fetch('headinclude')->evaluate(); - $footer = BSTemplate::fetch('footer')->evaluate(); } // ################################################################### diff --git a/includes/functions.php b/includes/functions.php index 79b8c4b..f72be5f 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -533,8 +533,19 @@ function fetch_on_bits($mask, $userinfo = null) // #################### Start isso_pre_parse_hook #################### // the pre-parse hook for ISSO's template engine -function isso_pre_parse_hook($template) +function isso_pre_parse_hook($template, $obj) { + $globals = array( + 'header' => BSTemplate::fetch('header')->evaluate(), + 'doctype' => BSTemplate::fetch('doctype')->evaluate(), + 'headinclude' => BSTemplate::fetch('headinclude')->evaluate(), + 'footer' => BSTemplate::fetch('footer')->evaluate() + ); + + print_r($globals); + + $obj->vars = array_merge($globals, $obj->vars); + $template = preg_replace('#\$help\[(.*)\]#', '" . fetch_help_link("\1") . "', $template); return $template; } -- 2.22.5