]>
src.bluestatic.org Git - bugdar.git/blob - global.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
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 define('HTML_CHECKED', ' checked="checked"');
26 // ###################################################################
27 // initialize template system
28 $bugsys->load('template_fs', 'template', true);
29 $template->setExtension('tpl');
30 $template->setPreParseHook('isso_pre_parse_hook');
31 $template->setTemplateDir('templates/');
32 $template->setDatabaseCache(TABLE_PREFIX
. 'template');
34 // ###################################################################
35 // global template variables
36 $datetime = $datef->format('l, F j, Y g:i A');
37 $year = $datef->format('Y');
38 $version = $bugsys->options
['trackerversion'];
40 $show['admin'] = (bool)can_perform('canadminpanel');
41 $show['newreport'] = (bool)can_perform('cansubmitbugs');
42 $show['search'] = (bool)can_perform('cansearch');
44 if (!defined('NO_TEMPLATES') OR (defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true))
46 // ###################################################################
48 if (($raw = @file_get_contents('./templates/stylevars.txt')) !== false)
51 $raw = preg_replace('#/\*(.*?)\*/#s', '', $raw);
54 // create individual vars
55 $varsraw = explode(';', $raw);
56 foreach ($varsraw AS $var)
58 if (($var = trim($var)) == '')
63 // split into varname - value pair
64 $temp = explode(':', $var);
67 $varname = trim($temp[0]);
68 $varname = preg_replace('#[^a-z0-9]#i', '_', $varname);
71 $value = trim($temp[1]);
72 $value = preg_replace('#[^a-z0-9%\-\.\#]#i', '', $value);
74 // put it in the array
75 $stylevar["$varname"] = $value;
80 trigger_error('StyleVars file (./templates/stylevars.txt) could not be loaded', E_USER_WARNING);
83 // ###################################################################
85 $globaltemplates = array(
95 'bugfield_input_text',
96 'bugfield_input_checkbox',
97 'bugfield_select_single_option',
98 'bugfield_select_single',
103 $start = microtime();
105 $template->cache(array_merge($globaltemplates, (array)$fetchtemplates));
107 $bugsys->debug('time for tpl cache: ' . $funct->fetch_microtime_diff($start));
109 eval('$header = "' . $template->fetch('header
') . '";');
110 eval('$doctype = "' . $template->fetch('doctype
') . '";');
111 eval('$headinclude = "' . $template->fetch('headinclude
') . '";');
112 eval('$footer = "' . $template->fetch('footer
') . '";');
115 // ###################################################################
117 // ###################################################################
118 // initialize template variables
121 // ###################################################################
122 // create error reporter
123 require_once('./includes/class_message_reporter.php');
124 $message = new MessageReporter();
125 $bugsys->message =& $message;
127 /*=====================================================================*\
128 || ###################################################################
131 || ###################################################################
132 \*=====================================================================*/