]>
src.bluestatic.org Git - bugdar.git/blob - global.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 require_once('./includes/init.php');
24 // ###################################################################
25 // initialize template system
26 $bugsys->load('template_fs', 'template', true);
27 $template->set('extension', 'tpl');
28 $template->set('pre_parse_hook', 'isso_pre_parse_hook');
29 $template->set('templatedir', 'templates/');
31 // ###################################################################
32 // global template variables
33 $datetime = $datef->format('l, F j, Y g:i A');
34 $year = $datef->format('Y');
35 $version = $bugsys->options
['trackerversion'];
37 $show['admin'] = (bool)can_perform('canadminpanel');
38 $show['newreport'] = (bool)can_perform('cansubmitbugs');
39 $show['search'] = (bool)can_perform('cansearch');
41 // ###################################################################
43 if (($raw = @file_get_contents('./templates/stylevars.txt')) !== false)
46 $raw = preg_replace('#/\*(.*?)\*/#s', '', $raw);
49 // create individual vars
50 $varsraw = explode(';', $raw);
51 foreach ($varsraw AS $var)
53 if (($var = trim($var)) == '')
58 // split into varname - value pair
59 $temp = explode(':', $var);
62 $varname = trim($temp[0]);
63 $varname = preg_replace('#[^a-z0-9]#i', '_', $varname);
66 $value = trim($temp[1]);
67 $value = preg_replace('#[^a-z0-9%\-\.\#]#i', '', $value);
69 // put it in the array
70 $stylevar["$varname"] = $value;
75 trigger_error('StyleVars file (./templates/stylevars.txt) could not be loaded', E_USER_WARNING);
78 // ###################################################################
80 $globaltemplates = array(
90 'bugfield_input_text',
91 'bugfield_input_checkbox',
92 'bugfield_select_single_option',
93 'bugfield_select_single',
100 $template->cache(array_merge($globaltemplates, (array)$fetchtemplates));
102 $bugsys->debug('time for tpl cache: ' . $funct->fetch_microtime_diff($start));
104 eval('$header = "' . $template->fetch('header
') . '";');
105 eval('$doctype = "' . $template->fetch('doctype
') . '";');
106 eval('$headinclude = "' . $template->fetch('headinclude
') . '";');
107 eval('$footer = "' . $template->fetch('footer
') . '";');
109 // ###################################################################
111 // ###################################################################
112 // initialize template variables
115 // ###################################################################
116 // create error reporter
117 require_once('./includes/class_message_reporter.php');
118 $message = new Message_Reporter();
119 $bugsys->message =& $message;
121 /*=====================================================================*\
122 || ###################################################################
125 || ###################################################################
126 \*=====================================================================*/