Added (c) stuff and some formatting.
[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\"";
d68a3926 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".
52 // "<table cellpadding=1 cellspacing=1 BGCOLOR=\"$color[4]\" width=100%><tr><td>".
53 "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n".
54 " <TR BGCOLOR=\"$color[9]\" >\n".
55 " <TD ALIGN=left><b>\n";
5bbe20e4 56 displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
2ba13803 57 echo " </b></TD><TD ALIGN=right>\n".
58 ' ' . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B>\n".
59 " </TD>\n".
60 " </TR>\n".
61 " <TR BGCOLOR=\"$color[4]\">\n".
62 " <TD ALIGN=left>\n";
d76f6440 63 $urlMailbox = urlencode($mailbox);
5bbe20e4 64 displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
65 echo "&nbsp;&nbsp;\n";
66 displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
67 echo "&nbsp;&nbsp;\n";
68 displayInternalLink ("src/folders.php", _("Folders"), "right");
69 echo "&nbsp;&nbsp;\n";
70 displayInternalLink ("src/options.php", _("Options"), "right");
71 echo "&nbsp;&nbsp;\n";
8d455c73 72 displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
73 echo "&nbsp;&nbsp;\n";
d68a3926 74 displayInternalLink ("src/help.php", _("Help"), "right");
5bbe20e4 75 echo "&nbsp;&nbsp;\n";
7b086a80 76
77 do_hook("menuline");
78
a1e1aff3 79 echo " </TD><TD ALIGN=right>\n";
826b7f71 80 echo ($hide_sm_attributions ? '&nbsp;' :
81 "<A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n");
2ba13803 82 echo " </TD>\n".
83 " </TR>\n".
84 "</TABLE>\n\n";
a5d53045 85 // echo "</td></tr></table>";
3302d0d4 86 }
2ba13803 87
88?>