page_header.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. header ("Content-Type: text/html; charset=iso-8859-1");
  14. // Setting the language to use for gettext if it is not English
  15. // (the default language) or empty.
  16. $squirrelmail_language = getPref ($data_dir, $username, "language");
  17. if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
  18. putenv("LANG=$squirrelmail_language");
  19. bindtextdomain("squirrelmail", "../locale/");
  20. textdomain("squirrelmail");
  21. // Setting cookie to use on the login screen the next time the
  22. // same user logs in.
  23. setcookie("squirrelmail_language", $squirrelmail_language,
  24. time()+2592000);
  25. }
  26. function displayPageHeader($color, $mailbox) {
  27. /** Here is the header and wrapping table **/
  28. $shortBoxName = readShortMailboxName($mailbox, ".");
  29. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>";
  30. echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>";
  31. echo " <TD ALIGN=left WIDTH=30%>";
  32. echo " <A HREF=\"signout.php\" TARGET=_top><B>" . _("Sign Out") . "</B></A>";
  33. echo " </TD><TD ALIGN=right WIDTH=70%>";
  34. echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName&nbsp;</div></B>";
  35. echo " </TD>";
  36. echo " </TR></TABLE>\n";
  37. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>";
  38. echo " <TD ALIGN=left WIDTH=70%>";
  39. echo " <A HREF=\"compose.php\">" . _("Compose") . "</A>&nbsp&nbsp";
  40. echo " ". _("Addresses") ."&nbsp&nbsp";
  41. echo " <A HREF=\"folders.php\">" . _("Folders") . "</A>&nbsp&nbsp";
  42. echo " <A HREF=\"options.php\">" . _("Options") . "</A>&nbsp&nbsp";
  43. echo " </TD><TD ALIGN=right WIDTH=30%>";
  44. echo " <A HREF=\"http://squirrelmail.sourceforge.net\" TARGET=_top>SquirrelMail</A>";
  45. echo " </TD>";
  46. echo "</TABLE>";
  47. }
  48. ?>