59177427 |
1 | <?php |
3302d0d4 |
2 | /** |
a09387f4 |
3 | ** page_header.php |
3302d0d4 |
4 | ** |
5 | ** Prints the page header (duh) |
6 | ** |
245a6892 |
7 | ** $Id$ |
3302d0d4 |
8 | **/ |
9 | |
f435778e |
10 | if (defined('page_header_php')) |
11 | return; |
12 | define('page_header_php', true); |
2a32fc83 |
13 | |
f435778e |
14 | include('../src/validate.php'); |
15 | include("../functions/prefs.php"); |
16 | include("../functions/i18n.php"); |
17 | include("../functions/plugin.php"); |
44139266 |
18 | |
03ff39b2 |
19 | // Check to see if gettext is installed |
ebab5342 |
20 | $headers_sent=set_up_language(getPref($data_dir, $username, "language")); |
d30d79f2 |
21 | |
e8816411 |
22 | // This is done to ensure that the character set is correct. |
ebab5342 |
23 | // But first checks whether we have already sent headers |
24 | // with charset when we were setting up the user language. |
25 | // Otherwise user ends up with the default charset overriding |
26 | // his selected one. |
27 | if (!$headers_sent && $default_charset != "") |
e8816411 |
28 | header ("Content-Type: text/html; charset=$default_charset"); |
29 | |
a3ab54ab |
30 | function displayHtmlHeader ($title="SquirrelMail") { |
8df1c96e |
31 | global $theme_css; |
32 | |
2a833d72 |
33 | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'; |
34 | echo "\n\n"; |
35 | echo "<HTML>\n"; |
36 | echo "<HEAD>\n"; |
8df1c96e |
37 | if ($theme_css != "") { |
38 | printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">', |
39 | $theme_css); |
40 | echo "\n"; |
41 | } |
7b086a80 |
42 | |
43 | do_hook ("generic_header"); |
44 | |
04632dbc |
45 | echo "<TITLE>$title</TITLE>\n"; |
2a833d72 |
46 | echo "</HEAD>\n\n"; |
47 | } |
48 | |
5bbe20e4 |
49 | function displayInternalLink ($path, $text, $target="") { |
50 | global $base_uri; |
51 | |
52 | if ($target != "") |
53 | $target = " target=\"$target\""; |
d68a3926 |
54 | |
5bbe20e4 |
55 | echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>'; |
56 | } |
57 | |
f8f9bed9 |
58 | function displayPageHeader($color, $mailbox) { |
67a42d95 |
59 | displayHtmlHeader (); |
2a833d72 |
60 | |
61 | printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">', |
62 | $color[8], $color[4], $color[7], $color[7], $color[7]); |
761d149e |
63 | echo "\n\n"; |
2a833d72 |
64 | |
3302d0d4 |
65 | /** Here is the header and wrapping table **/ |
66 | $shortBoxName = readShortMailboxName($mailbox, "."); |
390372b4 |
67 | echo "<A NAME=pagetop></A>\n"; |
761d149e |
68 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n"; |
69 | echo " <TR BGCOLOR=\"$color[9]\">\n"; |
5bbe20e4 |
70 | echo " <TD ALIGN=left WIDTH=\"30%\"><b>\n"; |
71 | displayInternalLink ("src/signout.php", _("Sign Out"), "_top"); |
72 | echo " </b></TD><TD ALIGN=right WIDTH=\"70%\">\n"; |
88c81396 |
73 | echo " <div align=right>" . _("Current Folder") . ": <B>$shortBoxName </B></div>\n"; |
761d149e |
74 | echo " </TD>\n"; |
75 | echo " </TR>\n"; |
76 | echo "</TABLE>\n\n"; |
77 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n"; |
78 | echo " <TR>\n"; |
776c7431 |
79 | echo " <TD ALIGN=left WIDTH=\"99%\">\n"; |
d76f6440 |
80 | $urlMailbox = urlencode($mailbox); |
5bbe20e4 |
81 | displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right"); |
82 | echo " \n"; |
83 | displayInternalLink ("src/addressbook.php", _("Addresses"), "right"); |
84 | echo " \n"; |
85 | displayInternalLink ("src/folders.php", _("Folders"), "right"); |
86 | echo " \n"; |
87 | displayInternalLink ("src/options.php", _("Options"), "right"); |
88 | echo " \n"; |
8d455c73 |
89 | displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right"); |
90 | echo " \n"; |
d68a3926 |
91 | displayInternalLink ("src/help.php", _("Help"), "right"); |
5bbe20e4 |
92 | echo " \n"; |
7b086a80 |
93 | |
94 | do_hook("menuline"); |
95 | |
776c7431 |
96 | echo " </TD><TD ALIGN=right nowrap WIDTH=\"1%\">\n"; |
fb3b73a8 |
97 | echo " <A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n"; |
761d149e |
98 | echo " </TD>\n"; |
99 | echo " </TR>\n"; |
100 | echo "</TABLE>\n\n"; |
3302d0d4 |
101 | } |
102 | ?> |