page_header.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. "\n\n<HTML>\n<HEAD>\n";
  17. if ($theme_css != '') {
  18. echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
  19. }
  20. do_hook ("generic_header");
  21. echo "<TITLE>$title</TITLE>\n";
  22. echo "</HEAD>\n\n";
  23. }
  24. function displayInternalLink ($path, $text, $target='') {
  25. global $base_uri;
  26. if ($target != '')
  27. $target = " target=\"$target\"";
  28. echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
  29. }
  30. function displayPageHeader($color, $mailbox) {
  31. displayHtmlHeader ();
  32. echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\" onLoad='if ( 0 in document.forms && document.forms[0].elements[0].type == \"text\" ) { document.forms[0].elements[0].focus(); }'>\n\n";
  33. /** Here is the header and wrapping table **/
  34. $shortBoxName = readShortMailboxName($mailbox, ".");
  35. echo "<A NAME=pagetop></A>\n";
  36. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
  37. echo " <TR BGCOLOR=\"$color[9]\">\n";
  38. echo " <TD ALIGN=left WIDTH=\"30%\"><b>\n";
  39. displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
  40. echo " </b></TD><TD ALIGN=right WIDTH=\"70%\">\n";
  41. echo " <div align=right>" . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B></div>\n";
  42. echo " </TD>\n";
  43. echo " </TR>\n";
  44. echo "</TABLE>\n\n";
  45. echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
  46. echo " <TR>\n";
  47. echo " <TD ALIGN=left WIDTH=\"90%\">\n";
  48. $urlMailbox = urlencode($mailbox);
  49. displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
  50. echo "&nbsp;&nbsp;\n";
  51. displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
  52. echo "&nbsp;&nbsp;\n";
  53. displayInternalLink ("src/folders.php", _("Folders"), "right");
  54. echo "&nbsp;&nbsp;\n";
  55. displayInternalLink ("src/options.php", _("Options"), "right");
  56. echo "&nbsp;&nbsp;\n";
  57. displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
  58. echo "&nbsp;&nbsp;\n";
  59. displayInternalLink ("src/help.php", _("Help"), "right");
  60. echo "&nbsp;&nbsp;\n";
  61. do_hook("menuline");
  62. echo " </TD><TD ALIGN=right nowrap WIDTH=\"10%\">\n";
  63. echo " <A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n";
  64. echo " </TD>\n";
  65. echo " </TR>\n";
  66. echo "</TABLE>\n\n";
  67. }
  68. ?>