-echo html_tag( 'tr',
- html_tag( 'td', ' ', 'left', $color[4] )
- ) ."</table>\n";
-
-
-if ($show_only_subscribed_folders) {
-
- /** UNSUBSCRIBE FOLDERS **/
- echo html_tag( 'table', '', 'center', '', 'width="70%" cellpadding="4" cellspacing="0" border="0"' ) .
- html_tag( 'tr',
- html_tag( 'td', '<b>' . _("Unsubscribe") . '/' . _("Subscribe") . '</b>', 'center', $color[9], 'colspan="2"' )
- ) .
- html_tag( 'tr' ) .
- html_tag( 'td', '', 'center', $color[0], 'width="50%"' );
-
- if ($count_special_folders < count($boxes)) {
- echo addForm('folders.php')
- . addHidden('smaction', 'unsubscribe')
- . "<tt><select name=\"folder_names[]\" multiple=\"multiple\" size=\"8\">\n";
- foreach ( $boxes as $box ) {
- $use_folder = true;
- if ((strtolower($box["unformatted"]) != "inbox") &&
- ($box['unformatted'] != $trash_folder) &&
- ($box['unformatted'] != $sent_folder) &&
- ($box['unformatted'] != $draft_folder)) {
- $box_enc = htmlspecialchars($box['unformatted-dm']);
- $box_disp = str_replace(' ', ' ',
- htmlspecialchars(imap_utf7_decode_local($box["unformatted-disp"])));
- echo " <option value=\"$box_enc\">$box_disp</option>\n";
- }
- }
- echo "</select></tt><br /><br />\n"
- . '<input type="submit" value="'
- . _("Unsubscribe")
- . "\" />\n"
- . "</form></td>\n";
- } else {
- echo _("No folders were found to unsubscribe from!") . '</td>';
- }
-
- /** SUBSCRIBE TO FOLDERS **/
- echo html_tag( 'td', '', 'center', $color[0], 'width="50%"' );
- if(!$no_list_for_subscribe) {
- $boxes_all = sqimap_mailbox_list_all ($imapConnection);
-
- $subboxes = array();
- // here we filter out all boxes we're already subscribed to,
- // so we keep only the unsubscribed ones.
- foreach ($boxes_all as $box_a) {
-
- $use_folder = true;
- foreach ( $boxes as $box ) {
- if ($box_a['unformatted'] == $box['unformatted'] ||
- $box_a['unformatted-dm'] == $folder_prefix ) {
- $use_folder = false;
- }
- }
-
- if ($use_folder == true) {
- $box_enc = htmlspecialchars($box_a['unformatted-dm']);
- $box_disp = htmlspecialchars(imap_utf7_decode_local($box_a['unformatted-disp']));
- $subboxes[$box_enc] = $box_disp;
- }
- }
-
- if ( count($subboxes) > 0 ) {
- echo addForm('folders.php')
- . addHidden('smaction', 'subscribe')
- . '<tt><select name="folder_names[]" multiple="multiple" size="8">';
-
- foreach($subboxes as $subbox_enc => $subbox_disp) {
- echo ' <option value="' . $subbox_enc . '">'.$subbox_disp."</option>\n";
- }
-
- echo '</select></tt><br /><br />'
- . '<input type="submit" value="'. _("Subscribe") . "\" />\n"
- . "</form></td></tr></table><br />\n";
- } else {
- echo _("No folders were found to subscribe to.") . '</td></tr></table>';
- }
- } else {
- /* don't perform the list action -- this is much faster */
- echo addForm('folders.php')
- . addHidden('smaction', 'subscribe')
- . _("Subscribe to:") . '<br />'
- . '<tt><input type="text" name="folder_names[]" size="35" />'
- . '<input type="submit" value="'. _("Subscribe") . "\" />\n"
- . "</form></td></tr></table><br />\n";
- }
+ /** SUBSCRIBE TO FOLDERS **/
+ $boxes_all = sqimap_mailbox_list_all ($imapConnection);
+
+ // here we filter out all boxes we're already subscribed to,
+ // so we keep only the unsubscribed ones.
+ foreach ($boxes_all as $box_a) {
+
+ $use_folder = true;
+ foreach ( $boxes as $box ) {
+ if ($box_a['unformatted'] == $box['unformatted'] ||
+ $box_a['unformatted-dm'] == $folder_prefix ) {
+ $use_folder = false;
+ }
+ }
+
+ if ($use_folder) {
+ $box_enc = sm_encode_html_special_chars($box_a['unformatted-dm']);
+ $box_disp = sm_encode_html_special_chars(imap_utf7_decode_local($box_a['unformatted-disp']));
+ $subbox_option_list[] = array( 'Value' => $box_enc, 'Display' => $box_disp);
+ }
+ }