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