Make the password reset email work (untested)
[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 // initialize the email system
36 require_once ISSO . '/Mail.php';
37 require_once 'includes/emails.php';
38
39 // ###################################################################
40 // global template variables
41
42 $show = array(
43 'admin' => can_perform('canadminpanel'),
44 'newreport' => can_perform('cansubmitbugs'),
45 'search' => can_perform('cansearch')
46 );
47
48 if (!(defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true))
49 {
50 // ###################################################################
51 // cache templates
52 $globaltemplates = array(
53 'doctype',
54 'header',
55 'headinclude',
56 'footer',
57 'selectoption',
58 'selectoptgroup',
59 'std_error',
60 'std_redirect',
61 'std_message',
62 'bugfield_input_text',
63 'bugfield_input_checkbox',
64 'bugfield_select_single_option',
65 'bugfield_select_single',
66 'username_display',
67 'help_link'
68 );
69
70 $start = microtime();
71
72 BSTemplate::cache(array_merge($globaltemplates, (array)$fetchtemplates));
73
74 BSApp::debug('time for tpl cache: ' . BSFunctions::fetch_microtime_diff($start));
75
76 BSTemplate::$globalVars = array(
77 'stylevar' => &$stylevar,
78 'show' => &$show,
79 'focus' => $focus
80 );
81
82 $globalTemplates = array(
83 'header' => BSTemplate::fetch('header')->evaluate()->getTemplate(),
84 'doctype' => BSTemplate::fetch('doctype')->evaluate()->getTemplate(),
85 'headinclude' => BSTemplate::fetch('headinclude')->evaluate()->getTemplate(),
86 'footer' => BSTemplate::fetch('footer')->evaluate()->getTemplate(),
87 );
88
89 BSTemplate::$globalVars = array_merge($globalTemplates, BSTemplate::$globalVars);
90 }
91
92 // ###################################################################
93 // create error reporter
94 require_once('./includes/class_message_reporter.php');
95 $message = new MessageReporter();
96 $bugsys->message = $message;
97
98 /*=====================================================================*\
99 || ###################################################################
100 || # $HeadURL$
101 || # $Id$
102 || ###################################################################
103 \*=====================================================================*/
104 ?>