setup.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Message Details plugin - main setup script
  4. *
  5. * Plugin to view the RFC822 raw message output and the bodystructure of a message
  6. *
  7. * @author Marc Groot Koerkamp
  8. * @copyright 2002 Marc Groot Koerkamp, The Netherlands
  9. * @copyright 2002-2025 The SquirrelMail Project Team
  10. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  11. * @version $Id$
  12. * @package plugins
  13. * @subpackage message_details
  14. **/
  15. /**
  16. * Initialize the plugin
  17. * @access private
  18. */
  19. function squirrelmail_plugin_init_message_details()
  20. {
  21. global $squirrelmail_plugin_hooks;
  22. $squirrelmail_plugin_hooks['read_body_header_right']['message_details'] = 'show_message_details';
  23. }
  24. /**
  25. * Add message details link in message view
  26. * @access private
  27. */
  28. function show_message_details(&$links) {
  29. global $passed_id, $mailbox, $passed_ent_id;
  30. if (strlen(trim($mailbox)) < 1) {
  31. $mailbox = 'INBOX';
  32. }
  33. $params = '?passed_ent_id=' . $passed_ent_id .
  34. '&mailbox=' . urlencode($mailbox) .
  35. '&passed_id=' . $passed_id;
  36. $url = checkForJavascript() ? 'javascript:MessageSource();' :
  37. '../plugins/message_details/message_details_main.php' .
  38. $params;
  39. /* Output the link. */
  40. $links[] = array('URL' => $url,
  41. 'Text' => _("View Message Details") );
  42. if (checkForJavascript()) {
  43. echo '<script type="text/javascript">' . "\n"
  44. . '<!--' . "\n"
  45. . " function MessageSource() {\n"
  46. . ' window.open("'
  47. . sqm_baseuri()
  48. . 'plugins/message_details/message_details_main.php' .
  49. $params . '","MessageDetails","width=800,height=600");' . "\n"
  50. . " }\n"
  51. . "// -->\n"
  52. . "</script>\n\n";
  53. }
  54. }