Fixed parsing of ',', '.', and EOL
[squirrelmail.git] / functions / page_header.php
CommitLineData
59177427 1<?php
3302d0d4 2 /**
a09387f4 3 ** page_header.php
3302d0d4 4 **
2ba13803 5 ** Copyright (c) 1999-2001 The Squirrelmail Development Team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
7 **
3302d0d4 8 ** Prints the page header (duh)
9 **
245a6892 10 ** $Id$
3302d0d4 11 **/
12
1026ec43 13 // Always set up the language before calling these functions
e8816411 14
692155b7 15 function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
16
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
22 if ($theme_css != '') {
23 echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
24 }
25
26 if( $do_hook ) {
27 do_hook ("generic_header");
28 }
29
30 echo "<title>$title</title>$xtra</head>\n\n";
7b086a80 31
2a833d72 32 }
33
3e96355c 34 function displayInternalLink ($path, $text, $target='') {
5bbe20e4 35 global $base_uri;
36
3e96355c 37 if ($target != '')
5bbe20e4 38 $target = " target=\"$target\"";
6dc0e464 39
5bbe20e4 40 echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
41 }
42
f8f9bed9 43 function displayPageHeader($color, $mailbox) {
826b7f71 44 global $delimiter, $hide_sm_attributions;
67a42d95 45 displayHtmlHeader ();
2a833d72 46
943292e4 47 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 48
3302d0d4 49 /** Here is the header and wrapping table **/
e0dcff78 50 $shortBoxName = readShortMailboxName($mailbox, $delimiter);
2ba13803 51 echo "<A NAME=pagetop></A>\n".
2ba13803 52 "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n".
53 " <TR BGCOLOR=\"$color[9]\" >\n".
54 " <TD ALIGN=left><b>\n";
5bbe20e4 55 displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
2ba13803 56 echo " </b></TD><TD ALIGN=right>\n".
57 ' ' . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B>\n".
58 " </TD>\n".
59 " </TR>\n".
60 " <TR BGCOLOR=\"$color[4]\">\n".
61 " <TD ALIGN=left>\n";
d76f6440 62 $urlMailbox = urlencode($mailbox);
5bbe20e4 63 displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
64 echo "&nbsp;&nbsp;\n";
65 displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
66 echo "&nbsp;&nbsp;\n";
67 displayInternalLink ("src/folders.php", _("Folders"), "right");
68 echo "&nbsp;&nbsp;\n";
69 displayInternalLink ("src/options.php", _("Options"), "right");
70 echo "&nbsp;&nbsp;\n";
8d455c73 71 displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
72 echo "&nbsp;&nbsp;\n";
d68a3926 73 displayInternalLink ("src/help.php", _("Help"), "right");
5bbe20e4 74 echo "&nbsp;&nbsp;\n";
7b086a80 75
76 do_hook("menuline");
77
a1e1aff3 78 echo " </TD><TD ALIGN=right>\n";
826b7f71 79 echo ($hide_sm_attributions ? '&nbsp;' :
80 "<A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n");
2ba13803 81 echo " </TD>\n".
82 " </TR>\n".
83 "</TABLE>\n\n";
a5d53045 84 // echo "</td></tr></table>";
3302d0d4 85 }
2ba13803 86
87?>