Location: PHPKode > scripts > LuxCal Web Based Event Calendar > canvas/header.php
<?php
/*
= Header for LuxCal event calendar pages =

© Copyright 2010 LuxSoft - Luxembourg - www.LuxSoft.eu

This file is part of the LuxCal Web Calendar.

The LuxCal Web Calendar 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 3 of the License, or (at your option) any later version.

The LuxCal Web Calendar 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 the LuxCal 
Web Calendar. If not, see <http://www.gnu.org/licenses/>.
*/


function catList() {
	global $xx;
	$query = dbquery("SELECT category_id, name, color, background FROM [db]categories ORDER BY sequence");
	if ($query !== false) {
		echo '<option value="index.php?cC=0">'.$xx["hdr_all_cats"]."&nbsp;</option>\n";
		while ($row=mysql_fetch_assoc($query)) {
			$selected = ($_SESSION['cC'] == $row["category_id"]) ? " selected=\"selected\"" : "";
			$catStyle = ($row["color"]!="") ? " style=\"color: ".$row["color"]."; background: ".$row["background"].";\"" : "";
			echo '<option value="index.php?cC='.$row["category_id"].'"'.$catStyle.$selected.'>'.$row["name"]."</option>\n";
		}
	}
}

function langList() {
	$files = scandir("lang/");
	foreach ($files as $file) {
		if (substr($file, 0, 3) == "ui-") {
			$lang = strtolower(substr($file,3,-4));
			$selected = (strtolower($_SESSION['cL']) == $lang) ? " selected=\"selected\"" : "";
			echo '<option value="index.php?cL='.$lang.'"'.$selected.'>'.ucfirst($lang)."</option>\n";
		}
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $calendarTitle; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="LuxCal web calendar - a LuxSoft product" />
<meta name="keywords" content="LuxSoft, LuxCal, LuxCal web calendar" />
<meta name="author" content="Roel Buining" />
<meta name="robots" content="nofollow" />
<meta http-equiv="imagetoolbar" content="no" />
<link rel="shortcut icon" href="lcal.ico" />
<?php
if ($privs > 1) {
	echo '<link rel="alternate" type="application/rss+xml" title="LuxCal RSS Feed" href="'.$calendarUrl.'rssfeed.php" />'."\n";
}
?>
<link rel="stylesheet" type="text/css" href="css/css.php" />
<script type="text/javascript">
<?php //used by dtpicker.js
echo 'var dFormat = ',$dateFormat,';
var dSepar = "',$dateSep,'";
var time24 = ',$time24,';
var wStart = ',$weekStart,';
var dpToday = "',$xx["hdr_today"],'";
var dpClose = "',$xx["hdr_close"],'";
var dpMonths = new Array("',implode('","',$months),'");
var dpWkdays = new Array("',implode('","',$wkDays_m),'");'."\n";
?>
</script>
<script type="text/javascript" src="common/dtpicker.js"></script>
<script type="text/javascript" src="common/cpicker.js"></script>
<script type="text/javascript" src="common/poptext.js"></script>
<script type="text/javascript" src="common/general.js"></script>
</head>

<body>
<?php
echo "<div class=\"topBar\"><div class=\"topText\">\n";
echo '<h4 class="floatL">'.$calendarTitle."</h4>\n";
echo '<h4 class="floatR">'.$uname."</h4>\n";
echo '<h5 class="floatC">'.makeD(date("Y-m-d"),6,false)."</h5>\n";
echo "</div></div>\n";
echo "<div class=\"navBar\" name=\"noprint\">\n";
echo "<div class=\"floatR\">\n";
if ($sedit) { // superedit
	echo '<select title="'.$xx["hdr_select_admin_functions"].'" class="input" name="views" onchange="jumpMenu(this)">'."\n";
	echo '<option value="#">'.$xx["hdr_admin"]."&nbsp;</option>\n";
	echo '<option value="index.php?cP=90"'.($cP == "90" ? ' selected="selected">' : '>').$xx["hdr_settings"]."</option>\n";
	echo '<option value="index.php?cP=91"'.($cP == "91" ? ' selected="selected">' : '>').$xx["hdr_categories"]."</option>\n";
	echo '<option value="index.php?cP=92"'.($cP == "92" ? ' selected="selected">' : '>').$xx["hdr_users"]."</option>\n";
	echo '<option value="index.php?cP=93"'.($cP == "93" ? ' selected="selected">' : '>').$xx["hdr_database"]."</option>\n";
	echo '<option value="index.php?cP=94"'.($cP == "94" ? ' selected="selected">' : '>').$xx["hdr_import_ics"]."</option>\n";
	echo '<option value="index.php?cP=95"'.($cP == "95" ? ' selected="selected">' : '>').$xx["hdr_export_ics"]."</option>\n";
	echo '<option value="index.php?cP=96"'.($cP == "96" ? ' selected="selected">' : '>').$xx["hdr_import_csv"]."</option>\n";
	echo "</select> \n";
}
if ($privs > 1) { // post rights
	echo "<a onclick=\"x=eventWin('index.php?xP=10'); x.focus()\">".$xx["hdr_add_event"]."</a> | ";
	echo "<a onclick=\"openWin('index.php?xP=21','600','400')\">".$xx["hdr_guide"]."</a> | ";
}
if ($_SESSION['uid'] == 1) { // public user
	echo '<a href="index.php?cP=20">'.$xx["hdr_log_in"].'</a>';
} else { // known user
	echo '<a href="index.php?cP=20&amp;log_out=y">'.$xx["hdr_log_out"].'</a>';
}
echo "</div>\n";
echo "<div class=\"floatL\">\n";
echo '<select title="'.$xx["hdr_select_view"].'" class="input" name="views" onchange="jumpMenu(this)">'."\n";
echo '<option value="#">'.$xx["hdr_views"]."&nbsp;</option>\n";
echo '<option value="index.php?cP=1"'.($cP == "1" ? ' selected="selected">' : '>').$xx["hdr_year"]."</option>\n";
echo '<option value="index.php?cP=2"'.($cP == "2" ? ' selected="selected">' : '>').$xx["hdr_month"]."</option>\n";
echo '<option value="index.php?cP=3"'.($cP == "3" ? ' selected="selected">' : '>').$xx["hdr_week"]."</option>\n";
echo '<option value="index.php?cP=4"'.($cP == "4" ? ' selected="selected">' : '>').$xx["hdr_day"]."</option>\n";
echo '<option value="index.php?cP=5"'.($cP == "5" ? ' selected="selected">' : '>').$xx["hdr_upcoming"]."</option>\n";
echo '<option value="index.php?cP=6"'.($cP == "6" ? ' selected="selected">' : '>').$xx["hdr_changes"]."</option>\n";
echo "</select> \n";
echo '<select title="'.$xx["hdr_select_cat"].'" class="input" name="category" onchange="jumpMenu(this)">'."\n";
catList();
echo "</select> \n";
if ($langMenu) {
	echo '<select title="'.$xx["hdr_select_lang"].'" class="input" name="language" onchange="jumpMenu(this)">'."\n";
	langList();
	echo "</select> \n";
}
echo "&nbsp;</div>\n";
echo "<form method=\"post\" id=\"gotoD\" name=\"gotoD\" action=\"index.php\">\n";
$newD = IDtoDD($_SESSION['cD']);
echo '<input class="input" type="text" name="newD" id="newD" value="'.$newD."\" size='8' />\n";
echo '<input class="button" type="button" title="'.$xx["hdr_select_date"]."\" value=\"...\" onclick=\"dPicker('gotoD','newD')\" />\n";
echo "</form>\n";
echo "</div>\n";
echo "<div class=\"content\">\n";
if ($pageTitle) echo '<br /><h3 class="spaceLL">'.$pageTitle.'</h3>';
?>
Return current item: LuxCal Web Based Event Calendar