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