Internationlization of print header
[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', $xtra = '', $do_hook = TRUE ) {
17
18 global $theme_css;
19
20 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' .
21 "\n\n<HTML>\n<HEAD>\n";
22
23 if ($theme_css != '') {
24 echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
25 }
26
27 if( $do_hook ) {
28 do_hook ("generic_header");
29 }
30
31 echo "<title>$title</title>$xtra</head>\n\n";
32
33 }
34
35 function displayInternalLink ($path, $text, $target='') {
36 global $base_uri;
37
38 if ($target != '')
39 $target = " target=\"$target\"";
40
41 echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
42 }
43
44 function displayPageHeader($color, $mailbox) {
45 global $delimiter, $hide_sm_attributions;
46 displayHtmlHeader ();
47
48 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";
49
50 /** Here is the header and wrapping table **/
51 $shortBoxName = readShortMailboxName($mailbox, $delimiter);
52 echo "<A NAME=pagetop></A>\n";
53 // echo "<table cellpadding=1 cellspacing=1 BGCOLOR=\"$color[4]\" width=100%><tr><td>";
54 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
55 echo " <TR BGCOLOR=\"$color[9]\" >\n";
56 echo " <TD ALIGN=left><b>\n";
57 displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
58 echo " </b></TD><TD ALIGN=right>\n";
59 echo ' ' . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B>\n";
60 echo " </TD>\n";
61 echo " </TR>\n";
62 echo " <TR BGCOLOR=\"$color[4]\">\n";
63 echo " <TD ALIGN=left>\n";
64 $urlMailbox = urlencode($mailbox);
65 displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
66 echo "&nbsp;&nbsp;\n";
67 displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
68 echo "&nbsp;&nbsp;\n";
69 displayInternalLink ("src/folders.php", _("Folders"), "right");
70 echo "&nbsp;&nbsp;\n";
71 displayInternalLink ("src/options.php", _("Options"), "right");
72 echo "&nbsp;&nbsp;\n";
73 displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
74 echo "&nbsp;&nbsp;\n";
75 displayInternalLink ("src/help.php", _("Help"), "right");
76 echo "&nbsp;&nbsp;\n";
77
78 do_hook("menuline");
79
80 echo " </TD><TD ALIGN=right>\n";
81 echo ($hide_sm_attributions ? '&nbsp;' :
82 "<A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n");
83 echo " </TD>\n";
84 echo " </TR>\n";
85 echo "</TABLE>\n\n";
86 // echo "</td></tr></table>";
87 }
88 ?>