Location: PHPKode > scripts > Cwfm > cwfm/php/Top.php
<?
//////////////////////////////////////////////////////////////////////
//
// Top.php - Cwfm
//
// By Vincenzo Valvano - hide@address.com
//
// This program is free software; you can redistribute it and/or 
// modify it under the terms of the GNU General Public License as 
// published by the Free Software Foundation; either version 2 of 
// the License, or (at your option) any later version. This program 
// is distributed in the hope that it will be useful, but WITHOUT 
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 
// License for more details. You should have received a copy of the 
// GNU General Public License along with this program; if not, write 
// to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
// Boston, MA  02111-1307  USA
//////////////////////////////////////////////////////////////////////
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
session_start();
include_once("Global.php");
include_once("Userdb.php");
include_once("data/Cwfmini.php");
include_once("lang/$Language.php");
if( !ValidSession() )
{
	IntrusionNotify();
	exit;
}
function Img($img)
{
	global $ShowIcons;

	if( !$ShowIcons )
		return("");
	else
	{
		$img .= ".png";
		return("<img src=\"img/small/$img\" border=\"0\" align=\"absmiddle\">");
	}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel=stylesheet href="Css.php" type="text/css">
<script language="JavaScript">
function SwitchUser()
{
	window.open('Cleanup.php', 'rightFrame', 'width=1,height=1');
	window.open('index.php?switch=1', '_top', '');
}
function UserOptions()
{
	var w = 450;
	var h = 250;
	var top = (screen.height-h)/2;
	var left = (screen.width-w)/2;

	window.open('UserConfig.php','Config','width='+w+',height='+h+',top='+top+',left='+left);
}
</script>
</head>
<body  topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<table width=100%><tr>
    <td height="13" width="7"> 
      <table cellspacing="5"><tr>
<?
global $sel, $ipath;
if( $sel == "" )
{
	echo "<script language=\"JavaScript\">\n";
	echo "parent.Done--;\n";
	echo "</script>\n";
}
else
{
	echo "<script language=\"JavaScript\">\n";
	echo "parent.Done = 5;\n";
	echo "</script>\n";
}
if( $Root1 != "" )
{
	if( $Rname1 == "" )
		$Rname1 = "Area 1";
	if( $Rname1 == $sel || $sel =="" && $DefRoot == $Root1 )
		$img = "Area";
	else
		$img = "AreaOff";
	printf("<td nowrap><a href=\"Top.php?ipath=Root1&sel=%s\" target=\"topFrame\" class=menu>%s%s</a></td>", 
		   $Rname1,Img($img), $Rname1 );
}
if( $Root2 != "" )
{
	if( $Rname2 == "" )
		$Rname2 = "Area 2";
	if( $Rname2 == $sel || $sel =="" && $DefRoot == $Root2 )
		$img = "Area";
	else
		$img = "AreaOff";
	printf("<td nowrap><a href=\"Top.php?ipath=Root2&sel=%s\" target=\"topFrame\" class=menu>%s%s</a></td>", 
	       $Rname2, Img($img), $Rname2);
}
if( $Root3 != "" )
{
	if( $Rname3 == "" )
		$Rname3 = "Area 3";
	if( $Rname3 == $sel || $sel =="" && $DefRoot == $Root3 )
		$img = "Area";
	else
		$img = "AreaOff";
	printf("<td nowrap><a href=\"Top.php?ipath=Root3&sel=%s\" target=\"topFrame\" class=menu>%s%s</a></td>", 
		    $Rname3, Img($img), $Rname3);
}
if( $Root4 != "" )
{
	if( $Rname4 == "" )
		$Rname4 = "Area 4";
	if( $Rname4 == $sel || $sel =="" && $DefRoot == $Root4 )
		$img = "Area";
	else
		$img = "AreaOff";
	printf("<td nowrap><a href=\"Top.php?ipath=Root4&sel=%s\" target=\"topFrame\" class=menu>%s%s</a></td>", 
		   $Rname4, Img($img), $Rname4);
}
?>
</tr></table></td>
    <td width="909" align="center" height="13"> <font face="Verdana, Arial, Helvetica, sans-serif"><strong> 
      <?
if( $sel != "" )
	echo $sel;
else
{
	switch($DefRoot)
	{
	case $Root1:
		echo $Rname1;
		break;
	case $Root2:
		echo $Rname2;
		break;
	case $Root3:
		echo $Rname3;
		break;
	case $Root4:
		echo $Rname4;
		break;
	}
}
?>
      </strong></font></td>
    <td width="20"> 
      <table cellspacing="5">
        <tr> 
          <td nowrap>
<? if( $CanConfigure )
	echo "<a href=\"#\" class=menu onClick=\"UserOptions()\">".Img("Options");
else
	echo "<a href=\"#\"class=disabled >".Img("Options");
?>
<?echo HiMenu($L24_L, $CanConfigure)."</a>"?></td>
<td nowrap><a href="#" class=menu onClick="SwitchUser()"><? echo Img("Logout").HiMenu($L4_L,1)?></a>
</td></tr></table></td></table>
<?
if( $ipath != "" )
{
	echo "<script language=\"JavaScript\">\n";
	echo "window.open('Tree.php?ipath=$ipath', 'leftFrame', '');\n";
	echo "</script>\n";
}
?> 
</body>
</html>
Return current item: Cwfm