5 ** Prints the page header (duh)
10 if (defined('page_header_php'))
12 define('page_header_php', true);
14 include('../src/validate.php');
15 include("../functions/prefs.php");
16 include("../functions/plugin.php");
18 // Check to see if gettext is installed
19 $headers_sent=set_up_language(getPref($data_dir, $username, "language"));
21 // This is done to ensure that the character set is correct.
22 // But first checks whether we have already sent headers
23 // with charset when we were setting up the user language.
24 // Otherwise user ends up with the default charset overriding
26 if (!$headers_sent && $default_charset != "")
27 header ("Content-Type: text/html; charset=$default_charset");
29 function displayHtmlHeader ($title="SquirrelMail") {
32 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
36 if ($theme_css != "") {
37 printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">',
42 do_hook ("generic_header");
44 echo "<TITLE>$title</TITLE>\n";
48 function displayInternalLink ($path, $text, $target="") {
52 $target = " target=\"$target\"";
54 echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
57 function displayPageHeader($color, $mailbox) {
60 printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">',
61 $color[8], $color[4], $color[7], $color[7], $color[7]);
64 /** Here is the header and wrapping table **/
65 $shortBoxName = readShortMailboxName($mailbox, ".");
66 echo "<A NAME=pagetop></A>\n";
67 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
68 echo " <TR BGCOLOR=\"$color[9]\">\n";
69 echo " <TD ALIGN=left WIDTH=\"30%\"><b>\n";
70 displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
71 echo " </b></TD><TD ALIGN=right WIDTH=\"70%\">\n";
72 echo " <div align=right>" . _("Current Folder") . ": <B>$shortBoxName </B></div>\n";
76 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
78 echo " <TD ALIGN=left WIDTH=\"99%\">\n";
79 $urlMailbox = urlencode($mailbox);
80 displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
81 echo " \n";
82 displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
83 echo " \n";
84 displayInternalLink ("src/folders.php", _("Folders"), "right");
85 echo " \n";
86 displayInternalLink ("src/options.php", _("Options"), "right");
87 echo " \n";
88 displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
89 echo " \n";
90 displayInternalLink ("src/help.php", _("Help"), "right");
91 echo " \n";
95 echo " </TD><TD ALIGN=right nowrap WIDTH=\"1%\">\n";
96 echo " <A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n";