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"); |
7b086a80 |
17 | if (!isset($plugin_php)) |
18 | include ("../functions/plugin.php"); |
44139266 |
19 | |
03ff39b2 |
20 | // Check to see if gettext is installed |
21 | if (function_exists("_")) { |
22 | // Setting the language to use for gettext if it is not English |
23 | // (the default language) or empty. |
24 | $squirrelmail_language = getPref ($data_dir, $username, "language"); |
25 | if ($squirrelmail_language != "en" && $squirrelmail_language != "") { |
43939260 |
26 | putenv("LC_ALL=$squirrelmail_language"); |
03ff39b2 |
27 | bindtextdomain("squirrelmail", "../locale/"); |
28 | textdomain("squirrelmail"); |
e8816411 |
29 | $default_charset = $languages[$squirrelmail_language]["CHARSET"]; |
03ff39b2 |
30 | } |
31 | } else { |
32 | function _($string) { |
33 | return $string; |
34 | } |
d30d79f2 |
35 | } |
36 | |
e8816411 |
37 | // This is done to ensure that the character set is correct. |
38 | if ($default_charset != "") |
39 | header ("Content-Type: text/html; charset=$default_charset"); |
40 | |
a3ab54ab |
41 | function displayHtmlHeader ($title="SquirrelMail") { |
8df1c96e |
42 | global $theme_css; |
43 | |
2a833d72 |
44 | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'; |
45 | echo "\n\n"; |
46 | echo "<HTML>\n"; |
47 | echo "<HEAD>\n"; |
8df1c96e |
48 | if ($theme_css != "") { |
49 | printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">', |
50 | $theme_css); |
51 | echo "\n"; |
52 | } |
7b086a80 |
53 | |
54 | do_hook ("generic_header"); |
55 | |
a3ab54ab |
56 | echo "<TITLE>$title</TITLE>"; |
2a833d72 |
57 | echo "</HEAD>\n\n"; |
58 | } |
59 | |
5bbe20e4 |
60 | function displayInternalLink ($path, $text, $target="") { |
61 | global $base_uri; |
62 | |
63 | if ($target != "") |
64 | $target = " target=\"$target\""; |
d68a3926 |
65 | |
5bbe20e4 |
66 | echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>'; |
67 | } |
68 | |
f8f9bed9 |
69 | function displayPageHeader($color, $mailbox) { |
2a833d72 |
70 | displayHtmlHeader ($color); |
71 | |
72 | printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">', |
73 | $color[8], $color[4], $color[7], $color[7], $color[7]); |
761d149e |
74 | echo "\n\n"; |
2a833d72 |
75 | |
3302d0d4 |
76 | /** Here is the header and wrapping table **/ |
77 | $shortBoxName = readShortMailboxName($mailbox, "."); |
d7092926 |
78 | $shortBoxName = stripslashes($shortBoxName); |
390372b4 |
79 | echo "<A NAME=pagetop></A>\n"; |
761d149e |
80 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n"; |
81 | echo " <TR BGCOLOR=\"$color[9]\">\n"; |
5bbe20e4 |
82 | echo " <TD ALIGN=left WIDTH=\"30%\"><b>\n"; |
83 | displayInternalLink ("src/signout.php", _("Sign Out"), "_top"); |
84 | echo " </b></TD><TD ALIGN=right WIDTH=\"70%\">\n"; |
88c81396 |
85 | echo " <div align=right>" . _("Current Folder") . ": <B>$shortBoxName </B></div>\n"; |
761d149e |
86 | echo " </TD>\n"; |
87 | echo " </TR>\n"; |
88 | echo "</TABLE>\n\n"; |
89 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n"; |
90 | echo " <TR>\n"; |
776c7431 |
91 | echo " <TD ALIGN=left WIDTH=\"99%\">\n"; |
d76f6440 |
92 | $urlMailbox = urlencode($mailbox); |
5bbe20e4 |
93 | displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right"); |
94 | echo " \n"; |
95 | displayInternalLink ("src/addressbook.php", _("Addresses"), "right"); |
96 | echo " \n"; |
97 | displayInternalLink ("src/folders.php", _("Folders"), "right"); |
98 | echo " \n"; |
99 | displayInternalLink ("src/options.php", _("Options"), "right"); |
100 | echo " \n"; |
8d455c73 |
101 | displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right"); |
102 | echo " \n"; |
d68a3926 |
103 | displayInternalLink ("src/help.php", _("Help"), "right"); |
5bbe20e4 |
104 | echo " \n"; |
7b086a80 |
105 | |
106 | do_hook("menuline"); |
107 | |
776c7431 |
108 | echo " </TD><TD ALIGN=right nowrap WIDTH=\"1%\">\n"; |
e9f8ea4e |
109 | echo " <A HREF=\"http://www.squirrelmail.org/index.php3?from=1\" TARGET=\"_top\">SquirrelMail</A>\n"; |
761d149e |
110 | echo " </TD>\n"; |
111 | echo " </TR>\n"; |
112 | echo "</TABLE>\n\n"; |
3302d0d4 |
113 | } |
114 | ?> |