page_header.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?
  2. /**
  3. ** page_header.php
  4. **
  5. ** Prints the page header (duh)
  6. **
  7. **/
  8. session_start();
  9. $page_header_php = true;
  10. if (!isset($prefs_php))
  11. include ("../functions/prefs.php");
  12. if (!isset($i18n_php))
  13. include ("../functions/i18n.php");
  14. // Check to see if gettext is installed
  15. if (function_exists("_")) {
  16. // Setting the language to use for gettext if it is not English
  17. // (the default language) or empty.
  18. $squirrelmail_language = getPref ($data_dir, $username, "language");
  19. if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
  20. putenv("LANG=$squirrelmail_language");
  21. bindtextdomain("squirrelmail", "../locale/");
  22. textdomain("squirrelmail");
  23. $default_charset = $languages[$squirrelmail_language]["CHARSET"];
  24. // Setting cookie to use on the login screen the next time the
  25. // same user logs in.
  26. setcookie("squirrelmail_language", $squirrelmail_language,
  27. time()+2592000);
  28. }
  29. } else {
  30. function _($string) {
  31. return $string;
  32. }
  33. }
  34. // This is done to ensure that the character set is correct.
  35. if ($default_charset != "")
  36. header ("Content-Type: text/html; charset=$default_charset");
  37. function displayPageHeader($color, $mailbox) {
  38. global $PHPSESSID;
  39. /** Here is the header and wrapping table **/
  40. $shortBoxName = readShortMailboxName($mailbox, ".");
  41. $shortBoxName = stripslashes($shortBoxName);
  42. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>";
  43. echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>";
  44. echo " <TD ALIGN=left WIDTH=30%>";
  45. echo " <A HREF=\"signout.php?PHPSESSID=$PHPSESSID\" TARGET=_top><B>" . _("Sign Out") . "</B></A>";
  46. echo " </TD><TD ALIGN=right WIDTH=70%>";
  47. echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName&nbsp;</div></B>";
  48. echo " </TD>";
  49. echo " </TR></TABLE>\n";
  50. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>";
  51. echo " <TD ALIGN=left WIDTH=70%>";
  52. echo " <A HREF=\"compose.php?PHPSESSID=$PHPSESSID\">" . _("Compose") . "</A>&nbsp&nbsp";
  53. echo " <A HREF=\"addressbook.php?PHPSESSID=$PHPSESSID\">" . _("Addresses") . "</A>&nbsp&nbsp";
  54. echo " <A HREF=\"folders.php?PHPSESSID=$PHPSESSID\">" . _("Folders") . "</A>&nbsp&nbsp";
  55. echo " <A HREF=\"options.php?PHPSESSID=$PHPSESSID\">" . _("Options") . "</A>&nbsp&nbsp";
  56. echo " </TD><TD ALIGN=right WIDTH=30%>";
  57. echo " <A HREF=\"http://squirrelmail.sourceforge.net/index.php3?from=1\" TARGET=_top>SquirrelMail</A>";
  58. echo " </TD>";
  59. echo "</TABLE>";
  60. }
  61. ?>