From 05622ff04c4a9b7bd78e492e641ab3b2911bf705 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 25 Jun 2008 11:25:06 -0400 Subject: [PATCH] global.php is now converted --- global.php | 39 +++++++++++++++++---------------------- includes/functions.php | 2 +- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/global.php b/global.php index 0405f84..20cfa8a 100755 --- a/global.php +++ b/global.php @@ -25,12 +25,11 @@ define('HTML_CHECKED', ' checked="checked"'); // ################################################################### // initialize template system -$bugsys->load('template_fs', 'template', true); -$template->setExtension('tpl'); -$template->setPreParseHook('isso_pre_parse_hook'); -$template->setTemplateDir('templates/'); -$template->setDatabaseCache(TABLE_PREFIX . 'template'); -$template->langcall = 'T'; +require_once ISSO . '/Template.php'; +BSTemplate::$preParseHook = 'isso_pre_parse_hook'; +BSTemplate::$dbCacheTable = TABLE_PREFIX . 'template'; +BSTemplate::$langcall = 'T'; +BSTemplate::$templatePath = 'templates/%s.tpl'; // ################################################################### // global template variables @@ -38,9 +37,11 @@ $datetime = $datef->format('l, F j, Y g:i A'); $year = $datef->format('Y'); $version = $bugsys->options['trackerversion']; -$show['admin'] = (bool)can_perform('canadminpanel'); -$show['newreport'] = (bool)can_perform('cansubmitbugs'); -$show['search'] = (bool)can_perform('cansearch'); +$show = array( + 'admin' => can_perform('canadminpanel'), + 'newreport' => can_perform('cansubmitbugs'), + 'search' => can_perform('cansearch') +); if (!(defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true)) { @@ -66,27 +67,21 @@ if (!(defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true)) $start = microtime(); - $template->cache(array_merge($globaltemplates, (array)$fetchtemplates)); + BSTemplate::cache(array_merge($globaltemplates, (array)$fetchtemplates)); - $bugsys->debug('time for tpl cache: ' . $funct->fetch_microtime_diff($start)); + BSApp::debug('time for tpl cache: ' . BSFunctions::fetch_microtime_diff($start)); - eval('$header = "' . $template->fetch('header') . '";'); - eval('$doctype = "' . $template->fetch('doctype') . '";'); - eval('$headinclude = "' . $template->fetch('headinclude') . '";'); - eval('$footer = "' . $template->fetch('footer') . '";'); + $header = BSTemplate::fetch('header')->evaluate(); + $doctype = BSTemplate::fetch('doctype')->evaluate(); + $headinclude = BSTemplate::fetch('headinclude')->evaluate(); + $footer = BSTemplate::fetch('footer')->evaluate(); } -// ################################################################### - -// ################################################################### -// initialize template variables -$show = array(); - // ################################################################### // create error reporter require_once('./includes/class_message_reporter.php'); $message = new MessageReporter(); -$bugsys->message =& $message; +$bugsys->message = $message; /*=====================================================================*\ || ################################################################### diff --git a/includes/functions.php b/includes/functions.php index 3944caf..3da78ed 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -141,7 +141,7 @@ function can_perform($bitmask, $productid = 0, $userinfo = null) return $verdict; } - $bugsys->debug("verdict on can_perform($bitmask, $productid, $userinfo[userid]) = " . ($userinfo['permissions'] & $bugsys->permissions["$bitmask"])); + BSApp::debug("verdict on can_perform($bitmask, $productid, $userinfo[userid]) = " . ($userinfo['permissions'] & $bugsys->permissions["$bitmask"])); return ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]); } -- 2.43.5