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