+ echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
+ echo _("Rename a Folder");
+ echo "</B></TD></TR>";
+ echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
+ if ($count_special_folders < count($boxes)) {
+ echo "<FORM ACTION=\"folders_rename_getname.php\" METHOD=\"POST\">\n";
+ echo "<TT><SELECT NAME=old>\n";
+ for ($i = 0; $i < count($boxes); $i++) {
+ $use_folder = true;
+
+ if ((strtolower($boxes[$i]["unformatted"]) != "inbox") &&
+ ($boxes[$i]["unformatted"] != $trash_folder) &&
+ ($boxes[$i]["unformatted"] != $sent_folder))
+ {
+ $box = $boxes[$i]["unformatted-dm"];
+ $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
+ if (strtolower($imap_server_type) != "courier" || strtolower($box) != "inbox.trash")
+ echo "<OPTION VALUE=\"$box\">$box2\n";
+ }
+ }
+ echo "</SELECT></TT>\n";
+ echo "<INPUT TYPE=SUBMIT VALUE=\"";
+ echo _("Rename");
+ echo "\">\n";
+ echo "</FORM></TD></TR>\n";
+ } else {
+ echo _("No folders found") . "<br><br></td></tr>";
+ }
+ $boxes_sub = $boxes;
+
+ echo "<tr><td bgcolor=\"$color[4]\"> </td></tr></table>\n";
+
+ /** UNSUBSCRIBE FOLDERS **/
+ echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER cellpadding=2 cellspacing=0 border=0>\n";
+ echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER colspan=3><B>";
+ echo _("Unsubscribe") . "/" . _("Subscribe");
+ echo "</B></TD></TR>";
+ echo "<TR><TD BGCOLOR=\"$color[0]\" width=49% ALIGN=CENTER>";
+ if ($count_special_folders < count($boxes)) {
+ echo "<FORM ACTION=\"folders_subscribe.php?method=unsub\" METHOD=\"POST\">\n";
+ echo "<TT><SELECT NAME=mailbox[] multiple size=8>\n";
+ for ($i = 0; $i < count($boxes); $i++) {
+ $use_folder = true;
+ if ((strtolower($boxes[$i]["unformatted"]) != "inbox") &&
+ ($boxes[$i]["unformatted"] != $trash_folder) &&
+ ($boxes[$i]["unformatted"] != $sent_folder))
+ {
+ $box = $boxes[$i]["unformatted-dm"];
+ $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
+ echo " <OPTION VALUE=\"$box\">$box2\n";
+ }
+ }
+ echo "</SELECT></TT><br>\n";
+ echo "<INPUT TYPE=SUBMIT VALUE=\"";
+ echo _("Unsubscribe");
+ echo "\">\n";
+ echo "</FORM></TD>\n";
+ } else {
+ echo _("No folders were found to unsubscribe from!") . "</td>";
+ }
+ $boxes_sub = $boxes;
+
+ echo "<td bgcolor=\"$color[9]\" width=2%> </td>";
+
+ /** SUBSCRIBE TO FOLDERS **/
+ echo "<TD BGCOLOR=\"$color[0]\" widtn=49% ALIGN=CENTER>";
+ $imap_stream = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 1);
+ $boxes_all = sqimap_mailbox_list_all ($imap_stream);
+
+ $box = "";
+ $box2 = "";
+ for ($i = 0, $q = 0; $i < count($boxes_all); $i++) {