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