r1591: Fix the user approval system by actually getting email templates correctly
[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
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'];
39
40 $show['admin'] = (bool)can_perform('canadminpanel');
41 $show['newreport'] = (bool)can_perform('cansubmitbugs');
42 $show['search'] = (bool)can_perform('cansearch');
43
44 if (!(defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true))
45 {
46 // ###################################################################
47 // cache templates
48 $globaltemplates = array(
49 'doctype',
50 'header',
51 'headinclude',
52 'footer',
53 'selectoption',
54 'selectoptgroup',
55 'std_error',
56 'std_redirect',
57 'std_message',
58 'bugfield_input_text',
59 'bugfield_input_checkbox',
60 'bugfield_select_single_option',
61 'bugfield_select_single',
62 'username_display',
63 'help_link'
64 );
65
66 $start = microtime();
67
68 $template->cache(array_merge($globaltemplates, (array)$fetchtemplates));
69
70 $bugsys->debug('time for tpl cache: ' . $funct->fetch_microtime_diff($start));
71
72 eval('$header = "' . $template->fetch('header') . '";');
73 eval('$doctype = "' . $template->fetch('doctype') . '";');
74 eval('$headinclude = "' . $template->fetch('headinclude') . '";');
75 eval('$footer = "' . $template->fetch('footer') . '";');
76 }
77
78 // ###################################################################
79
80 // ###################################################################
81 // initialize template variables
82 $show = array();
83
84 // ###################################################################
85 // create error reporter
86 require_once('./includes/class_message_reporter.php');
87 $message = new MessageReporter();
88 $bugsys->message =& $message;
89
90 /*=====================================================================*\
91 || ###################################################################
92 || # $HeadURL$
93 || # $Id$
94 || ###################################################################
95 \*=====================================================================*/
96 ?>