Remove unused globals
[squirrelmail.git] / plugins / message_details / setup.php
CommitLineData
bbdea028 1<?php
86c62251 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 Copyright &copy; 2002 Marc Groot Koerkamp, The Netherlands
9 * @copyright Copyright &copy; 2004 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 **/
bbdea028 15
ea5f4b8e 16/**
17 * Initialize the plugin
e9ec1bd8 18 * @access private
ea5f4b8e 19 */
bbdea028 20function squirrelmail_plugin_init_message_details()
21{
22 global $squirrelmail_plugin_hooks;
23
04f6008a 24 $squirrelmail_plugin_hooks['read_body_header_right']['message_details'] = 'show_message_details';
bbdea028 25}
26
86c62251 27/**
28 * Add message details link in message view
29 * @access private
30 */
bbdea028 31function show_message_details() {
ce68b76b 32 global $passed_id, $mailbox, $ent_num,
bbdea028 33 $javascript_on;
34
35 if (strlen(trim($mailbox)) < 1) {
36 $mailbox = 'INBOX';
37 }
38
39 $params = '?passed_ent_id=' . $ent_num .
40 '&mailbox=' . urlencode($mailbox) .
41 '&passed_id=' . $passed_id;
42
43 $print_text = _("View Message details");
44
bbdea028 45 $result = '';
46 /* Output the link. */
47 if ($javascript_on) {
04f6008a 48 $result = '<script type="text/javascript" language="javascript">' . "\n" .
bbdea028 49 '<!--' . "\n" .
50 " function MessageSource() {\n" .
51 ' window.open("../plugins/message_details/message_details_main.php' .
04f6008a 52 $params . '","MessageDetails","width=800,height=600");' . "\n".
bbdea028 53 " }\n" .
54 "// -->\n" .
55 "</script>\n" .
6fd95361 56 "&nbsp;|&nbsp;<a href=\"javascript:MessageSource();\">$print_text</a>\n";
bbdea028 57 }
58 echo $result;
59}
04f6008a 60
6fd95361 61?>