Options framed (try 1)
[squirrelmail.git] / functions / page_header.php
CommitLineData
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
1026ec43 14 // Always set up the language before calling these functions
e8816411 15
a3ab54ab 16 function displayHtmlHeader ($title="SquirrelMail") {
8df1c96e 17 global $theme_css;
18
3e96355c 19 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' .
20 "\n\n<HTML>\n<HEAD>\n";
21 if ($theme_css != '') {
22 echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
8df1c96e 23 }
7b086a80 24
25 do_hook ("generic_header");
26
04632dbc 27 echo "<TITLE>$title</TITLE>\n";
2a833d72 28 echo "</HEAD>\n\n";
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) {
67a42d95 41 displayHtmlHeader ();
2a833d72 42
943292e4 43 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 44
3302d0d4 45 /** Here is the header and wrapping table **/
46 $shortBoxName = readShortMailboxName($mailbox, ".");
390372b4 47 echo "<A NAME=pagetop></A>\n";
a1e1aff3 48 echo "<table BGCOLOR=\"$color[9]\" width=100%><tr><td>";
49 echo "<TABLE BGCOLOR=\"$color[9]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
50 echo " <TR>\n";
51 echo " <TD ALIGN=left><b>\n";
5bbe20e4 52 displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
a1e1aff3 53 echo " </b></TD><TD ALIGN=right>\n";
54 echo ' ' . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B>\n";
761d149e 55 echo " </TD>\n";
56 echo " </TR>\n";
a1e1aff3 57 echo " <TR BGCOLOR=\"$color[4]\">\n";
58 echo " <TD ALIGN=left>\n";
d76f6440 59 $urlMailbox = urlencode($mailbox);
5bbe20e4 60 displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
61 echo "&nbsp;&nbsp;\n";
62 displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
63 echo "&nbsp;&nbsp;\n";
64 displayInternalLink ("src/folders.php", _("Folders"), "right");
65 echo "&nbsp;&nbsp;\n";
66 displayInternalLink ("src/options.php", _("Options"), "right");
67 echo "&nbsp;&nbsp;\n";
8d455c73 68 displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
69 echo "&nbsp;&nbsp;\n";
d68a3926 70 displayInternalLink ("src/help.php", _("Help"), "right");
5bbe20e4 71 echo "&nbsp;&nbsp;\n";
7b086a80 72
73 do_hook("menuline");
74
a1e1aff3 75 echo " </TD><TD ALIGN=right>\n";
fb3b73a8 76 echo " <A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n";
761d149e 77 echo " </TD>\n";
78 echo " </TR>\n";
79 echo "</TABLE>\n\n";
a1e1aff3 80 echo "</td></tr></table>";
3302d0d4 81 }
3e96355c 82?>