From 8f1e947b1b4bb16d9bbcd612036a26286f843f4d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 11 May 2005 16:37:56 +0000 Subject: [PATCH] r107: Moved template loading out of includes/init.php and into global.php --- global.php | 33 +++++++++++++++++++++++++++++++++ includes/init.php | 33 --------------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/global.php b/global.php index bfa74d2..abb4a9f 100755 --- a/global.php +++ b/global.php @@ -12,6 +12,39 @@ require_once('./includes/init.php'); +// ################################################################### +// get the templateset +if ($bugsys->userinfo['userid']) +{ + $templatesetid = $bugsys->userinfo['templatesetid']; + $templateset = $bugsys->datastore['templateset']["$templatesetid"]; +} +if (!$templatesetid) +{ + foreach ($bugsys->datastore['templateset'] AS $templateset) + { + if ($templateset['default']) + { + $templatesetid = $templateset['templatesetid']; + $templateset = $bugsys->datastore['templateset']["$templatesetid"]; + } + } +} + +// ################################################################### +// load the template system +if (file_exists("./templates/$templateset[shortname]/tsinfo.php")) +{ + $bugsys->load('template_fs'); + $template->extension = 'tpl'; + $template->templatedir = $bugsys->fetch_sourcepath("templates/$templateset[shortname]/"); +} +else +{ + echo "template set info (templates/$templateset[shortname]/tsinfo.php) could not be loaded!"; + exit; +} + // ################################################################### if ($bugsys->userinfo['userid']) diff --git a/includes/init.php b/includes/init.php index 898f7f7..17864ce 100755 --- a/includes/init.php +++ b/includes/init.php @@ -156,39 +156,6 @@ while ($phrase = $db->fetch_array($locale)) } $db->free_result($phrases); -// ################################################################### -// get the templateset -if ($bugsys->userinfo['userid']) -{ - $templatesetid = $bugsys->userinfo['templatesetid']; - $templateset = $bugsys->datastore['templateset']["$templatesetid"]; -} -if (!$templatesetid) -{ - foreach ($bugsys->datastore['templateset'] AS $templateset) - { - if ($templateset['default']) - { - $templatesetid = $templateset['templatesetid']; - $templateset = $bugsys->datastore['templateset']["$templatesetid"]; - } - } -} - -// ################################################################### -// load the template system -if (file_exists("./templates/$templateset[shortname]/tsinfo.php")) -{ - $bugsys->load('template_fs'); - $template->extension = 'tpl'; - $template->templatedir = $bugsys->fetch_sourcepath("templates/$templateset[shortname]/"); -} -else -{ - echo "template set info (templates/$templateset[shortname]/tsinfo.php) could not be loaded!"; - exit; -} - // ################################################################### // Initialize usergroup system $_PERMISSION = array( -- 2.22.5