(finally)fix message_details plugin for new plugin infrastructure, and as
[squirrelmail.git] / plugins / message_details / setup.php
index f99b1bc..f4cfa4b 100644 (file)
@@ -29,10 +29,10 @@ function squirrelmail_plugin_init_message_details()
  * Add message details link in message view
  * @access private
  */
-function show_message_details() {
+function show_message_details($links) {
     global $passed_id, $mailbox, $ent_num,
            $javascript_on;
-
+    
     if (strlen(trim($mailbox)) < 1) {
         $mailbox = 'INBOX';
     }
@@ -41,20 +41,23 @@ function show_message_details() {
               '&mailbox=' . urlencode($mailbox) .
               '&passed_id=' . $passed_id;
 
-    $print_text = _("View Message details");
+    $url = $javascript_on ? 'javascript:MessageSource();' : 
+        '../plugins/message_details/message_details_main.php' .
+        $params;
 
-    $result = '';
     /* Output the link. */
+    $links[] = array('URL' => $url,
+        'Text' => _("View Message details") );
+
     if ($javascript_on) {
-        $result = '<script type="text/javascript">' . "\n" .
+        echo '<script type="text/javascript">' . "\n" .
                 '<!--' . "\n" .
                 "  function MessageSource() {\n" .
                 '    window.open("../plugins/message_details/message_details_main.php' .
                         $params . '","MessageDetails","width=800,height=600");' . "\n".
                 "  }\n" .
                 "// -->\n" .
-                "</script>\n" .
-                "&nbsp;|&nbsp;<a href=\"javascript:MessageSource();\">$print_text</a>\n";
+                "</script>\n\n";
     }
-    echo $result;
 }
+