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 | |
1026ec43 |
10 | // Always set up the language before calling these functions |
e8816411 |
11 | |
692155b7 |
12 | function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) { |
13 | |
14 | global $theme_css; |
15 | |
16 | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' . |
17 | "\n\n<HTML>\n<HEAD>\n"; |
18 | |
19 | if ($theme_css != '') { |
20 | echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n"; |
21 | } |
22 | |
23 | if( $do_hook ) { |
24 | do_hook ("generic_header"); |
25 | } |
26 | |
27 | echo "<title>$title</title>$xtra</head>\n\n"; |
7b086a80 |
28 | |
2a833d72 |
29 | } |
30 | |
3e96355c |
31 | function displayInternalLink ($path, $text, $target='') { |
5bbe20e4 |
32 | global $base_uri; |
33 | |
3e96355c |
34 | if ($target != '') |
5bbe20e4 |
35 | $target = " target=\"$target\""; |
d68a3926 |
36 | |
5bbe20e4 |
37 | echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>'; |
38 | } |
39 | |
f8f9bed9 |
40 | function displayPageHeader($color, $mailbox) { |
826b7f71 |
41 | global $delimiter, $hide_sm_attributions; |
67a42d95 |
42 | displayHtmlHeader (); |
2a833d72 |
43 | |
943292e4 |
44 | echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\" onLoad='if ( ( document.forms.length > 0 ) && ( document.forms[0].elements[0].type == \"text\" ) ) { document.forms[0].elements[0].focus(); }'>\n\n"; |
2a833d72 |
45 | |
3302d0d4 |
46 | /** Here is the header and wrapping table **/ |
e0dcff78 |
47 | $shortBoxName = readShortMailboxName($mailbox, $delimiter); |
390372b4 |
48 | echo "<A NAME=pagetop></A>\n"; |
a5d53045 |
49 | // echo "<table cellpadding=1 cellspacing=1 BGCOLOR=\"$color[4]\" width=100%><tr><td>"; |
50 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n"; |
51 | echo " <TR BGCOLOR=\"$color[9]\" >\n"; |
a1e1aff3 |
52 | echo " <TD ALIGN=left><b>\n"; |
5bbe20e4 |
53 | displayInternalLink ("src/signout.php", _("Sign Out"), "_top"); |
a1e1aff3 |
54 | echo " </b></TD><TD ALIGN=right>\n"; |
55 | echo ' ' . _("Current Folder") . ": <B>$shortBoxName </B>\n"; |
761d149e |
56 | echo " </TD>\n"; |
57 | echo " </TR>\n"; |
a1e1aff3 |
58 | echo " <TR BGCOLOR=\"$color[4]\">\n"; |
59 | echo " <TD ALIGN=left>\n"; |
d76f6440 |
60 | $urlMailbox = urlencode($mailbox); |
5bbe20e4 |
61 | displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right"); |
62 | echo " \n"; |
63 | displayInternalLink ("src/addressbook.php", _("Addresses"), "right"); |
64 | echo " \n"; |
65 | displayInternalLink ("src/folders.php", _("Folders"), "right"); |
66 | echo " \n"; |
67 | displayInternalLink ("src/options.php", _("Options"), "right"); |
68 | echo " \n"; |
8d455c73 |
69 | displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right"); |
70 | echo " \n"; |
d68a3926 |
71 | displayInternalLink ("src/help.php", _("Help"), "right"); |
5bbe20e4 |
72 | echo " \n"; |
7b086a80 |
73 | |
74 | do_hook("menuline"); |
75 | |
a1e1aff3 |
76 | echo " </TD><TD ALIGN=right>\n"; |
826b7f71 |
77 | echo ($hide_sm_attributions ? ' ' : |
78 | "<A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n"); |
761d149e |
79 | echo " </TD>\n"; |
80 | echo " </TR>\n"; |
81 | echo "</TABLE>\n\n"; |
a5d53045 |
82 | // echo "</td></tr></table>"; |
3302d0d4 |
83 | } |
e0dcff78 |
84 | ?> |