Another sneaky folder list (or two)
[squirrelmail.git] / plugins / filters / spamoptions.php
index e4769cae0751f9059d801027ccdc727a0f15ee9e..015aa178657838e7aa59361ad06fdf1837a41638 100644 (file)
@@ -104,17 +104,10 @@ if (isset($action) && $action == 'spam') {
                 html_tag( 'td', '', 'left' ) .
                     '<select name="filters_spam_folder_set">';
 
-    for ($i = 0; $i < $numboxes; $i++) {
-        if (! in_array('noselect', $boxes[$i]['flags'])) {
-            $box = $boxes[$i]['unformatted'];
-            $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['formatted']);
-            if ($filters_spam_folder == $box) {
-                echo "<OPTION VALUE=\"$box\" SELECTED>$box2</OPTION>\n";
-            } else {
-                echo "<OPTION VALUE=\"$box\">$box2</OPTION>\n";
-            }
-        }
-    }
+        $selected = 0;
+        if ( isset($filters_spam_folder) )
+          $selected = array(strtolower($filters_spam_folder));
+        echo sqimap_mailbox_option_list(0, $selected, 0, $boxes);
     echo    '</select>'.
         '</td>'.
         '</tr>'.