\n";
+/**
+ * Retrieve list of folders when special folders are excluded. Special folders
+ * should be unavailable in rename/delete/unsubscribe. Theoretically user can
+ * modify form and perform these operations with special folders, but if user
+ * manages to delete/rename/unsubscribe special folder by hacking form...
+ *
+ * If script or program depends on special folder, they should not assume that
+ * folder is available.
+ *
+ * $filtered_folders contains empty string or html formated option list.
+ */
+$rendel_folder_list = sqimap_mailbox_option_list($imapConnection, 0, $skip_folders, $boxes, NULL, true);
-/** UNSUBSCRIBE FOLDERS **/
-echo html_tag( 'table', '', 'center', '', 'width="70%" cols="2" cellpadding="4" cellspacing="0" border="0"' ) .
- html_tag( 'tr',
- html_tag( 'td', '' . _("Unsubscribe") . '/' . _("Subscribe") . '', 'center', $color[9], 'colspan="2"' )
- ) .
- html_tag( 'tr' ) .
- html_tag( 'td', '', 'center', $color[0], 'width="50%"' );
+$subbox_option_list = array();
-if ($count_special_folders < count($boxes)) {
- echo "
\n";
-} else {
- echo _("No folders were found to unsubscribe from!") . "";
-}
-$boxes_sub = $boxes;
+if ($show_only_subscribed_folders && !$no_list_for_subscribe) {
+ // FIXME: fix subscription options when top folder is not subscribed and sub folder is subscribed
-/** SUBSCRIBE TO FOLDERS **/
-echo html_tag( 'td', '', 'center', $color[0], 'width="50%"' );
-$imap_stream = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 1);
-$boxes_all = sqimap_mailbox_list_all ($imap_stream);
+ // TODO: use checkboxes instead of select options.
+ // DONE Steve Brown 2006-08-08
-$box = "";
-$box2 = "";
-for ($i = 0, $q = 0; $i < count($boxes_all); $i++) {
- $use_folder = true;
- for ($p = 0; $p < count ($boxes); $p++) {
- if ($boxes_all[$i]["unformatted"] == $boxes[$p]["unformatted"]) {
- $use_folder = false;
- continue;
- } else if ($boxes_all[$i]["unformatted-dm"] == $folder_prefix) {
- $use_folder = false;
- }
- }
- if ($use_folder == true) {
- $box[$q] = $boxes_all[$i]["unformatted-dm"];
- $box2[$q] = imap_utf7_decode_local($boxes_all[$i]["unformatted-disp"]);
- $q++;
- }
-}
-sqimap_logout($imap_stream);
+ /** SUBSCRIBE TO FOLDERS **/
+ $boxes_all = sqimap_mailbox_list_all ($imapConnection);
-if ($box && $box2) {
- echo "