update README to reflect inclusion in squirrelmail-core-plugins
[squirrelmail.git] / plugins / listcommands / setup.php
index b714513230f8372e7ca1dcc17eebd0d7a3d56bd5..523940fe8dbc81872115f6cd1ac56f29255bafa2 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * setup.php
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2005 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Implementation of RFC 2369 for SquirrelMail.
@@ -26,7 +26,7 @@ function squirrelmail_plugin_init_listcommands () {
 }
 
 function plugin_listcommands_menu() {
-    global $passed_id, $passed_ent_id, $color, $mailbox, $message;
+    global $passed_id, $passed_ent_id, $color, $mailbox, $message, $startMessage;
 
     /**
      * Array of commands we can deal with from the header. The Reply option
@@ -43,23 +43,20 @@ function plugin_listcommands_menu() {
 
     foreach ($message->rfc822_header->mlist as $cmd => $actions) {
 
-       /* I don't know this action... skip it */
-       if ( ( function_exists('array_key_exists') &&       /* PHP >= 4.1 */
-               !array_key_exists($cmd, $fieldsdescr) ) ||
-             ( function_exists('key_exists') && 
-               !key_exists($cmd, $fieldsdescr) )            /* PHP == 4.0.6 */
-        ) {
+        /* I don't know this action... skip it */
+        if ( !array_key_exists($cmd, $fieldsdescr) ) {
             continue;
         }
 
         /* proto = {mailto,href} */
-       $proto = array_shift(array_keys($actions));
-       $act   = array_shift($actions);
+        $proto = array_shift(array_keys($actions));
+        $act   = array_shift($actions);
 
         if ($proto == 'mailto') {
 
             if (($cmd == 'post') || ($cmd == 'owner')) {
-                $url = 'src/compose.php?';
+                $url = 'src/compose.php?'.
+                (isset($startMessage)?'startMessage='.$startMessage.'&':'');
             } else {
                 $url = "plugins/listcommands/mailout.php?action=$cmd&";
             }
@@ -70,9 +67,9 @@ function plugin_listcommands_menu() {
             if ($cmd == 'post') {
                 if (!isset($mailbox))
                     $mailbox = 'INBOX';
-               $url .= '&passed_id='.$passed_id.
-                       '&mailbox='.urlencode($mailbox).
-                       (isset($passed_ent_id)?'&passed_ent_id='.$passed_ent_id:'');
+                $url .= '&passed_id='.$passed_id.
+                        '&mailbox='.urlencode($mailbox).
+                        (isset($passed_ent_id)?'&passed_ent_id='.$passed_ent_id:'');
                 $url .= '&smaction=reply';
 
                 $output[] = makeComposeLink($url, $fieldsdescr['reply']);
@@ -93,4 +90,4 @@ function plugin_listcommands_menu() {
     }
 }
 
-?>
+?>
\ No newline at end of file