added use of PHP's session management
[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
2a32fc83 9 session_start();
10
d068c0ec 11 $page_header_php = true;
12
d30d79f2 13 if (!isset($prefs_php))
14 include ("../functions/prefs.php");
e8816411 15 if (!isset($i18n_php))
16 include ("../functions/i18n.php");
44139266 17
03ff39b2 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");
e8816411 27 $default_charset = $languages[$squirrelmail_language]["CHARSET"];
03ff39b2 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
e8816411 40 // This is done to ensure that the character set is correct.
41 if ($default_charset != "")
42 header ("Content-Type: text/html; charset=$default_charset");
43
f8f9bed9 44 function displayPageHeader($color, $mailbox) {
2a32fc83 45 global $PHPSESSID;
46
3302d0d4 47 /** Here is the header and wrapping table **/
48 $shortBoxName = readShortMailboxName($mailbox, ".");
d7092926 49 $shortBoxName = stripslashes($shortBoxName);
f8f9bed9 50 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>";
aa767081 51 echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>";
a044cee3 52 echo " <TD ALIGN=left WIDTH=30%>";
2a32fc83 53 echo " <A HREF=\"signout.php?PHPSESSID=$PHPSESSID\" TARGET=_top><B>" . _("Sign Out") . "</B></A>";
a044cee3 54 echo " </TD><TD ALIGN=right WIDTH=70%>";
aae41ae9 55 echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName&nbsp;</div></B>";
3302d0d4 56 echo " </TD>";
a044cee3 57 echo " </TR></TABLE>\n";
f8f9bed9 58 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>";
a044cee3 59 echo " <TD ALIGN=left WIDTH=70%>";
2a32fc83 60 echo " <A HREF=\"compose.php?PHPSESSID=$PHPSESSID\">" . _("Compose") . "</A>&nbsp&nbsp";
61 echo " <A HREF=\"addressbook.php?PHPSESSID=$PHPSESSID\">" . _("Addresses") . "</A>&nbsp&nbsp";
62 echo " <A HREF=\"folders.php?PHPSESSID=$PHPSESSID\">" . _("Folders") . "</A>&nbsp&nbsp";
63 echo " <A HREF=\"options.php?PHPSESSID=$PHPSESSID\">" . _("Options") . "</A>&nbsp&nbsp";
a044cee3 64 echo " </TD><TD ALIGN=right WIDTH=30%>";
5479d709 65 echo " <A HREF=\"http://squirrelmail.sourceforge.net/index.php3?from=1\" TARGET=_top>SquirrelMail</A>";
3302d0d4 66 echo " </TD>";
67 echo "</TABLE>";
68 }
69?>