page_header.php 3.5 KB

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