Added comments; all header() calls have to go thru template object
[squirrelmail.git] / plugins / listcommands / functions.php
index 7028ed2f010e591986aeaf1e82b7c56d0de76ba6..a90587f32d45750cfc90626d732f88ecf10ff31c 100644 (file)
@@ -3,19 +3,21 @@
 /**
  * functions.php
  *
- * 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.
  * When viewing a message from a mailinglist complying with this RFC,
  * this plugin displays a menu which gives the user a choice of mailinglist
  * commands such as (un)subscribe, help and list archives.
  *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
  * @subpackage listcommands
  */
 
+/**
+ * internal function that builds mailing list links
+ */
 function plugin_listcommands_menu_do() {
     global $passed_id, $passed_ent_id, $color, $mailbox, $message, $startMessage;
 
@@ -34,7 +36,8 @@ function plugin_listcommands_menu_do() {
         }
 
         /* proto = {mailto,href} */
-        $proto = array_shift(array_keys($actions));
+        $aActions = array_keys($actions);
+        $proto = array_shift($aActions);
         $act   = array_shift($actions);
 
         if ($proto == 'mailto') {
@@ -45,7 +48,7 @@ function plugin_listcommands_menu_do() {
             } else {
                 $url = "plugins/listcommands/mailout.php?action=$cmd&";
             }
-            $url .= 'send_to=' . strtr($act,'?','&');
+            $url .= 'send_to=' . str_replace('?','&', $act);
 
             $output[] = makeComposeLink($url, $fieldsdescr[$cmd]);
 
@@ -89,4 +92,3 @@ function listcommands_fieldsdescr() {
             'help'        => _("Help"));
 }
 
-?>
\ No newline at end of file