]>
src.bluestatic.org Git - bugdar.git/blob - global.php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 require_once('./includes/init.php');
15 // ###################################################################
16 // initialize template system
17 $bugsys->load('template_fs');
18 $template->extension
= 'tpl';
19 $template->templatedir
= $bugsys->fetch_sourcepath('templates/');
21 // ###################################################################
22 // global template variables
23 $datetime = $datef->format('l, F j, Y g:i A');
24 $year = $datef->format('Y');
25 $version = $bugsys->options
['trackerversion'];
27 $show['admin'] = (bool)can_perform('canadminpanel');
28 $show['newreport'] = (bool)can_perform('cansubmitbugs');
29 $show['search'] = (bool)can_perform('cansearch');
31 // ###################################################################
33 if (($raw = @file_get_contents('./templates/stylevars.txt')) !== false)
36 $raw = preg_replace('#/\*(.*?)\*/#s', '', $raw);
39 // create individual vars
40 $varsraw = explode(';', $raw);
41 foreach ($varsraw AS $var)
43 if (($var = trim($var)) == '')
48 // split into varname - value pair
49 $temp = explode(':', $var);
52 $varname = trim($temp[0]);
53 $varname = preg_replace('#[^a-z0-9]#i', '_', $varname);
56 $value = trim($temp[1]);
57 $value = preg_replace('#[^a-z0-9%\-\.\#]#i', '', $value);
59 // put it in the array
60 $stylevar["$varname"] = $value;
65 trigger_error('StyleVars file (./templates/stylevars.txt) could not be loaded', E_USER_WARNING);
68 // ###################################################################
70 $globaltemplates = array(
80 'bugfield_input_text',
81 'bugfield_input_checkbox',
82 'bugfield_select_single_option',
83 'bugfield_select_single',
89 $template->cache(array_merge($globaltemplates, (array)$fetchtemplates));
91 $bugsys->debug('time for tpl cache: ' . $funct->fetch_microtime_diff($start));
93 eval('$header = "' . $template->fetch('header
') . '";');
94 eval('$doctype = "' . $template->fetch('doctype
') . '";');
95 eval('$headinclude = "' . $template->fetch('headinclude
') . '";');
96 eval('$footer = "' . $template->fetch('footer
') . '";');
98 // ###################################################################
100 // ###################################################################
101 // initialize template variables
104 // ###################################################################
105 // create error reporter
106 require_once('./includes/class_message_reporter.php');
107 $message = new Message_Reporter();
108 $bugsys->message =& $message;
110 /*=====================================================================*\
111 || ###################################################################
114 || ###################################################################
115 \*=====================================================================*/