(finally)fix message_details plugin for new plugin infrastructure, and as
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 10 Dec 2006 19:43:27 +0000 (19:43 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 10 Dec 2006 19:43:27 +0000 (19:43 +0000)
added bonus, make it work without javascript too

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11993 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/message_details/message_details_top.php
plugins/message_details/setup.php

index 27fd6407f544fd62295805f7b1da207ca1bfe457..466b4442a0aa13ede0c58160c147ea7b3464b306 100644 (file)
@@ -40,10 +40,11 @@ echo "<body text=\"$color[8]\" bgcolor=\"$color[3]\" link=\"$color[7]\" vlink=\"
      addHidden('passed_id', $passed_id).
      addHidden('ent_id', '0').
      addHidden('absolute_dl', 'true').
      addHidden('passed_id', $passed_id).
      addHidden('ent_id', '0').
      addHidden('absolute_dl', 'true').
+     ($javascript_on ?
      '<input type="button" value="' . _("Print") . '" onclick="printPopup()" />&nbsp;&nbsp;'.
      '<input type="button" value="' . _("Print") . '" onclick="printPopup()" />&nbsp;&nbsp;'.
-     '<input type="button" value="' . _("Close Window") . '" onclick="window.parent.close()" />&nbsp;&nbsp;'.
+     '<input type="button" value="' . _("Close Window") . '" onclick="window.parent.close()" />&nbsp;&nbsp;' :'').
      addSubmit(_("Save Message")).
      '</form></div>'.
      '</body>'.
      "</html>\n";
      addSubmit(_("Save Message")).
      '</form></div>'.
      '</body>'.
      "</html>\n";
-?>
\ No newline at end of file
+?>
index f99b1bc071cd02acf512a0027022615f4b49aa7e..f4cfa4b462b54422b38af3d303674eefe9fed145 100644 (file)
@@ -29,10 +29,10 @@ function squirrelmail_plugin_init_message_details()
  * Add message details link in message view
  * @access private
  */
  * 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;
     global $passed_id, $mailbox, $ent_num,
            $javascript_on;
-
+    
     if (strlen(trim($mailbox)) < 1) {
         $mailbox = 'INBOX';
     }
     if (strlen(trim($mailbox)) < 1) {
         $mailbox = 'INBOX';
     }
@@ -41,20 +41,23 @@ function show_message_details() {
               '&mailbox=' . urlencode($mailbox) .
               '&passed_id=' . $passed_id;
 
               '&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. */
     /* Output the link. */
+    $links[] = array('URL' => $url,
+        'Text' => _("View Message details") );
+
     if ($javascript_on) {
     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" .
                 '<!--' . "\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;
 }
 }
+