Location: PHPKode > projects > BugIn and Ticketing System > bugin-0.65/inc/template/header.inc.php
<?php

if (isset($area) && isset($titleMatch[$area])) {
	$titlePrint = htmlentities($titleMatch[$area]);
}
elseif (isset($area)) {
	$titlePrint = htmlentities($area);
}
else {
	$titlePrint = "";
}

// Create the <h1> tag for each page.
$headLine = "{$options['systemName']}: <b>{$titlePrint}</b>";

// Create the <title>
$titleSysName = htmlentities($options['systemName']);
if ((!isset($_SESSION['userinfo']) || !($_SESSION['userinfo']['options'] & OPTION_FRAMES)) || isset($bassVersion)) {
	if (isset($_SESSION['message']))
		require_once($options['buginIncBase']."pre/message.pre.inc.php");
}

if ($_SESSION['userinfo']['options'] & OPTION_FRAMES)
	$UserInfoLink = ' target="view"';
else
	$UserInfoLink = '';

// This is where all the HTML output starts.
if (!isset($_REQUEST['embed'])) {
echo <<<EOT
<!DOCTYPE public "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html>
<head>
<link rel=STYLESHEET type="text/css" href="{$options['baseURL']}/master.theme.css" />
$meta
<title>$titleSysName - $titlePrint</title>


EOT;

} // END embed

// $noBody is used for the frameset, since it needs to be defined
// before the <head> closes...
if (!isset($noBody)) {
	echo <<<EOT
</head>
<body bgcolor="{$options['colorBg']}" text="{$options['colorText']}" link="{$options['colorLink']}" alink="{$options['colorALink']}" vlink="{$options['colorVLink']}" {$bodyOptions}>

<table width="100%" class="main" cellpadding="0" cellspacing="0">
	<tr class="main" valign="top">


EOT;

	if (($area != "changelog") && (!isset($bassVersion)) && (!isset($listFooter)) &&
     !((isset($_SESSION['userinfo']) && ($_SESSION['userinfo']['options'] & OPTION_FRAMES)) && ($area != "template/footer")) &&
		 isset($_SESSION['userinfo']) ) {
		echo <<<EOT
		<td class="main">

EOT;
		unset ($ticketList['size']);
		if (!isset($noMenu)) {
			echo <<<EOT

<table class="menu" width="150">
	<tr class="menu">
EOT;


echo <<<EOT
		<td bgcolor="{$options['colorTableHeaderBg']}"><center><font color="{$options['colorTableHeaderText']}" size=2>{$verbage['user']}: {$userinfo['name']}({$userinfo['uid']})</font></center></td>
	</tr>

EOT;

		while (list($headerKey, $mainValue) = each($ticketList)) {
			if (isset($mainValue['name'])) {
				echo <<<EOT
	<tr class="menu">
		<td bgcolor="{$options['colorTableHeaderBg']}"><center><font color="{$options['colorTableHeaderText']}" size="2">{$mainValue['name']}</font></center></td>
	</tr>
	<tr class="menu">

EOT;
				unset($mainValue['name']);
			}

			while (list($key, $value) = each ($mainValue)) {
				// Remove the cached search from this list.
				if ($key && ($key == "search"))
					continue;

				// FIXME:  0's are a HACK!  EWWWW!
				if (isset($value[0]['template'])) {
					$tmpl = $value[0]['template'];
					$link = "?area=list&view={$tmpl}&sg={$headerKey}&listCol={$key}";
				}
				elseif (isset($value[0]['link'])) {
					$link = $value[0]['link'];
				}
				else {
					$tmpl = "custom";
					$link = "?area=list&view={$tmpl}&sg={$headerKey}&listCol={$key}";
				}
				echo <<<EOT
				<tr class="menu"><td><a href="{$options['baseURL']}{$link}">{$value[0]['name']}</a></td></tr>

EOT;
			}
			echo <<<EOT
	</tr>
EOT;
		}

	echo <<<EOT
	<tr class="menu">
		<td bgcolor="{$options['colorTableHeaderBg']}"><center><font color="{$options['colorTableHeaderText']}" size="2">{$verbage['quick']} {$options['ticketName']}</font></center></td> 
	</tr>
	<tr class="menu">
		<td>
			<form action="{$options['baseURL']}{$options['formSubmitTo']}" method="post" name="slist"{$UserInfoLink}><input type="hidden" name="area" value="view" />
		{$options['ticketName']} {$verbage['number_short']}: <input type="text" size=8 name="num" />
			<input type="submit" name="t_view" value="{$verbage['show']}" /> 
			</form>
		</td>
	</tr>
	<tr class="menu">
		<td bgcolor="{$options['colorTableHeaderBg']}"><center><font color="{$options['colorTableHeaderText']}" size=2>{$verbage['system_menu']}</font></center></td>
	</tr>

EOT;


	// The last tags at the bottom.  *very* important.
		$uname = urlencode($userinfo['username']);
		if ($userinfo['isAdmin']) {
			echo <<<EOT
<tr class="menu"><td>[<a href="{$options['baseURL']}?area=admin">{$verbage['lst_admin']}</a>]</td></tr>
<tr class="menu"><td>[<a href="{$options['baseURL']}?area=report">{$verbage['lst_report']}</a>]</td></tr>

EOT;
		}
		if ($options['bassEnabled']) {
			echo <<<EOT
<tr class="menu"><td>[<a href="{$options['bassBaseURL']}">BASS</a>] <br />
EOT;
}
	echo <<<EOT

	<tr class="menu"><td>[<a href="{$options['baseURL']}?area=admin&action=uedit&selectedUser={$_SESSION['userinfo']['uid']}"{$UserInfoLink}>{$verbage['chg_user_info']}</a>]</td></tr>
	<tr class="menu"><td>[<a href="{$options['baseURL']}?area=logout" target="_top">{$verbage['log_out']}</a>]</td></tr>



EOT;
echo <<<EOT
	</table>
		</td>
EOT;
		}
	}

	echo <<<EOT

		<td class="main">
EOT;
}

// This is for supressing the message and header display areas.
if (!isset($noHeader)) {

	if ((!isset($_SESSION['userinfo']) || !($_SESSION['userinfo']['options'] & OPTION_FRAMES)) || isset($bassVersion)) {
		if (isset($_SESSION['message']))
			require_once($options['buginIncBase']."message.inc.php");
	}
}

?>
<!-- END HEADER //-->
Return current item: BugIn and Ticketing System