page_header.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. /*****************************************************************/
  13. /*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/
  14. /*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/
  15. /*** + Base level indent should begin at left margin, as ***/
  16. /*** the first line of the function definition below. ***/
  17. /*** + All identation should consist of four space blocks ***/
  18. /*** + Tab characters are evil. ***/
  19. /*** + all comments should use "slash-star ... star-slash" ***/
  20. /*** style -- no pound characters, no slash-slash style ***/
  21. /*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/
  22. /*** ALWAYS USE { AND } CHARACTERS!!! ***/
  23. /*** + Please use ' instead of ", when possible. Note " ***/
  24. /*** should always be used in _( ) function calls. ***/
  25. /*** Thank you for your help making the SM code more readable. ***/
  26. /*****************************************************************/
  27. // Always set up the language before calling these functions
  28. function displayHtmlHeader
  29. ($title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
  30. global $theme_css;
  31. echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' .
  32. "\n\n<HTML>\n<HEAD>\n";
  33. if ($theme_css != '') {
  34. echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
  35. }
  36. if( $do_hook ) {
  37. do_hook ("generic_header");
  38. }
  39. echo "<title>$title</title>$xtra</head>\n\n";
  40. }
  41. function displayInternalLink ($path, $text, $target='') {
  42. global $base_uri;
  43. if ($target != '')
  44. $target = " target=\"$target\"";
  45. echo '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
  46. }
  47. function displayPageHeader($color, $mailbox) {
  48. global $delimiter, $hide_sm_attributions;
  49. displayHtmlHeader ();
  50. 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";
  51. /** Here is the header and wrapping table **/
  52. $shortBoxName = readShortMailboxName($mailbox, $delimiter);
  53. echo "<A NAME=pagetop></A>\n".
  54. "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n".
  55. " <TR BGCOLOR=\"$color[9]\" >\n".
  56. " <TD ALIGN=left><b>\n";
  57. displayInternalLink ("src/signout.php", _("Sign Out"), "_top");
  58. echo " </b></TD><TD ALIGN=right>\n".
  59. ' ' . _("Current Folder") . ": <B>$shortBoxName&nbsp;</B>\n".
  60. " </TD>\n".
  61. " </TR>\n".
  62. " <TR BGCOLOR=\"$color[4]\">\n".
  63. " <TD ALIGN=left>\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>\n";
  79. echo ($hide_sm_attributions ? '&nbsp;' :
  80. "<A HREF=\"http://www.squirrelmail.org/\" TARGET=\"_blank\">SquirrelMail</A>\n");
  81. echo " </TD>\n".
  82. " </TR>\n".
  83. "</TABLE>\n\n";
  84. // echo "</td></tr></table>";
  85. }
  86. ?>