page_header.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * page_header.php
  4. *
  5. * Copyright (c) 1999-2001 The Squirrelmail Development Team
  6. * Licensed under the GNU GPL. For full terms see the file COPYING.
  7. *
  8. * Prints the page header (duh)
  9. *
  10. * $Id$
  11. */
  12. // Always set up the language before calling these functions
  13. function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
  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. if( $do_hook ) {
  21. do_hook ("generic_header");
  22. }
  23. echo "<title>$title</title>$xtra</head>\n\n";
  24. }
  25. function displayInternalLink ($path, $text, $target='') {
  26. global $base_uri;
  27. if ($target != '')
  28. $target = " target=\"$target\"";
  29. echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
  30. }
  31. function displayPageHeader($color, $mailbox) {
  32. global $delimiter, $hide_sm_attributions;
  33. displayHtmlHeader ();
  34. 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";
  35. /** Here is the header and wrapping table **/
  36. $shortBoxName = readShortMailboxName($mailbox, $delimiter);
  37. echo "<A NAME=pagetop></A>\n".
  38. "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n".
  39. " <TR BGCOLOR=\"$color[9]\" >\n".
  40. " <TD ALIGN=left><b>\n";
  41. displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
  42. echo " </b></TD><TD ALIGN=right>\n".
  43. ' ' . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B>\n".
  44. " </TD>\n".
  45. " </TR>\n".
  46. " <TR BGCOLOR=\"$color[4]\">\n".
  47. " <TD ALIGN=left>\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>\n";
  63. echo ($hide_sm_attributions ? '&nbsp;' :
  64. "<A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n");
  65. echo " </TD>\n".
  66. " </TR>\n".
  67. "</TABLE>\n\n";
  68. // echo "</td></tr></table>";
  69. }
  70. ?>