setup.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /** Message Source
  3. *
  4. * Plugin to view the RFC822 raw message output and the bodystructure of a message
  5. *
  6. * Copyright (c) 2002 Marc Groot Koerkamp, The Netherlands
  7. * Licensed under the GNU GPL. For full terms see the file COPYING.
  8. *
  9. * $Id$
  10. * @package plugins
  11. * @subpackage message_details
  12. **/
  13. /**
  14. * Initialize the plugin
  15. */
  16. function squirrelmail_plugin_init_message_details()
  17. {
  18. global $squirrelmail_plugin_hooks;
  19. do_hook('read_body_header_right');
  20. $squirrelmail_plugin_hooks['read_body_header_right']['message_details'] = 'show_message_details';
  21. }
  22. function show_message_details() {
  23. global $passed_id, $mailbox, $ent_num, $color,
  24. $javascript_on;
  25. if (strlen(trim($mailbox)) < 1) {
  26. $mailbox = 'INBOX';
  27. }
  28. $params = '?passed_ent_id=' . $ent_num .
  29. '&mailbox=' . urlencode($mailbox) .
  30. '&passed_id=' . $passed_id;
  31. $print_text = _("View Message details");
  32. $result = '';
  33. /* Output the link. */
  34. if ($javascript_on) {
  35. $result = '<script type="text/javascript" language="javascript">' . "\n" .
  36. '<!--' . "\n" .
  37. " function MessageSource() {\n" .
  38. ' window.open("../plugins/message_details/message_details_main.php' .
  39. $params . '","MessageDetails","width=800,height=600");' . "\n".
  40. " }\n" .
  41. "// -->\n" .
  42. "</script>\n" .
  43. "&nbsp;|&nbsp;<A HREF=\"javascript:MessageSource();\">$print_text</A>\n";
  44. }
  45. echo $result;
  46. }
  47. ?>