X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders.php;h=cf385562d4305c36ed6747c64af758b1322cb556;hb=a4fe507d376dc9bcb3337e8007441b0af706017f;hp=167993c3d25b9e96f0f1756ecc44e5afa27be70e;hpb=d7e3602ce1742be4d59094b4fe55161b17b9b668;p=squirrelmail.git diff --git a/src/folders.php b/src/folders.php index 167993c3..cf385562 100644 --- a/src/folders.php +++ b/src/folders.php @@ -1,4 +1,4 @@ -\n"; - displayPageHeader($color, "None"); echo "\n"; @@ -29,73 +27,78 @@ /** Cyrus Folder Options**/ //Creates the Sent and Trash folder -if (($sent_create == "true") || ($trash_create == "true")) { - if ($sent_create == "true") { - sqimap_mailbox_create ($imapConnection, $sent_folder, ""); - } + if (($sent_create == "true") || ($trash_create == "true")) { + if ($sent_create == "true") { + sqimap_mailbox_create ($imapConnection, $sent_folder, ""); + } if ($trash_create == "true") { - sqimap_mailbox_create ($imapConnection, $trash_folder, ""); - } -//Major hack, need to right a funtion to check and if mailbox is subscribed to - sqimap_subscribe($imapConnection, "INBOX"); - echo "

"; - echo _("Mailboxes Created Successfully!"); - echo "
"; + sqimap_mailbox_create ($imapConnection, $trash_folder, ""); + } + echo "

"; + echo _("Mailboxes Created Successfully!"); + echo "
"; echo _("Click here"); echo " "; echo _("to continue."); echo "
"; echo ""; -exit; -} + + exit; + } + //display form option for creating Sent and Trash folder if ($imap_server_type == "cyrus") { - if ((!sqimap_mailbox_exists ($imapConnection, $sent_folder)) || (!sqimap_mailbox_exists ($imapConnection, $trash_folder))) { - echo "
\n"; - echo ""; - echo "\n"; - } - } -} + if ((!sqimap_mailbox_exists ($imapConnection, $sent_folder)) || (!sqimap_mailbox_exists ($imapConnection, $trash_folder))) { + echo "
"; - echo _("Special Folder Options"); - echo "
"; - echo _("In order for SquirrelMail to provide the full set of options you need to create the special folders listed below. Just click the check box and hit the create button."); - echo "
\n"; - if (!sqimap_mailbox_exists ($imapConnection, $sent_folder)) { - echo _("Create Sent") . "
\n"; - } - if (!sqimap_mailbox_exists ($imapConnection, $trash_folder)){ - echo _("Create Trash") . "
\n"; - echo ""; - echo "
\n"; + echo ""; + echo "\n"; + } + } + } + /** DELETING FOLDERS **/ echo "
"; + echo _("Special Folder Options"); + echo "
"; + echo _("In order for SquirrelMail to provide the full set of options you need to create the special folders listed below. Just click the check box and hit the create button."); + echo "
\n"; + if (!sqimap_mailbox_exists ($imapConnection, $sent_folder)) { + echo _("Create Sent") . "
\n"; + } + if (!sqimap_mailbox_exists ($imapConnection, $trash_folder)){ + echo _("Create Trash") . "
\n"; + echo ""; + echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo "
"; echo _("Delete Folder"); echo "
"; + $count_special_folders = 0; - for ($i = 0; $i < count($special_folders); $i++) { - for ($p = 0; $p < count($special_folders); $p++) { - if ($boxes[$i]["unformatted"] == $special_folders[$p]) { - $count_special_folders++; - } - } - } + $num_max = 1; + if ($move_to_trash) + $num_max++; + if ($move_to_sent) + $num_max++; + + for ($p = 0; $p < count($boxes) && $count_special_folders < $num_max; $p++) { + if (strtolower($boxes[$i]["unformatted"]) == "inbox") + $count_special_folders++; + else if ($boxes[$i]["unformatted"] == $trash_folder) + $count_special_folders++; + else if ($boxes[$i]["unformatted"] == $sent_folder) + $count_special_folders++; + } if ($count_special_folders < count($boxes)) { - echo "
\n"; + echo "\n"; echo "
"; - echo "\n"; + echo "\n"; echo "
\n"; echo _("as a subfolder of"); echo "
"; @@ -130,7 +133,7 @@ exit; if (count($boxes[$i]["flags"]) > 0) { for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) { if ($boxes[$i]["flags"][$j] != "noinferiors") { - if (($boxes[$i]["unformatted"] == $special_folders[0]) && ($default_sub_of_inbox == true)) { + if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) { $box = $boxes[$i]["unformatted"]; $box2 = replace_spaces($boxes[$i]["formatted"]); echo "
"; if ($count_special_folders < count($boxes)) { - echo "\n"; + echo "\n"; echo "
"; if ($count_special_folders < count($boxes)) { - echo "\n"; + echo "\n"; echo "
"; if ($count_special_folders <= count($boxes)) { $imap_stream = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 1); - $boxes = sqimap_mailbox_list_all ($imap_stream); + $boxes_all = sqimap_mailbox_list_all ($imap_stream); - echo "\n"; - echo ""; + echo "\n"; + echo ""; echo "\n";