I neglected to make these two values globals.
[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") {
17 global $theme_css;
18
19 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
20 echo "\n\n";
21 echo "<HTML>\n";
22 echo "<HEAD>\n";
23 if ($theme_css != "") {
24 printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">',
25 $theme_css);
26 echo "\n";
27 }
28
29 do_hook ("generic_header");
30
31 echo "<TITLE>$title</TITLE>\n";
32 echo "</HEAD>\n\n";
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 displayHtmlHeader ();
46
47 printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">',
48 $color[8], $color[4], $color[7], $color[7], $color[7]);
49 echo "\n\n";
50
51 /** Here is the header and wrapping table **/
52 $shortBoxName = readShortMailboxName($mailbox, ".");
53 echo "<A NAME=pagetop></A>\n";
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 WIDTH=\"30%\"><b>\n";
57 displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
58 echo " </b></TD><TD ALIGN=right WIDTH=\"70%\">\n";
59 echo " <div align=right>" . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B></div>\n";
60 echo " </TD>\n";
61 echo " </TR>\n";
62 echo "</TABLE>\n\n";
63 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
64 echo " <TR>\n";
65 echo " <TD ALIGN=left WIDTH=\"90%\">\n";
66 $urlMailbox = urlencode($mailbox);
67 displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
68 echo "&nbsp;&nbsp;\n";
69 displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
70 echo "&nbsp;&nbsp;\n";
71 displayInternalLink ("src/folders.php", _("Folders"), "right");
72 echo "&nbsp;&nbsp;\n";
73 displayInternalLink ("src/options.php", _("Options"), "right");
74 echo "&nbsp;&nbsp;\n";
75 displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
76 echo "&nbsp;&nbsp;\n";
77 displayInternalLink ("src/help.php", _("Help"), "right");
78 echo "&nbsp;&nbsp;\n";
79
80 do_hook("menuline");
81
82 echo " </TD><TD ALIGN=right nowrap WIDTH=\"10%\">\n";
83 echo " <A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n";
84 echo " </TD>\n";
85 echo " </TR>\n";
86 echo "</TABLE>\n\n";
87 }
88 ?>