page_header.php 2.6 KB

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