page_header.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?
  2. /**
  3. ** page_header.php
  4. **
  5. ** Prints the page header (duh)
  6. **
  7. **/
  8. $page_header_php = true;
  9. if (!isset($prefs_php))
  10. include ("../functions/prefs.php");
  11. // This is done to ensure that the character set is correct when
  12. // receiving input from HTTP forms
  13. if ($default_charset != "")
  14. header ("Content-Type: text/html; charset=$default_charset");
  15. // Check to see if gettext is installed
  16. if (function_exists("_")) {
  17. // Setting the language to use for gettext if it is not English
  18. // (the default language) or empty.
  19. $squirrelmail_language = getPref ($data_dir, $username, "language");
  20. if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
  21. putenv("LANG=$squirrelmail_language");
  22. bindtextdomain("squirrelmail", "../locale/");
  23. textdomain("squirrelmail");
  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. function displayPageHeader($color, $mailbox) {
  35. /** Here is the header and wrapping table **/
  36. $shortBoxName = readShortMailboxName($mailbox, ".");
  37. $shortBoxName = stripslashes($shortBoxName);
  38. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>";
  39. echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>";
  40. echo " <TD ALIGN=left WIDTH=30%>";
  41. echo " <A HREF=\"signout.php\" TARGET=_top><B>" . _("Sign Out") . "</B></A>";
  42. echo " </TD><TD ALIGN=right WIDTH=70%>";
  43. echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName&nbsp;</div></B>";
  44. echo " </TD>";
  45. echo " </TR></TABLE>\n";
  46. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>";
  47. echo " <TD ALIGN=left WIDTH=70%>";
  48. echo " <A HREF=\"compose.php\">" . _("Compose") . "</A>&nbsp&nbsp";
  49. echo " ". _("Addresses") ."&nbsp&nbsp";
  50. echo " <A HREF=\"folders.php\">" . _("Folders") . "</A>&nbsp&nbsp";
  51. echo " <A HREF=\"options.php\">" . _("Options") . "</A>&nbsp&nbsp";
  52. echo " </TD><TD ALIGN=right WIDTH=30%>";
  53. echo " <A HREF=\"http://squirrelmail.sourceforge.net\" TARGET=_top>SquirrelMail</A>";
  54. echo " </TD>";
  55. echo "</TABLE>";
  56. }
  57. ?>