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