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