page_header.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  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. $squirrelmail_language = $language;
  29. }
  30. } else {
  31. function _($string) {
  32. return $string;
  33. }
  34. }
  35. // This is done to ensure that the character set is correct.
  36. if ($default_charset != "")
  37. header ("Content-Type: text/html; charset=$default_charset");
  38. function displayPageHeader($color, $mailbox) {
  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\" 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\">" . _("Compose") . "</A>&nbsp&nbsp";
  53. echo " <A HREF=\"addressbook.php\">" . _("Addresses") . "</A>&nbsp&nbsp";
  54. echo " <A HREF=\"folders.php\">" . _("Folders") . "</A>&nbsp&nbsp";
  55. echo " <A HREF=\"options.php\">" . _("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. ?>