<?php

	class AKB_TITLE_PANEL extends AKB_PANEL
	{
		/**
		* SetPanelSettings
		* This function is a chance to set any last minute global variables for
		* the template to use
		*
		* @return void
		*/
		function SetPanelSettings()
		{
			// Parse the panel of tokens, etc
			$GLOBALS['Trail'] = $this->GetTrail();

			if ($GLOBALS['Trail'] == '') {
				$GLOBALS['HideTrail'] = 'none';
				$GLOBALS['HideTopLinks'] = 'inline';
			} else {
				$GLOBALS['HideTrail'] = 'inline';
				$GLOBALS['HideTopLinks'] = 'none';
			}
			
			if ($GLOBALS['enableContactPage']) {
				$GLOBALS['TopContactLink'] = $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet('ContactLink');
			}
			
			if ($userObj = AKB_AUTH::GetLoggedInUser()) {
				$GLOBALS['Username'] = $userObj->username;
				
				if (AKB_AUTH::HasAdminAccess()) {
					$GLOBALS['ControlPanel'] = $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet("ControlPanelLink");
				} else {
					$GLOBALS['ControlPanel'] = "";
				}
				
				$GLOBALS['UserTools'] = $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet("LoggedIn");
			} else {
				$GLOBALS['UserTools'] = $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet("NotLoggedIn");
			}
		}

		/**
		* GetTrail
		* Get the trail to the current category
		*
		* @return string The html for the trail
		*/
		function GetTrail()
		{
			$trail = '';
			if (isset($GLOBALS['CategoryId']) && $GLOBALS['CategoryId'] != 0) {
				$trail .= $GLOBALS['AKB_CLASS_HELPER']->GetCategoryTrail($GLOBALS['CategoryId']) ;
			}
			return $trail;
		}

	}
?>
