Refactor hyperlink template code
[squirrelmail.git] / plugins / listcommands / functions.php
index adb7b49d22400f16f8c6b637df15a28372384386..d617cee0464a3a4a51b7721946da50d096bbd637 100644 (file)
@@ -40,7 +40,7 @@ function plugin_listcommands_menu_do() {
         $proto = array_shift($aActions);
         $act   = array_shift($actions);
 
-        if (1||$proto == 'mailto') {
+        if ($proto == 'mailto') {
 
             if (($cmd == 'post') || ($cmd == 'owner')) {
                 $url = 'src/compose.php?'.
@@ -63,11 +63,7 @@ function plugin_listcommands_menu_do() {
                 $links[] = makeComposeLink($url, $fieldsdescr['reply']);
             }
         } else if ($proto == 'href') {
-            $oTemplate->assign('uri', $act);
-            $oTemplate->assign('target', '_blank');
-            $oTemplate->assign('text', $fieldsdescr[$cmd]);
-            $output = $oTemplate->fetch('hyperlink.tpl');
-            $links[] = $output;
+            $links[] = create_hyperlink($act, $fieldsdescr[$cmd], '_blank');
         }
     }