- '<table width=85% cellpadding=2 cellspacing=0 border=0>'.
- '<tr>'.
- '<th align=right nowrap>' . _("Move spam to:") . '</th>'.
- '<td><select name="filters_spam_folder_set">';
-
- for ($i = 0; $i < count($boxes); $i++) {
- if (! in_array('noselect', $boxes[$i]['flags'])) {
- $box = $boxes[$i]['unformatted'];
- $box2 = str_replace(' ', ' ', $boxes[$i]['formatted']);
- if ($filters_spam_folder == $box) {
- echo "<OPTION VALUE=\"$box\" SELECTED>$box2</OPTION>\n";
- } else {
- echo "<OPTION VALUE=\"$box\">$box2</OPTION>\n";
- }
- }
- }
+ html_tag( 'table', '', '', '', 'width="85%" border="0" cellpadding="2" cellspacing="0"' ) .
+ html_tag( 'tr' ) .
+ html_tag( 'th', _("Move spam to:"), 'right', '', 'nowrap' ) .
+ html_tag( 'td', '', 'left' ) .
+ '<select name="filters_spam_folder_set">';
+
+ $selected = 0;
+ if ( isset($filters_spam_folder) )
+ $selected = array(strtolower($filters_spam_folder));
+ echo sqimap_mailbox_option_list(0, $selected, 0, $boxes);