Reworked paginator code, everyone try it out.
[squirrelmail.git] / functions / page_header.php
CommitLineData
59177427 1<?php
7350889b 2
35586184 3/**
4 * page_header.php
5 *
6 * Copyright (c) 1999-2001 The Squirrelmail Development Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * Prints the page header (duh)
10 *
11 * $Id$
12 */
13
14/*****************************************************************/
15/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/
16/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/
17/*** + Base level indent should begin at left margin, as ***/
18/*** the first line of the function definition below. ***/
19/*** + All identation should consist of four space blocks ***/
20/*** + Tab characters are evil. ***/
21/*** + all comments should use "slash-star ... star-slash" ***/
22/*** style -- no pound characters, no slash-slash style ***/
23/*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/
24/*** ALWAYS USE { AND } CHARACTERS!!! ***/
25/*** + Please use ' instead of ", when possible. Note " ***/
26/*** should always be used in _( ) function calls. ***/
27/*** Thank you for your help making the SM code more readable. ***/
28/*****************************************************************/
29
30// Always set up the language before calling these functions
31function displayHtmlHeader
32 ($title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
692155b7 33
34 global $theme_css;
35
36 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' .
37 "\n\n<HTML>\n<HEAD>\n";
38
39 if ($theme_css != '') {
40 echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
41 }
42
43 if( $do_hook ) {
44 do_hook ("generic_header");
45 }
46
47 echo "<title>$title</title>$xtra</head>\n\n";
7b086a80 48
2a833d72 49 }
50
3e96355c 51 function displayInternalLink ($path, $text, $target='') {
5bbe20e4 52 global $base_uri;
53
3e96355c 54 if ($target != '')
5bbe20e4 55 $target = " target=\"$target\"";
6dc0e464 56
5bbe20e4 57 echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
58 }
59
f8f9bed9 60 function displayPageHeader($color, $mailbox) {
826b7f71 61 global $delimiter, $hide_sm_attributions;
67a42d95 62 displayHtmlHeader ();
2a833d72 63
943292e4 64 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 65
3302d0d4 66 /** Here is the header and wrapping table **/
e0dcff78 67 $shortBoxName = readShortMailboxName($mailbox, $delimiter);
2ba13803 68 echo "<A NAME=pagetop></A>\n".
2ba13803 69 "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n".
70 " <TR BGCOLOR=\"$color[9]\" >\n".
71 " <TD ALIGN=left><b>\n";
5bbe20e4 72 displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
2ba13803 73 echo " </b></TD><TD ALIGN=right>\n".
74 ' ' . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B>\n".
75 " </TD>\n".
76 " </TR>\n".
77 " <TR BGCOLOR=\"$color[4]\">\n".
78 " <TD ALIGN=left>\n";
d76f6440 79 $urlMailbox = urlencode($mailbox);
5bbe20e4 80 displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
81 echo "&nbsp;&nbsp;\n";
82 displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
83 echo "&nbsp;&nbsp;\n";
84 displayInternalLink ("src/folders.php", _("Folders"), "right");
85 echo "&nbsp;&nbsp;\n";
86 displayInternalLink ("src/options.php", _("Options"), "right");
87 echo "&nbsp;&nbsp;\n";
8d455c73 88 displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
89 echo "&nbsp;&nbsp;\n";
d68a3926 90 displayInternalLink ("src/help.php", _("Help"), "right");
5bbe20e4 91 echo "&nbsp;&nbsp;\n";
7b086a80 92
93 do_hook("menuline");
94
a1e1aff3 95 echo " </TD><TD ALIGN=right>\n";
826b7f71 96 echo ($hide_sm_attributions ? '&nbsp;' :
97 "<A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n");
2ba13803 98 echo " </TD>\n".
99 " </TR>\n".
100 "</TABLE>\n\n";
a5d53045 101 // echo "</td></tr></table>";
3302d0d4 102 }
2ba13803 103
35586184 104?>