r1607: Updating all the language strings to use T() instead of _() so we can use...
[bugdar.git] / global.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar
5 || # Copyright ©2002-2007 Blue Static
6 || #
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 2 of the License.
10 || #
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
14 || # more details.
15 || #
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 \*=====================================================================*/
21
22 require_once('./includes/init.php');
23
24 define('HTML_CHECKED', ' checked="checked"');
25
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');
33 $template->langcall = 'T';
34
35 // ###################################################################
36 // global template variables
37 $datetime = $datef->format('l, F j, Y g:i A');
38 $year = $datef->format('Y');
39 $version = $bugsys->options['trackerversion'];
40
41 $show['admin'] = (bool)can_perform('canadminpanel');
42 $show['newreport'] = (bool)can_perform('cansubmitbugs');
43 $show['search'] = (bool)can_perform('cansearch');
44
45 if (!(defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true))
46 {
47 // ###################################################################
48 // cache templates
49 $globaltemplates = array(
50 'doctype',
51 'header',
52 'headinclude',
53 'footer',
54 'selectoption',
55 'selectoptgroup',
56 'std_error',
57 'std_redirect',
58 'std_message',
59 'bugfield_input_text',
60 'bugfield_input_checkbox',
61 'bugfield_select_single_option',
62 'bugfield_select_single',
63 'username_display',
64 'help_link'
65 );
66
67 $start = microtime();
68
69 $template->cache(array_merge($globaltemplates, (array)$fetchtemplates));
70
71 $bugsys->debug('time for tpl cache: ' . $funct->fetch_microtime_diff($start));
72
73 eval('$header = "' . $template->fetch('header') . '";');
74 eval('$doctype = "' . $template->fetch('doctype') . '";');
75 eval('$headinclude = "' . $template->fetch('headinclude') . '";');
76 eval('$footer = "' . $template->fetch('footer') . '";');
77 }
78
79 // ###################################################################
80
81 // ###################################################################
82 // initialize template variables
83 $show = array();
84
85 // ###################################################################
86 // create error reporter
87 require_once('./includes/class_message_reporter.php');
88 $message = new MessageReporter();
89 $bugsys->message =& $message;
90
91 /*=====================================================================*\
92 || ###################################################################
93 || # $HeadURL$
94 || # $Id$
95 || ###################################################################
96 \*=====================================================================*/
97 ?>