page_header.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. set_up_language(getPref($data_dir, $username, "language"));
  18. // This is done to ensure that the character set is correct.
  19. if ($default_charset != "")
  20. header ("Content-Type: text/html; charset=$default_charset");
  21. function displayHtmlHeader ($title="SquirrelMail") {
  22. global $theme_css;
  23. echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
  24. echo "\n\n";
  25. echo "<HTML>\n";
  26. echo "<HEAD>\n";
  27. if ($theme_css != "") {
  28. printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">',
  29. $theme_css);
  30. echo "\n";
  31. }
  32. do_hook ("generic_header");
  33. echo "<TITLE>$title</TITLE>\n";
  34. echo "</HEAD>\n\n";
  35. }
  36. function displayInternalLink ($path, $text, $target="") {
  37. global $base_uri;
  38. if ($target != "")
  39. $target = " target=\"$target\"";
  40. echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
  41. }
  42. function displayPageHeader($color, $mailbox) {
  43. displayHtmlHeader ($color);
  44. printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">',
  45. $color[8], $color[4], $color[7], $color[7], $color[7]);
  46. echo "\n\n";
  47. /** Here is the header and wrapping table **/
  48. $shortBoxName = readShortMailboxName($mailbox, ".");
  49. $shortBoxName = sqStripSlashes($shortBoxName);
  50. echo "<A NAME=pagetop></A>\n";
  51. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
  52. echo " <TR BGCOLOR=\"$color[9]\">\n";
  53. echo " <TD ALIGN=left WIDTH=\"30%\"><b>\n";
  54. displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
  55. echo " </b></TD><TD ALIGN=right WIDTH=\"70%\">\n";
  56. echo " <div align=right>" . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B></div>\n";
  57. echo " </TD>\n";
  58. echo " </TR>\n";
  59. echo "</TABLE>\n\n";
  60. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
  61. echo " <TR>\n";
  62. echo " <TD ALIGN=left WIDTH=\"99%\">\n";
  63. $urlMailbox = urlencode($mailbox);
  64. displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
  65. echo "&nbsp;&nbsp;\n";
  66. displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
  67. echo "&nbsp;&nbsp;\n";
  68. displayInternalLink ("src/folders.php", _("Folders"), "right");
  69. echo "&nbsp;&nbsp;\n";
  70. displayInternalLink ("src/options.php", _("Options"), "right");
  71. echo "&nbsp;&nbsp;\n";
  72. displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
  73. echo "&nbsp;&nbsp;\n";
  74. displayInternalLink ("src/help.php", _("Help"), "right");
  75. echo "&nbsp;&nbsp;\n";
  76. do_hook("menuline");
  77. echo " </TD><TD ALIGN=right nowrap WIDTH=\"1%\">\n";
  78. echo " <A HREF=\"http://www.squirrelmail.org/index.php3?from=1\" TARGET=\"_top\">SquirrelMail</A>\n";
  79. echo " </TD>\n";
  80. echo " </TR>\n";
  81. echo "</TABLE>\n\n";
  82. }
  83. ?>