r125: Added a link to the admin panel
[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
50 if ($bugsys->userinfo['userid'])
51 {
52 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";
53 }
54
55 // ###################################################################
56
57 $globaltemplates = array(
58 'doctype',
59 'header',
60 'headinclude',
61 'footer',
62 'selectoption',
63 'selectoptgroup'
64 );
65
66 $template->cache(array_merge($globaltemplates, (array)$fetchtemplates));
67
68 // ###################################################################
69 // initialize template variables
70 $show = array();
71
72 /*=====================================================================*\
73 || ###################################################################
74 || # $HeadURL$
75 || # $Id$
76 || ###################################################################
77 \*=====================================================================*/
78 ?>