59177427 |
1 | <?php |
3302d0d4 |
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 != "") { |
43939260 |
24 | putenv("LC_ALL=$squirrelmail_language"); |
03ff39b2 |
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. |
7a3bd55d |
31 | #setcookie("squirrelmail_language", $squirrelmail_language, |
32 | # time()+2592000); |
33 | $squirrelmail_language = $language; |
03ff39b2 |
34 | } |
35 | } else { |
36 | function _($string) { |
37 | return $string; |
38 | } |
d30d79f2 |
39 | } |
40 | |
e8816411 |
41 | // This is done to ensure that the character set is correct. |
42 | if ($default_charset != "") |
43 | header ("Content-Type: text/html; charset=$default_charset"); |
44 | |
a3ab54ab |
45 | function displayHtmlHeader ($title="SquirrelMail") { |
8df1c96e |
46 | global $theme_css; |
47 | |
2a833d72 |
48 | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'; |
49 | echo "\n\n"; |
50 | echo "<HTML>\n"; |
51 | echo "<HEAD>\n"; |
8df1c96e |
52 | if ($theme_css != "") { |
53 | printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">', |
54 | $theme_css); |
55 | echo "\n"; |
56 | } |
a3ab54ab |
57 | echo "<TITLE>$title</TITLE>"; |
2a833d72 |
58 | echo "</HEAD>\n\n"; |
59 | } |
60 | |
f8f9bed9 |
61 | function displayPageHeader($color, $mailbox) { |
2a833d72 |
62 | displayHtmlHeader ($color); |
63 | |
64 | printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">', |
65 | $color[8], $color[4], $color[7], $color[7], $color[7]); |
66 | |
3302d0d4 |
67 | /** Here is the header and wrapping table **/ |
68 | $shortBoxName = readShortMailboxName($mailbox, "."); |
d7092926 |
69 | $shortBoxName = stripslashes($shortBoxName); |
f8f9bed9 |
70 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>"; |
aa767081 |
71 | echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>"; |
a044cee3 |
72 | echo " <TD ALIGN=left WIDTH=30%>"; |
9f2215a1 |
73 | echo " <A HREF=\"signout.php\" TARGET=_top><B>" . _("Sign Out") . "</B></A>"; |
a044cee3 |
74 | echo " </TD><TD ALIGN=right WIDTH=70%>"; |
aae41ae9 |
75 | echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName </div></B>"; |
3302d0d4 |
76 | echo " </TD>"; |
a044cee3 |
77 | echo " </TR></TABLE>\n"; |
f8f9bed9 |
78 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>"; |
a044cee3 |
79 | echo " <TD ALIGN=left WIDTH=70%>"; |
966286ae |
80 | $urlMailbox = $mailbox; |
e14de652 |
81 | echo " <A HREF=\"compose.php?mailbox=$urlMailbox\">" . _("Compose") . "</A> "; |
82 | echo " <A HREF=\"addressbook.php\">" . _("Addresses") . "</A> "; |
83 | echo " <A HREF=\"folders.php\">" . _("Folders") . "</A> "; |
84 | echo " <A HREF=\"options.php\">" . _("Options") . "</A> "; |
a044cee3 |
85 | echo " </TD><TD ALIGN=right WIDTH=30%>"; |
5479d709 |
86 | echo " <A HREF=\"http://squirrelmail.sourceforge.net/index.php3?from=1\" TARGET=_top>SquirrelMail</A>"; |
3302d0d4 |
87 | echo " </TD>"; |
88 | echo "</TABLE>"; |
89 | } |
90 | ?> |