page_header.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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("LC_ALL=$squirrelmail_language");
  21. bindtextdomain("squirrelmail", "../locale/");
  22. textdomain("squirrelmail");
  23. $default_charset = $languages[$squirrelmail_language]["CHARSET"];
  24. }
  25. } else {
  26. function _($string) {
  27. return $string;
  28. }
  29. }
  30. // This is done to ensure that the character set is correct.
  31. if ($default_charset != "")
  32. header ("Content-Type: text/html; charset=$default_charset");
  33. function displayHtmlHeader ($title="SquirrelMail") {
  34. global $theme_css;
  35. echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
  36. echo "\n\n";
  37. echo "<HTML>\n";
  38. echo "<HEAD>\n";
  39. if ($theme_css != "") {
  40. printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">',
  41. $theme_css);
  42. echo "\n";
  43. }
  44. echo "<TITLE>$title</TITLE>";
  45. echo "</HEAD>\n\n";
  46. }
  47. function displayPageHeader($color, $mailbox) {
  48. displayHtmlHeader ($color);
  49. printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">',
  50. $color[8], $color[4], $color[7], $color[7], $color[7]);
  51. echo "\n\n";
  52. /** Here is the header and wrapping table **/
  53. $shortBoxName = readShortMailboxName($mailbox, ".");
  54. $shortBoxName = stripslashes($shortBoxName);
  55. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
  56. echo " <TR BGCOLOR=\"$color[9]\">\n";
  57. echo " <TD ALIGN=left WIDTH=\"30%\">\n";
  58. echo " <A HREF=\"signout.php\" TARGET=\"_top\"><B>" . _("Sign Out") . "</B></A>\n";
  59. echo " </TD><TD ALIGN=right WIDTH=\"70%\">\n";
  60. echo " <div align=right>" . _("Current Folder: ") . "<B>$shortBoxName&nbsp;</B></div>\n";
  61. echo " </TD>\n";
  62. echo " </TR>\n";
  63. echo "</TABLE>\n\n";
  64. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
  65. echo " <TR>\n";
  66. echo " <TD ALIGN=left WIDTH=\"70%\">\n";
  67. $urlMailbox = $mailbox;
  68. echo " <A HREF=\"compose.php?mailbox=$urlMailbox\">" . _("Compose") . "</A>&nbsp;&nbsp;\n";
  69. echo " <A HREF=\"addressbook.php\">" . _("Addresses") . "</A>&nbsp;&nbsp;\n";
  70. echo " <A HREF=\"folders.php\">" . _("Folders") . "</A>&nbsp;&nbsp;\n";
  71. echo " <A HREF=\"options.php\">" . _("Options") . "</A>&nbsp;&nbsp;\n";
  72. echo " <A HREF=\"webmail.php?right_frame=help.php\" TARGET=\"Help Me!\">" . _("Help") . "</A>&nbsp&nbsp";
  73. echo " </TD><TD ALIGN=right WIDTH=\"30%\">\n";
  74. echo " <A HREF=\"http://squirrelmail.sourceforge.net/index.php3?from=1\" TARGET=\"_top\">SquirrelMail</A>\n";
  75. echo " </TD>\n";
  76. echo " </TR>\n";
  77. echo "</TABLE>\n\n";
  78. }
  79. ?>