- foreach ($a_folders as $folder) {
- $utf7folder = $this->rc->imap->mod_mailbox($folder);
- $names = explode($delimiter, rcube_charset_convert($folder, 'UTF7-IMAP'));
- $name = $names[sizeof($names)-1];
-
- if ($replace_delimiter = $this->rc->config->get('managesieve_replace_delimiter'))
- $utf7folder = str_replace($delimiter, $replace_delimiter, $utf7folder);
-
- // convert to Sieve implementation encoding
- $utf7folder = $this->mbox_encode($utf7folder, $mbox_encoding);
-
- if ($folder_class = rcmail_folder_classname($name))
- $foldername = $this->gettext($folder_class);
- else
- $foldername = $name;
-
- $out .= sprintf('<option value="%s"%s>%s%s</option>'."\n",
- htmlspecialchars($utf7folder),
- ($mailbox == $utf7folder ? ' selected="selected"' : ''),
- str_repeat(' ', 4 * (sizeof($names)-1)),
- Q(abbreviate_string($foldername, 40 - (2 * sizeof($names)-1))));
- }
- $out .= '</select>';
+ $this->rc->imap_connect();
+ $select = rcmail_mailbox_select(array(
+ 'realnames' => false,
+ 'maxlength' => 100,
+ 'id' => 'action_mailbox' . $id,
+ 'name' => '_action_mailbox[]',
+ 'style' => 'display:'.(!isset($action) || $action['type']=='fileinto' ? 'inline' : 'none')
+ ));
+ $out .= $select->show($mailbox);