Linux browsers didn't like the older system.
[squirrelmail.git] / functions / page_header.php
1 <?php
2 /**
3 ** page_header.php
4 **
5 ** Prints the page header (duh)
6 **
7 ** $Id$
8 **/
9
10 if (defined('page_header_php'))
11 return;
12 define('page_header_php', true);
13
14 // Always set up the language before calling these functions
15
16 function displayHtmlHeader ($title="SquirrelMail") {
17 global $theme_css;
18
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";
23 }
24
25 do_hook ("generic_header");
26
27 echo "<TITLE>$title</TITLE>\n";
28 echo "</HEAD>\n\n";
29 }
30
31 function displayInternalLink ($path, $text, $target='') {
32 global $base_uri;
33
34 if ($target != '')
35 $target = " target=\"$target\"";
36
37 echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
38 }
39
40 function displayPageHeader($color, $mailbox) {
41 displayHtmlHeader ();
42
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";
44
45 /** Here is the header and wrapping table **/
46 $shortBoxName = readShortMailboxName($mailbox, ".");
47 echo "<A NAME=pagetop></A>\n";
48 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
49 echo " <TR BGCOLOR=\"$color[9]\">\n";
50 echo " <TD ALIGN=left WIDTH=\"30%\"><b>\n";
51 displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
52 echo " </b></TD><TD ALIGN=right WIDTH=\"70%\">\n";
53 echo " <div align=right>" . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B></div>\n";
54 echo " </TD>\n";
55 echo " </TR>\n";
56 echo "</TABLE>\n\n";
57 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
58 echo " <TR>\n";
59 echo " <TD ALIGN=left WIDTH=\"90%\">\n";
60 $urlMailbox = urlencode($mailbox);
61 displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
62 echo "&nbsp;&nbsp;\n";
63 displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
64 echo "&nbsp;&nbsp;\n";
65 displayInternalLink ("src/folders.php", _("Folders"), "right");
66 echo "&nbsp;&nbsp;\n";
67 displayInternalLink ("src/options.php", _("Options"), "right");
68 echo "&nbsp;&nbsp;\n";
69 displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
70 echo "&nbsp;&nbsp;\n";
71 displayInternalLink ("src/help.php", _("Help"), "right");
72 echo "&nbsp;&nbsp;\n";
73
74 do_hook("menuline");
75
76 echo " </TD><TD ALIGN=right nowrap WIDTH=\"10%\">\n";
77 echo " <A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n";
78 echo " </TD>\n";
79 echo " </TR>\n";
80 echo "</TABLE>\n\n";
81 }
82 ?>