Revert "Use the BSTemplate::$preParseHook for global templates"
[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 require_once ISSO . '/Template.php';
29 BSTemplate::$preParseHook = 'isso_pre_parse_hook';
30 BSTemplate::$dbCacheTable = TABLE_PREFIX . 'template';
31 BSTemplate::$langcall = 'T';
32 BSTemplate::$templatePath = 'templates/%s.tpl';
33
34 // ###################################################################
35 // global template variables
36 $datetime = $datef->format('l, F j, Y g:i A');
37 $year = $datef->format('Y');
38 $version = bugdar::$options['trackerversion'];
39
40 $show = array(
41 'admin' => can_perform('canadminpanel'),
42 'newreport' => can_perform('cansubmitbugs'),
43 'search' => can_perform('cansearch')
44 );
45
46 if (!(defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true))
47 {
48 // ###################################################################
49 // cache templates
50 $globaltemplates = array(
51 'doctype',
52 'header',
53 'headinclude',
54 'footer',
55 'selectoption',
56 'selectoptgroup',
57 'std_error',
58 'std_redirect',
59 'std_message',
60 'bugfield_input_text',
61 'bugfield_input_checkbox',
62 'bugfield_select_single_option',
63 'bugfield_select_single',
64 'username_display',
65 'help_link'
66 );
67
68 $start = microtime();
69
70 BSTemplate::cache(array_merge($globaltemplates, (array)$fetchtemplates));
71
72 BSApp::debug('time for tpl cache: ' . BSFunctions::fetch_microtime_diff($start));
73
74 $header = BSTemplate::fetch('header')->evaluate();
75 $doctype = BSTemplate::fetch('doctype')->evaluate();
76 $headinclude = BSTemplate::fetch('headinclude')->evaluate();
77 $footer = BSTemplate::fetch('footer')->evaluate();
78 }
79
80 // ###################################################################
81 // create error reporter
82 require_once('./includes/class_message_reporter.php');
83 $message = new MessageReporter();
84 $bugsys->message = $message;
85
86 /*=====================================================================*\
87 || ###################################################################
88 || # $HeadURL$
89 || # $Id$
90 || ###################################################################
91 \*=====================================================================*/
92 ?>