made it possible to have a base imap directory for folders
[squirrelmail.git] / functions / page_header.php
... / ...
CommitLineData
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 if (!isset($i18n_php))
14 include ("../functions/i18n.php");
15
16 // Check to see if gettext is installed
17 if (function_exists("_")) {
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 $default_charset = $languages[$squirrelmail_language]["CHARSET"];
26
27 // Setting cookie to use on the login screen the next time the
28 // same user logs in.
29 setcookie("squirrelmail_language", $squirrelmail_language,
30 time()+2592000);
31 }
32 } else {
33 function _($string) {
34 return $string;
35 }
36 }
37
38 // This is done to ensure that the character set is correct.
39 if ($default_charset != "")
40 header ("Content-Type: text/html; charset=$default_charset");
41
42 function displayPageHeader($color, $mailbox) {
43 /** Here is the header and wrapping table **/
44 $shortBoxName = readShortMailboxName($mailbox, ".");
45 $shortBoxName = stripslashes($shortBoxName);
46 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>";
47 echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>";
48 echo " <TD ALIGN=left WIDTH=30%>";
49 echo " <A HREF=\"signout.php\" TARGET=_top><B>" . _("Sign Out") . "</B></A>";
50 echo " </TD><TD ALIGN=right WIDTH=70%>";
51 echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName&nbsp;</div></B>";
52 echo " </TD>";
53 echo " </TR></TABLE>\n";
54 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>";
55 echo " <TD ALIGN=left WIDTH=70%>";
56 echo " <A HREF=\"compose.php\">" . _("Compose") . "</A>&nbsp&nbsp";
57 echo " <A HREF=\"addressbook.php\">" . _("Addresses") . "</A>&nbsp&nbsp";
58 echo " <A HREF=\"folders.php\">" . _("Folders") . "</A>&nbsp&nbsp";
59 echo " <A HREF=\"options.php\">" . _("Options") . "</A>&nbsp&nbsp";
60 echo " </TD><TD ALIGN=right WIDTH=30%>";
61 echo " <A HREF=\"http://squirrelmail.sourceforge.net/index.php3?from=1\" TARGET=_top>SquirrelMail</A>";
62 echo " </TD>";
63 echo "</TABLE>";
64 }
65?>