r175: Adding Message_Reporter::redirect() backend
[bugdar.git] / global.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]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 \*=====================================================================*/
12
13 require_once('./includes/init.php');
14
15 // ###################################################################
16 // get the templateset
17 if ($bugsys->userinfo['userid'])
18 {
19 $templatesetid = $bugsys->userinfo['templatesetid'];
20 $templateset = $bugsys->datastore['templateset']["$templatesetid"];
21 }
22 if (!$templatesetid)
23 {
24 foreach ($bugsys->datastore['templateset'] AS $templateset)
25 {
26 if ($templateset['default'])
27 {
28 $templatesetid = $templateset['templatesetid'];
29 $templateset = $bugsys->datastore['templateset']["$templatesetid"];
30 }
31 }
32 }
33
34 // ###################################################################
35 // load the template system
36 if (file_exists("./templates/$templateset[shortname]/tsinfo.php"))
37 {
38 $bugsys->load('template_fs');
39 $template->extension = 'tpl';
40 $template->templatedir = $bugsys->fetch_sourcepath("templates/$templateset[shortname]/");
41 }
42 else
43 {
44 echo "template set info (templates/$templateset[shortname]/tsinfo.php) could not be loaded!";
45 exit;
46 }
47
48 // ###################################################################
49 // check for userinfo -- temp
50 // #*# remove
51 if ($bugsys->userinfo['userid'])
52 {
53 echo '<div>You are logged in as ' . construct_user_display($bugsys->userinfo) . ' | [<a href="index.php?">Home</a>] | [<a href="newreport.php">New Bug</a>]' . ((can_perform('canadminpanel')) ? ' | [<a href="admin/">Admin</a>]' : '') . '</div><hr />' . "\n\n<!-- ******************************************************************* -->\n\n";
54 }
55
56 // ###################################################################
57 // cache templates
58 $globaltemplates = array(
59 'doctype',
60 'header',
61 'headinclude',
62 'footer',
63 'selectoption',
64 'selectoptgroup',
65 'std_error',
66 'std_redirect'
67 );
68
69 $template->cache(array_merge($globaltemplates, (array)$fetchtemplates));
70
71 // ###################################################################
72 // initialize template variables
73 $show = array();
74
75 // ###################################################################
76 // create error reporter
77 require_once('./includes/class_message_reporter.php');
78 $message = new Message_Reporter();
79 $bugsys->message =& $message;
80
81 /*=====================================================================*\
82 || ###################################################################
83 || # $HeadURL$
84 || # $Id$
85 || ###################################################################
86 \*=====================================================================*/
87 ?>