page_header.php 3.4 KB

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