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"); |
e8816411 |
13 | if (!isset($i18n_php)) |
14 | include ("../functions/i18n.php"); |
44139266 |
15 | |
03ff39b2 |
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"); |
e8816411 |
25 | $default_charset = $languages[$squirrelmail_language]["CHARSET"]; |
03ff39b2 |
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 | } |
d30d79f2 |
36 | } |
37 | |
e8816411 |
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 | |
f8f9bed9 |
42 | function displayPageHeader($color, $mailbox) { |
3302d0d4 |
43 | /** Here is the header and wrapping table **/ |
44 | $shortBoxName = readShortMailboxName($mailbox, "."); |
d7092926 |
45 | $shortBoxName = stripslashes($shortBoxName); |
f8f9bed9 |
46 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>"; |
aa767081 |
47 | echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>"; |
a044cee3 |
48 | echo " <TD ALIGN=left WIDTH=30%>"; |
aae41ae9 |
49 | echo " <A HREF=\"signout.php\" TARGET=_top><B>" . _("Sign Out") . "</B></A>"; |
a044cee3 |
50 | echo " </TD><TD ALIGN=right WIDTH=70%>"; |
aae41ae9 |
51 | echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName </div></B>"; |
3302d0d4 |
52 | echo " </TD>"; |
a044cee3 |
53 | echo " </TR></TABLE>\n"; |
f8f9bed9 |
54 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>"; |
a044cee3 |
55 | echo " <TD ALIGN=left WIDTH=70%>"; |
aae41ae9 |
56 | echo " <A HREF=\"compose.php\">" . _("Compose") . "</A>  "; |
57 | echo " ". _("Addresses") ."  "; |
58 | echo " <A HREF=\"folders.php\">" . _("Folders") . "</A>  "; |
59 | echo " <A HREF=\"options.php\">" . _("Options") . "</A>  "; |
a044cee3 |
60 | echo " </TD><TD ALIGN=right WIDTH=30%>"; |
aae41ae9 |
61 | echo " <A HREF=\"http://squirrelmail.sourceforge.net\" TARGET=_top>SquirrelMail</A>"; |
3302d0d4 |
62 | echo " </TD>"; |
63 | echo "</TABLE>"; |
64 | } |
65 | ?> |