Added missing ; in HTML-code.
[squirrelmail.git] / functions / page_header.php
1 <?php
2 /**
3 ** page_header.php
4 **
5 ** Prints the page header (duh)
6 **
7 **/
8
9 session_start();
10
11 $page_header_php = true;
12
13 if (!isset($prefs_php))
14 include ("../functions/prefs.php");
15 if (!isset($i18n_php))
16 include ("../functions/i18n.php");
17 if (!isset($plugin_php))
18 include ("../functions/plugin.php");
19
20 // Check to see if gettext is installed
21 if (function_exists("_")) {
22 // Setting the language to use for gettext if it is not English
23 // (the default language) or empty.
24 $squirrelmail_language = getPref ($data_dir, $username, "language");
25 if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
26 putenv("LC_ALL=$squirrelmail_language");
27 bindtextdomain("squirrelmail", "../locale/");
28 textdomain("squirrelmail");
29 $default_charset = $languages[$squirrelmail_language]["CHARSET"];
30 }
31 } else {
32 function _($string) {
33 return $string;
34 }
35 }
36
37 // This is done to ensure that the character set is correct.
38 if ($default_charset != "")
39 header ("Content-Type: text/html; charset=$default_charset");
40
41 function displayHtmlHeader ($title="SquirrelMail") {
42 global $theme_css;
43
44 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
45 echo "\n\n";
46 echo "<HTML>\n";
47 echo "<HEAD>\n";
48 if ($theme_css != "") {
49 printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">',
50 $theme_css);
51 echo "\n";
52 }
53
54 do_hook ("generic_header");
55
56 echo "<TITLE>$title</TITLE>";
57 echo "</HEAD>\n\n";
58 }
59
60 function displayPageHeader($color, $mailbox) {
61 displayHtmlHeader ($color);
62
63 printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">',
64 $color[8], $color[4], $color[7], $color[7], $color[7]);
65 echo "\n\n";
66
67 /** Here is the header and wrapping table **/
68 $shortBoxName = readShortMailboxName($mailbox, ".");
69 $shortBoxName = stripslashes($shortBoxName);
70 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
71 echo " <TR BGCOLOR=\"$color[9]\">\n";
72 echo " <TD ALIGN=left WIDTH=\"30%\">\n";
73 echo " <A HREF=\"signout.php\" TARGET=\"_top\"><B>" . _("Sign Out") . "</B></A>\n";
74 echo " </TD><TD ALIGN=right WIDTH=\"70%\">\n";
75 echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName&nbsp;</B></div>\n";
76 echo " </TD>\n";
77 echo " </TR>\n";
78 echo "</TABLE>\n\n";
79 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
80 echo " <TR>\n";
81 echo " <TD ALIGN=left WIDTH=\"70%\">\n";
82 $urlMailbox = $mailbox;
83 echo " <A HREF=\"compose.php?mailbox=$urlMailbox\">" . _("Compose") . "</A>&nbsp;&nbsp;\n";
84 echo " <A HREF=\"addressbook.php\">" . _("Addresses") . "</A>&nbsp;&nbsp;\n";
85 echo " <A HREF=\"folders.php\">" . _("Folders") . "</A>&nbsp;&nbsp;\n";
86 echo " <A HREF=\"options.php\">" . _("Options") . "</A>&nbsp;&nbsp;\n";
87 echo " <A HREF=\"webmail.php?right_frame=help.php\" TARGET=\"Help Me!\">" . _("Help") . "</A>&nbsp;&nbsp;";
88
89 do_hook("menuline");
90
91 echo " </TD><TD ALIGN=right WIDTH=\"30%\">\n";
92 echo " <A HREF=\"http://squirrelmail.sourceforge.net/index.php3?from=1\" TARGET=\"_top\">SquirrelMail</A>\n";
93 echo " </TD>\n";
94 echo " </TR>\n";
95 echo "</TABLE>\n\n";
96 }
97 ?>