page_header.php 2.9 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 ( ( document.forms.length > 0 ) && ( 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 cellpadding=1 cellspacing=1 BGCOLOR=\"$color[9]\" width=100%><tr><td>";
  37. echo "<TABLE BGCOLOR=\"$color[9]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
  38. echo " <TR>\n";
  39. echo " <TD ALIGN=left><b>\n";
  40. displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
  41. echo " </b></TD><TD ALIGN=right>\n";
  42. echo ' ' . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B>\n";
  43. echo " </TD>\n";
  44. echo " </TR>\n";
  45. echo " <TR BGCOLOR=\"$color[4]\">\n";
  46. echo " <TD ALIGN=left>\n";
  47. $urlMailbox = urlencode($mailbox);
  48. displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
  49. echo "&nbsp;&nbsp;\n";
  50. displayInternalLink ("src/addressbook.php", _("Addresses"), "right");
  51. echo "&nbsp;&nbsp;\n";
  52. displayInternalLink ("src/folders.php", _("Folders"), "right");
  53. echo "&nbsp;&nbsp;\n";
  54. displayInternalLink ("src/options.php", _("Options"), "right");
  55. echo "&nbsp;&nbsp;\n";
  56. displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right");
  57. echo "&nbsp;&nbsp;\n";
  58. displayInternalLink ("src/help.php", _("Help"), "right");
  59. echo "&nbsp;&nbsp;\n";
  60. do_hook("menuline");
  61. echo " </TD><TD ALIGN=right>\n";
  62. echo " <A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n";
  63. echo " </TD>\n";
  64. echo " </TR>\n";
  65. echo "</TABLE>\n\n";
  66. echo "</td></tr></table>";
  67. }
  68. ?>