setup.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. $squirrelmail_plugin_hooks['read_body_header_right']['message_details'] = 'show_message_details';
  20. }
  21. function show_message_details() {
  22. global $passed_id, $mailbox, $ent_num, $color,
  23. $javascript_on;
  24. if (strlen(trim($mailbox)) < 1) {
  25. $mailbox = 'INBOX';
  26. }
  27. $params = '?passed_ent_id=' . $ent_num .
  28. '&mailbox=' . urlencode($mailbox) .
  29. '&passed_id=' . $passed_id;
  30. $print_text = _("View Message details");
  31. $result = '';
  32. /* Output the link. */
  33. if ($javascript_on) {
  34. $result = '<script type="text/javascript" language="javascript">' . "\n" .
  35. '<!--' . "\n" .
  36. " function MessageSource() {\n" .
  37. ' window.open("../plugins/message_details/message_details_main.php' .
  38. $params . '","MessageDetails","width=800,height=600");' . "\n".
  39. " }\n" .
  40. "// -->\n" .
  41. "</script>\n" .
  42. "&nbsp;|&nbsp;<A HREF=\"javascript:MessageSource();\">$print_text</A>\n";
  43. }
  44. echo $result;
  45. }
  46. ?>