]>
src.bluestatic.org Git - bugdar.git/blob - global.php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Bugdar [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 require_once('./includes/init.php');
15 // ###################################################################
16 // initialize template system
17 $bugsys->load('template_fs');
18 $template->extension
= 'tpl';
19 $template->pre_parse_hook
= 'isso_pre_parse_hook';
20 $template->templatedir
= $bugsys->fetch_sourcepath('templates/');
22 // ###################################################################
23 // global template variables
24 $datetime = $datef->format('l, F j, Y g:i A');
25 $year = $datef->format('Y');
26 $version = $bugsys->options
['trackerversion'];
28 $show['admin'] = (bool)can_perform('canadminpanel');
29 $show['newreport'] = (bool)can_perform('cansubmitbugs');
30 $show['search'] = (bool)can_perform('cansearch');
32 // ###################################################################
34 if (($raw = @file_get_contents('./templates/stylevars.txt')) !== false)
37 $raw = preg_replace('#/\*(.*?)\*/#s', '', $raw);
40 // create individual vars
41 $varsraw = explode(';', $raw);
42 foreach ($varsraw AS $var)
44 if (($var = trim($var)) == '')
49 // split into varname - value pair
50 $temp = explode(':', $var);
53 $varname = trim($temp[0]);
54 $varname = preg_replace('#[^a-z0-9]#i', '_', $varname);
57 $value = trim($temp[1]);
58 $value = preg_replace('#[^a-z0-9%\-\.\#]#i', '', $value);
60 // put it in the array
61 $stylevar["$varname"] = $value;
66 trigger_error('StyleVars file (./templates/stylevars.txt) could not be loaded', E_USER_WARNING);
69 // ###################################################################
71 $globaltemplates = array(
81 'bugfield_input_text',
82 'bugfield_input_checkbox',
83 'bugfield_select_single_option',
84 'bugfield_select_single',
91 $template->cache(array_merge($globaltemplates, (array)$fetchtemplates));
93 $bugsys->debug('time for tpl cache: ' . $funct->fetch_microtime_diff($start));
95 eval('$header = "' . $template->fetch('header
') . '";');
96 eval('$doctype = "' . $template->fetch('doctype
') . '";');
97 eval('$headinclude = "' . $template->fetch('headinclude
') . '";');
98 eval('$footer = "' . $template->fetch('footer
') . '";');
100 // ###################################################################
102 // ###################################################################
103 // initialize template variables
106 // ###################################################################
107 // create error reporter
108 require_once('./includes/class_message_reporter.php');
109 $message = new Message_Reporter();
110 $bugsys->message =& $message;
112 /*=====================================================================*\
113 || ###################################################################
116 || ###################################################################
117 \*=====================================================================*/