updated changelog
[squirrelmail.git] / src / folders.php
CommitLineData
a044cee3 1<?
d068c0ec 2 if (!isset($config_php))
3 include("../config/config.php");
4 if (!isset($strings_php))
5 include("../functions/strings.php");
6 if (!isset($page_header_php))
7 include("../functions/page_header.php");
8 if (!isset($imap_php))
9 include("../functions/imap.php");
10 if (!isset($array_php))
11 include("../functions/array.php");
aa42fbfb 12
d3cdb279 13 include("../src/load_prefs.php");
14
f8f9bed9 15 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
16
17 displayPageHeader($color, "None");
aa42fbfb 18
19 echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
f8f9bed9 20 echo " <TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>\n";
036a8a9d 21 echo _("Folders");
aa42fbfb 22 echo " </TD></TR>\n";
23 echo "</TABLE>\n";
24
813eba2f 25 $imapConnection = sqimap_login ($username, $key, $imapServerAddress, 0);
26 $boxes = sqimap_mailbox_list($imapConnection);
60573cd9 27
28 /** DELETING FOLDERS **/
907165ca 29 echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER>\n";
aae41ae9 30 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
036a8a9d 31 echo _("Delete Folder");
aae41ae9 32 echo "</B></TD></TR>";
f8f9bed9 33 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
8467bf00 34 echo "<FORM ACTION=folders_delete.php METHOD=SUBMIT>\n";
7ce342dc 35 echo "<TT><SELECT NAME=mailbox>\n";
36 for ($i = 0; $i < count($boxes); $i++) {
60573cd9 37 $use_folder = true;
38 for ($p = 0; $p < count($special_folders); $p++) {
813eba2f 39 if ($boxes[$i]["unformatted"] == $special_folders[$p]) {
60573cd9 40 $use_folder = false;
813eba2f 41 } else if (substr($boxes[$i]["unformatted"], 0, strlen($trash_folder)) == $trash_folder) {
907165ca 42 $use_folder = false;
e457e585 43 }
60573cd9 44 }
7ce342dc 45 if ($use_folder == true) {
abddc974 46 $box = $boxes[$i]["unformatted-dm"];
813eba2f 47 $box2 = replace_spaces($boxes[$i]["formatted"]);
7ce342dc 48 echo " <OPTION VALUE=\"$box\">$box2\n";
49 }
60573cd9 50 }
7ce342dc 51
52 echo "</SELECT></TT>\n";
aae41ae9 53 echo "<INPUT TYPE=SUBMIT VALUE=\"";
036a8a9d 54 echo _("Delete");
aae41ae9 55 echo "\">\n";
907165ca 56 echo "</FORM><BR></TD></TR><BR>\n";
60573cd9 57
58 /** CREATING FOLDERS **/
aae41ae9 59 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
036a8a9d 60 echo _("Create Folder");
aae41ae9 61 echo "</B></TD></TR>";
f8f9bed9 62 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
60573cd9 63 echo "<FORM ACTION=folders_create.php METHOD=POST>\n";
907165ca 64 echo "<INPUT TYPE=TEXT SIZE=25 NAME=folder_name><BR>\n";
036a8a9d 65 echo _("as a subfolder of");
aae41ae9 66 echo "<BR>";
67 echo "<TT><SELECT NAME=subfolder>\n";
d92b6f31 68 if ($default_sub_of_inbox == false)
69 echo "<OPTION SELECTED>[ None ]\n";
70 else
71 echo "<OPTION>[ None ]\n";
72
7ce342dc 73 for ($i = 0; $i < count($boxes); $i++) {
c5f5cd59 74// for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
75// if ($boxes[$i]["flags"][$j] != "noinferiors") {
36695509 76 if (($boxes[$i]["unformatted"] == $special_folders[0]) && ($default_sub_of_inbox == true)) {
77 $box = $boxes[$i]["unformatted"];
78 $box2 = replace_spaces($boxes[$i]["formatted"]);
79 echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
80 } else {
81 $box = $boxes[$i]["unformatted"];
82 $box2 = replace_spaces($boxes[$i]["formatted"]);
83 echo "<OPTION VALUE=\"$box\">$box2\n";
84 }
c5f5cd59 85// }
86// }
60573cd9 87 }
7ce342dc 88 echo "</SELECT></TT><BR>\n";
813eba2f 89 if ($show_contain_subfolders_option) {
aae41ae9 90 echo "<INPUT TYPE=CHECKBOX NAME=\"contain_subs\"> &nbsp;";
036a8a9d 91 echo _("Let this folder contain subfolders");
aae41ae9 92 echo "<BR>";
813eba2f 93 }
aae41ae9 94 echo "<INPUT TYPE=SUBMIT VALUE=Create>\n";
907165ca 95 echo "</FORM><BR></TD></TR><BR>\n";
60573cd9 96
97 /** RENAMING FOLDERS **/
aae41ae9 98 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
036a8a9d 99 echo _("Rename a Folder");
aae41ae9 100 echo "</B></TD></TR>";
f8f9bed9 101 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
3e054c43 102 echo "<FORM ACTION=folders_rename_getname.php METHOD=POST>\n";
aae41ae9 103 echo "<TT><SELECT NAME=old>\n";
7ce342dc 104 for ($i = 0; $i < count($boxes); $i++) {
60573cd9 105 $use_folder = true;
106 for ($p = 0; $p < count($special_folders); $p++) {
813eba2f 107 if ($boxes[$i]["unformatted"] == $special_folders[$p]) {
7ce342dc 108 $use_folder = false;
813eba2f 109 } else if (substr($boxes[$i]["unformatted"], 0, strlen($trash_folder)) == $trash_folder) {
60573cd9 110 $use_folder = false;
907165ca 111 }
60573cd9 112 }
7ce342dc 113 if ($use_folder == true) {
813eba2f 114 $box = $boxes[$i]["unformatted"];
115 $box2 = replace_spaces($boxes[$i]["formatted"]);
7ce342dc 116 echo " <OPTION VALUE=\"$box\">$box2\n";
117 }
60573cd9 118 }
7ce342dc 119 echo "</SELECT></TT>\n";
aae41ae9 120 echo "<INPUT TYPE=SUBMIT VALUE=\"";
036a8a9d 121 echo _("Rename");
aae41ae9 122 echo "\">\n";
907165ca 123 echo "</FORM></TD></TR></TABLE><BR>\n";
60573cd9 124
aa42fbfb 125?>
2aa12d5e 126</BODY></HTML>