- /** 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 (!empty($filtered_folders)) {
- echo addForm('folders.php')
- . addHidden('smaction', 'unsubscribe')
- . "<tt><select name=\"folder_names[]\" multiple=\"multiple\" size=\"8\">\n"
- . $filtered_folders
- . "</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;
- }
- }
+ // TODO: use checkboxes instead of select options.
+ // DONE Steve Brown 2006-08-08
+
+ /** 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);
+ }
+ }
+}