6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * Prints the page header (duh)
14 require_once('../functions/strings.php');
16 // Always set up the language before calling these functions
17 function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
19 global $theme_css, $custom_css, $base_uri;
21 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' .
22 "\n\n<HTML>\n<HEAD>\n";
24 if ( !isset( $custom_css ) ||
$custom_css == 'none' ) {
25 if ($theme_css != '') {
26 echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
29 echo '<LINK REL="stylesheet" TYPE="text/css" HREF="' .
30 $base_uri . "themes/css/$custom_css\">\n";
34 do_hook ("generic_header");
37 echo "<title>$title</title>$xtra</head>\n\n";
40 function displayInternalLink($path, $text, $target='') {
44 $target = " target=\"$target\"";
47 echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
50 function displayPageHeader($color, $mailbox) {
52 global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF;
56 $module = substr( $PHP_SELF, ( strlen( $PHP_SELF ) - strlen( $base_uri ) ) * -1 );
59 Locate the first displayable form element
62 case 'src/search.php':
63 $pos = getPref($data_dir, $username, 'search_pos', 0 ) - 1;
64 $onload = "onLoad=\"document.forms[$pos].elements[2].focus();\"";
68 <script language="JavaScript">
70 function checkForm() {
72 var f = document.forms.length;
75 while( pos == -1 && i < f ) {
76 var e = document.forms[i].elements.length;
78 while( pos == -1 && j < e ) {
79 if ( document.forms[i].elements[j].type == \'text\' ) {
87 document.forms[i-1].elements[pos].focus();
94 $onload = "onLoad=\"checkForm();\"";
99 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\" $onload>\n\n";
101 /** Here is the header and wrapping table **/
102 $shortBoxName = readShortMailboxName($mailbox, $delimiter);
103 echo "<A NAME=pagetop></A>\n"
104 . "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n"
105 . " <TR BGCOLOR=\"$color[9]\" >\n"
106 . " <TD ALIGN=left>\n";
107 if ( $shortBoxName <> '' && strtolower( $shortBoxName ) <> 'none' ) {
108 echo ' ' . _("Current Folder") . ": <B>$shortBoxName </B>\n";
113 . " <TD ALIGN=right><b>\n";
114 displayInternalLink ('src/signout.php', _("Sign Out"), '_top');
117 . " <TR BGCOLOR=\"$color[4]\">\n"
118 . " <TD ALIGN=left>\n";
119 $urlMailbox = urlencode($mailbox);
120 displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), 'right');
121 echo " \n";
122 displayInternalLink ("src/addressbook.php", _("Addresses"), 'right');
123 echo " \n";
124 displayInternalLink ("src/folders.php", _("Folders"), 'right');
125 echo " \n";
126 displayInternalLink ("src/options.php", _("Options"), 'right');
127 echo " \n";
128 displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), 'right');
129 echo " \n";
130 displayInternalLink ("src/help.php", _("Help"), 'right');
131 echo " \n";
135 echo " </TD><TD ALIGN=right>\n";
136 echo ($hide_sm_attributions ?
' ' :
137 "<A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n");