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>"; |
225ce239 |
34 | $count_special_folders = 0; |
35 | for ($i = 0; $i < count($special_folders); $i++) { |
60573cd9 |
36 | for ($p = 0; $p < count($special_folders); $p++) { |
813eba2f |
37 | if ($boxes[$i]["unformatted"] == $special_folders[$p]) { |
225ce239 |
38 | $count_special_folders++; |
39 | } |
40 | } |
41 | } |
42 | |
43 | if ($count_special_folders < count($boxes)) { |
44 | echo "<FORM ACTION=folders_delete.php METHOD=SUBMIT>\n"; |
45 | echo "<TT><SELECT NAME=mailbox>\n"; |
46 | for ($i = 0; $i < count($boxes); $i++) { |
47 | $use_folder = true; |
48 | for ($p = 0; $p < count($special_folders); $p++) { |
49 | if ($boxes[$i]["unformatted"] == $special_folders[$p]) { |
50 | $use_folder = false; |
51 | } else if (substr($boxes[$i]["unformatted"], 0, strlen($trash_folder)) == $trash_folder) { |
52 | $use_folder = false; |
53 | } |
54 | } |
55 | if ($use_folder == true) { |
56 | $box = $boxes[$i]["unformatted-dm"]; |
57 | $box2 = replace_spaces($boxes[$i]["formatted"]); |
58 | echo " <OPTION VALUE=\"$box\">$box2\n"; |
e457e585 |
59 | } |
60573cd9 |
60 | } |
225ce239 |
61 | echo "</SELECT></TT>\n"; |
62 | echo "<INPUT TYPE=SUBMIT VALUE=\""; |
63 | echo _("Delete"); |
64 | echo "\">\n"; |
65 | echo "</FORM><BR></TD></TR>\n"; |
66 | } else { |
67 | echo _("No mailboxes found") . "<br><br></td><tr>"; |
60573cd9 |
68 | } |
7ce342dc |
69 | |
60573cd9 |
70 | |
71 | /** CREATING FOLDERS **/ |
aae41ae9 |
72 | echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>"; |
036a8a9d |
73 | echo _("Create Folder"); |
aae41ae9 |
74 | echo "</B></TD></TR>"; |
f8f9bed9 |
75 | echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>"; |
60573cd9 |
76 | echo "<FORM ACTION=folders_create.php METHOD=POST>\n"; |
907165ca |
77 | echo "<INPUT TYPE=TEXT SIZE=25 NAME=folder_name><BR>\n"; |
036a8a9d |
78 | echo _("as a subfolder of"); |
aae41ae9 |
79 | echo "<BR>"; |
80 | echo "<TT><SELECT NAME=subfolder>\n"; |
d92b6f31 |
81 | if ($default_sub_of_inbox == false) |
82 | echo "<OPTION SELECTED>[ None ]\n"; |
83 | else |
84 | echo "<OPTION>[ None ]\n"; |
85 | |
7ce342dc |
86 | for ($i = 0; $i < count($boxes); $i++) { |
c5f5cd59 |
87 | // for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) { |
88 | // if ($boxes[$i]["flags"][$j] != "noinferiors") { |
36695509 |
89 | if (($boxes[$i]["unformatted"] == $special_folders[0]) && ($default_sub_of_inbox == true)) { |
90 | $box = $boxes[$i]["unformatted"]; |
91 | $box2 = replace_spaces($boxes[$i]["formatted"]); |
92 | echo "<OPTION SELECTED VALUE=\"$box\">$box2\n"; |
93 | } else { |
94 | $box = $boxes[$i]["unformatted"]; |
95 | $box2 = replace_spaces($boxes[$i]["formatted"]); |
96 | echo "<OPTION VALUE=\"$box\">$box2\n"; |
97 | } |
c5f5cd59 |
98 | // } |
99 | // } |
60573cd9 |
100 | } |
7ce342dc |
101 | echo "</SELECT></TT><BR>\n"; |
813eba2f |
102 | if ($show_contain_subfolders_option) { |
aae41ae9 |
103 | echo "<INPUT TYPE=CHECKBOX NAME=\"contain_subs\"> "; |
036a8a9d |
104 | echo _("Let this folder contain subfolders"); |
aae41ae9 |
105 | echo "<BR>"; |
813eba2f |
106 | } |
aae41ae9 |
107 | echo "<INPUT TYPE=SUBMIT VALUE=Create>\n"; |
907165ca |
108 | echo "</FORM><BR></TD></TR><BR>\n"; |
60573cd9 |
109 | |
110 | /** RENAMING FOLDERS **/ |
aae41ae9 |
111 | echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>"; |
036a8a9d |
112 | echo _("Rename a Folder"); |
aae41ae9 |
113 | echo "</B></TD></TR>"; |
f8f9bed9 |
114 | echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>"; |
225ce239 |
115 | if ($count_special_folders < count($boxes)) { |
116 | echo "<FORM ACTION=folders_rename_getname.php METHOD=POST>\n"; |
117 | echo "<TT><SELECT NAME=old>\n"; |
118 | for ($i = 0; $i < count($boxes); $i++) { |
119 | $use_folder = true; |
120 | for ($p = 0; $p < count($special_folders); $p++) { |
121 | if ($boxes[$i]["unformatted"] == $special_folders[$p]) { |
122 | $use_folder = false; |
123 | } else if (substr($boxes[$i]["unformatted"], 0, strlen($trash_folder)) == $trash_folder) { |
124 | $use_folder = false; |
125 | } |
126 | } |
127 | if ($use_folder == true) { |
128 | $box = $boxes[$i]["unformatted"]; |
129 | $box2 = replace_spaces($boxes[$i]["formatted"]); |
130 | echo " <OPTION VALUE=\"$box\">$box2\n"; |
907165ca |
131 | } |
60573cd9 |
132 | } |
225ce239 |
133 | echo "</SELECT></TT>\n"; |
134 | echo "<INPUT TYPE=SUBMIT VALUE=\""; |
135 | echo _("Rename"); |
136 | echo "\">\n"; |
137 | echo "</FORM></TD></TR></TABLE><BR>\n"; |
138 | } else { |
139 | echo _("No mailboxes found") . "<br><br></td></tr></table>"; |
60573cd9 |
140 | } |
60573cd9 |
141 | |
aa42fbfb |
142 | ?> |
2aa12d5e |
143 | </BODY></HTML> |