| 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 | |
| 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 != "") { |
| 24 | putenv("LC_ALL=$squirrelmail_language"); |
| 25 | bindtextdomain("squirrelmail", "../locale/"); |
| 26 | textdomain("squirrelmail"); |
| 27 | $default_charset = $languages[$squirrelmail_language]["CHARSET"]; |
| 28 | |
| 29 | // Setting cookie to use on the login screen the next time the |
| 30 | // same user logs in. |
| 31 | #setcookie("squirrelmail_language", $squirrelmail_language, |
| 32 | # time()+2592000); |
| 33 | $squirrelmail_language = $language; |
| 34 | } |
| 35 | } else { |
| 36 | function _($string) { |
| 37 | return $string; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | // This is done to ensure that the character set is correct. |
| 42 | if ($default_charset != "") |
| 43 | header ("Content-Type: text/html; charset=$default_charset"); |
| 44 | |
| 45 | function displayHtmlHeader ($title="SquirrelMail") { |
| 46 | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'; |
| 47 | echo "\n\n"; |
| 48 | echo "<HTML>\n"; |
| 49 | echo "<HEAD>\n"; |
| 50 | echo "<TITLE>$title</TITLE>"; |
| 51 | echo "</HEAD>\n\n"; |
| 52 | } |
| 53 | |
| 54 | function displayPageHeader($color, $mailbox) { |
| 55 | displayHtmlHeader ($color); |
| 56 | |
| 57 | printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">', |
| 58 | $color[8], $color[4], $color[7], $color[7], $color[7]); |
| 59 | |
| 60 | /** Here is the header and wrapping table **/ |
| 61 | $shortBoxName = readShortMailboxName($mailbox, "."); |
| 62 | $shortBoxName = stripslashes($shortBoxName); |
| 63 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>"; |
| 64 | echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>"; |
| 65 | echo " <TD ALIGN=left WIDTH=30%>"; |
| 66 | echo " <A HREF=\"signout.php\" TARGET=_top><B>" . _("Sign Out") . "</B></A>"; |
| 67 | echo " </TD><TD ALIGN=right WIDTH=70%>"; |
| 68 | echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName </div></B>"; |
| 69 | echo " </TD>"; |
| 70 | echo " </TR></TABLE>\n"; |
| 71 | echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>"; |
| 72 | echo " <TD ALIGN=left WIDTH=70%>"; |
| 73 | $urlMailbox = $mailbox; |
| 74 | echo " <A HREF=\"compose.php?mailbox=$urlMailbox\">" . _("Compose") . "</A> "; |
| 75 | echo " <A HREF=\"addressbook.php\">" . _("Addresses") . "</A> "; |
| 76 | echo " <A HREF=\"folders.php\">" . _("Folders") . "</A> "; |
| 77 | echo " <A HREF=\"options.php\">" . _("Options") . "</A> "; |
| 78 | echo " </TD><TD ALIGN=right WIDTH=30%>"; |
| 79 | echo " <A HREF=\"http://squirrelmail.sourceforge.net/index.php3?from=1\" TARGET=_top>SquirrelMail</A>"; |
| 80 | echo " </TD>"; |
| 81 | echo "</TABLE>"; |
| 82 | } |
| 83 | ?> |