Removed debug code that had made its way into CVS :-(
[squirrelmail.git] / functions / page_header.php
CommitLineData
3302d0d4 1<?
2 /**
a09387f4 3 ** page_header.php
3302d0d4 4 **
5 ** Prints the page header (duh)
6 **
7 **/
8
d068c0ec 9 $page_header_php = true;
10
d30d79f2 11 if (!isset($prefs_php))
12 include ("../functions/prefs.php");
13
44139266 14 // This is done to ensure that the character set is correct when
15 // receiving input from HTTP forms
17ce8467 16 if ($default_charset != "")
17 header ("Content-Type: text/html; charset=$default_charset");
44139266 18
03ff39b2 19 // Check to see if gettext is installed
20 if (function_exists("_")) {
21 // Setting the language to use for gettext if it is not English
22 // (the default language) or empty.
23 $squirrelmail_language = getPref ($data_dir, $username, "language");
24 if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
25 putenv("LANG=$squirrelmail_language");
26 bindtextdomain("squirrelmail", "../locale/");
27 textdomain("squirrelmail");
28
29 // Setting cookie to use on the login screen the next time the
30 // same user logs in.
31 setcookie("squirrelmail_language", $squirrelmail_language,
32 time()+2592000);
33 }
34 } else {
35 function _($string) {
36 return $string;
37 }
d30d79f2 38 }
39
f8f9bed9 40 function displayPageHeader($color, $mailbox) {
3302d0d4 41 /** Here is the header and wrapping table **/
42 $shortBoxName = readShortMailboxName($mailbox, ".");
d7092926 43 $shortBoxName = stripslashes($shortBoxName);
f8f9bed9 44 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>";
aa767081 45 echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>";
a044cee3 46 echo " <TD ALIGN=left WIDTH=30%>";
aae41ae9 47 echo " <A HREF=\"signout.php\" TARGET=_top><B>" . _("Sign Out") . "</B></A>";
a044cee3 48 echo " </TD><TD ALIGN=right WIDTH=70%>";
aae41ae9 49 echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName&nbsp;</div></B>";
3302d0d4 50 echo " </TD>";
a044cee3 51 echo " </TR></TABLE>\n";
f8f9bed9 52 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>";
a044cee3 53 echo " <TD ALIGN=left WIDTH=70%>";
aae41ae9 54 echo " <A HREF=\"compose.php\">" . _("Compose") . "</A>&nbsp&nbsp";
55 echo " ". _("Addresses") ."&nbsp&nbsp";
56 echo " <A HREF=\"folders.php\">" . _("Folders") . "</A>&nbsp&nbsp";
57 echo " <A HREF=\"options.php\">" . _("Options") . "</A>&nbsp&nbsp";
a044cee3 58 echo " </TD><TD ALIGN=right WIDTH=30%>";
aae41ae9 59 echo " <A HREF=\"http://squirrelmail.sourceforge.net\" TARGET=_top>SquirrelMail</A>";
3302d0d4 60 echo " </TD>";
61 echo "</TABLE>";
62 }
63?>