Revert last commit; passing by reference like that causes deprecation PHP notices...
[squirrelmail.git] / plugins / message_details / setup.php
index 2346b5dcf16c0665734a675e12b17d0c6f1be074..f4cfa4b462b54422b38af3d303674eefe9fed145 100644 (file)
@@ -1,12 +1,13 @@
 <?php
+
 /**
- * Message Details plugin - main setup script  
+ * Message Details plugin - main setup script
  *
  * Plugin to view the RFC822 raw message output and the bodystructure of a message
  *
  * @author Marc Groot Koerkamp
- * @copyright Copyright &copy; 2002 Marc Groot Koerkamp, The Netherlands
- * @copyright Copyright &copy; 2004 The SquirrelMail Project Team
+ * @copyright &copy; 2002 Marc Groot Koerkamp, The Netherlands
+ * @copyright &copy; 2002-2006 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -28,10 +29,10 @@ function squirrelmail_plugin_init_message_details()
  * Add message details link in message view
  * @access private
  */
-function show_message_details() {
-    global $passed_id, $mailbox, $ent_num, $color,
+function show_message_details($links) {
+    global $passed_id, $mailbox, $ent_num,
            $javascript_on;
-
+    
     if (strlen(trim($mailbox)) < 1) {
         $mailbox = 'INBOX';
     }
@@ -40,22 +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" language="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";
-    } 
-    echo $result;
+                "</script>\n\n";
+    }
 }
-?>
\ No newline at end of file
+