X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Flistcommands%2Fsetup.php;h=523940fe8dbc81872115f6cd1ac56f29255bafa2;hb=e29a0356bdab63512a2592ccf23cb86423bc214b;hp=4a9b73cb14e5c5c5c15de9df4596561e42bc3808;hpb=ea5f4b8eaf805c4cc4e9533e87d057300a7fe666;p=squirrelmail.git diff --git a/plugins/listcommands/setup.php b/plugins/listcommands/setup.php index 4a9b73cb..523940fe 100644 --- a/plugins/listcommands/setup.php +++ b/plugins/listcommands/setup.php @@ -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&"; } @@ -68,9 +65,11 @@ function plugin_listcommands_menu() { $output[] = makeComposeLink($url, $fieldsdescr[$cmd]); if ($cmd == 'post') { - $url .= '&passed_id='.$passed_id. - '&mailbox='.urlencode($mailbox). - (isset($passed_ent_id)?'&passed_ent_id='.$passed_ent_id:''); + if (!isset($mailbox)) + $mailbox = 'INBOX'; + $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']); @@ -91,4 +90,4 @@ function plugin_listcommands_menu() { } } -?> +?> \ No newline at end of file