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(' ', ' ', $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>'.
$imapConnection = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
echo '<select name="mf_subfolder">';
- $boxes = sqimap_mailbox_list($imapConnection);
- for ($i = 0; $i < count($boxes); $i++) {
- if (!in_array('noselect', $boxes[$i]['flags'])) {
- $box = $boxes[$i]['unformatted'];
- $box2 = str_replace(' ', ' ', $boxes[$i]['unformatted-disp']);
- if ( strtolower( $box2 ) == 'inbox' ) {
- $box2 = _("INBOX");
- }
- echo "<option value=\"$box\">$box2</option>\n";
- }
- }
+
+ $selected = 0;
+ if ( isset($mf_subfolder) )
+ $selected = array(strtolower($mf_subfolder));
+ echo sqimap_mailbox_option_list($imapConnection, $selected);
echo '</select></td></tr>' .
html_tag( 'tr',
html_tag( 'th', ' ', 'right' ) .
$imapConnection = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
echo '<select name="mf_subfolder">';
- $boxes = sqimap_mailbox_list($imapConnection);
- for ($i = 0; $i < count($boxes); $i++) {
- if (!in_array('noselect', $boxes[$i]['flags'])) {
- $box = $boxes[$i]['unformatted'];
- $box2 = str_replace(' ', ' ', $boxes[$i]['unformatted-disp']);
- if ( strtolower( $box2 ) == 'inbox' ) {
- $box2 = _("INBOX");
- }
- echo '<option ' .
- (strcmp($mailfetch_subfolder_[$mf_sn],$box)==0?'selected':'') .
- " value=\"$box\">$box2</option>\n";
- }
- }
+ $selected = 0;
+ if ( isset($mf_subfolder) )
+ $selected = array(strtolower($mf_subfolder));
+ echo sqimap_mailbox_option_list($imapConnection, $selected);
echo '</select></td></tr>' .
html_tag( 'tr',