fixed some slash problems
[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 // Setting the language to use for gettext if it is not English
19 // (the default language) or empty.
20 $squirrelmail_language = getPref ($data_dir, $username, "language");
21 if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
22 putenv("LANG=$squirrelmail_language");
23 bindtextdomain("squirrelmail", "../locale/");
24 textdomain("squirrelmail");
25
26 // Setting cookie to use on the login screen the next time the
27 // same user logs in.
28 setcookie("squirrelmail_language", $squirrelmail_language,
29 time()+2592000);
30 }
31
32 function displayPageHeader($color, $mailbox) {
33 /** Here is the header and wrapping table **/
34 $shortBoxName = readShortMailboxName($mailbox, ".");
35 $shortBoxName = stripslashes($shortBoxName);
36 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>";
37 echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>";
38 echo " <TD ALIGN=left WIDTH=30%>";
39 echo " <A HREF=\"signout.php\" TARGET=_top><B>" . _("Sign Out") . "</B></A>";
40 echo " </TD><TD ALIGN=right WIDTH=70%>";
41 echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName&nbsp;</div></B>";
42 echo " </TD>";
43 echo " </TR></TABLE>\n";
44 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>";
45 echo " <TD ALIGN=left WIDTH=70%>";
46 echo " <A HREF=\"compose.php\">" . _("Compose") . "</A>&nbsp&nbsp";
47 echo " ". _("Addresses") ."&nbsp&nbsp";
48 echo " <A HREF=\"folders.php\">" . _("Folders") . "</A>&nbsp&nbsp";
49 echo " <A HREF=\"options.php\">" . _("Options") . "</A>&nbsp&nbsp";
50 echo " </TD><TD ALIGN=right WIDTH=30%>";
51 echo " <A HREF=\"http://squirrelmail.sourceforge.net\" TARGET=_top>SquirrelMail</A>";
52 echo " </TD>";
53 echo "</TABLE>";
54 }
55 ?>