page_header.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. ** page_header.php
  4. **
  5. ** Prints the page header (duh)
  6. **
  7. ** $Id$
  8. **/
  9. if (defined('page_header_php'))
  10. return;
  11. define('page_header_php', true);
  12. // Always set up the language before calling these functions
  13. function displayHtmlHeader ($title="SquirrelMail") {
  14. global $theme_css;
  15. echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
  16. echo "\n\n";
  17. echo "<HTML>\n";
  18. echo "<HEAD>\n";
  19. if ($theme_css != "") {
  20. printf ('<LINK REL="stylesheet" TYPE="text/css" HREF="%s">',
  21. $theme_css);
  22. echo "\n";
  23. }
  24. do_hook ("generic_header");
  25. echo "<TITLE>$title</TITLE>\n";
  26. echo "</HEAD>\n\n";
  27. }
  28. function displayInternalLink ($path, $text, $target="") {
  29. global $base_uri;
  30. if ($target != "")
  31. $target = " target=\"$target\"";
  32. echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
  33. }
  34. function displayPageHeader($color, $mailbox) {
  35. displayHtmlHeader ();
  36. printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">',
  37. $color[8], $color[4], $color[7], $color[7], $color[7]);
  38. echo "\n\n";
  39. /** Here is the header and wrapping table **/
  40. $shortBoxName = readShortMailboxName($mailbox, ".");
  41. echo "<A NAME=pagetop></A>\n";
  42. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
  43. echo " <TR BGCOLOR=\"$color[9]\">\n";
  44. echo " <TD ALIGN=left WIDTH=\"30%\"><b>\n";
  45. displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
  46. echo " </b></TD><TD ALIGN=right WIDTH=\"70%\">\n";
  47. echo " <div align=right>" . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B></div>\n";
  48. echo " </TD>\n";
  49. echo " </TR>\n";
  50. echo "</TABLE>\n\n";
  51. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
  52. echo " <TR>\n";
  53. echo " <TD ALIGN=left WIDTH=\"90%\">\n";
  54. $urlMailbox = urlencode($mailbox);
  55. displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
  56. echo "&nbsp;&nbsp;\n";
  57. displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
  58. echo "&nbsp;&nbsp;\n";
  59. displayInternalLink ("src/folders.php", _("Folders"), "right");
  60. echo "&nbsp;&nbsp;\n";
  61. displayInternalLink ("src/options.php", _("Options"), "right");
  62. echo "&nbsp;&nbsp;\n";
  63. displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
  64. echo "&nbsp;&nbsp;\n";
  65. displayInternalLink ("src/help.php", _("Help"), "right");
  66. echo "&nbsp;&nbsp;\n";
  67. do_hook("menuline");
  68. echo " </TD><TD ALIGN=right nowrap WIDTH=\"10%\">\n";
  69. echo " <A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n";
  70. echo " </TD>\n";
  71. echo " </TR>\n";
  72. echo "</TABLE>\n\n";
  73. }
  74. ?>