Preferences save now
[squirrelmail.git] / src / folders.php
CommitLineData
a044cee3 1<?
aa42fbfb 2 include("../config/config.php");
3 include("../functions/strings.php");
4 include("../functions/page_header.php");
5 include("../functions/imap.php");
597d8f1d 6 include("../functions/mailbox.php");
7ce342dc 7 include("../functions/array.php");
aa42fbfb 8
f8f9bed9 9 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
10
11 displayPageHeader($color, "None");
aa42fbfb 12
13 echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
f8f9bed9 14 echo " <TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>\n";
aa42fbfb 15 echo " <FONT FACE=\"Arial,Helvetica\">Folders</FONT>\n";
16 echo " </TD></TR>\n";
17 echo "</TABLE>\n";
18
2aa12d5e 19 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
7ce342dc 20 getFolderList($imapConnection, $boxes);
60573cd9 21
22 /** DELETING FOLDERS **/
907165ca 23 echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER>\n";
f8f9bed9 24 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><FONT FACE=\"Arial,Helvetica\"><B>Delete Folder</B></FONT></TD></TR>";
25 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
8467bf00 26 echo "<FORM ACTION=folders_delete.php METHOD=SUBMIT>\n";
7ce342dc 27 echo "<TT><SELECT NAME=mailbox>\n";
28 for ($i = 0; $i < count($boxes); $i++) {
60573cd9 29 $use_folder = true;
30 for ($p = 0; $p < count($special_folders); $p++) {
7ce342dc 31 if ($boxes[$i]["UNFORMATTED"] == $special_folders[$p]) {
60573cd9 32 $use_folder = false;
7ce342dc 33 } else if (substr($boxes[$i]["UNFORMATTED"], 0, strlen($trash_folder)) == $trash_folder) {
907165ca 34 $use_folder = false;
e457e585 35 }
60573cd9 36 }
7ce342dc 37 if ($use_folder == true) {
38 $box = $boxes[$i]["UNFORMATTED"];
39 $box2 = $boxes[$i]["FORMATTED"];
40 echo " <OPTION VALUE=\"$box\">$box2\n";
41 }
60573cd9 42 }
7ce342dc 43
44 echo "</SELECT></TT>\n";
45 echo "<FONT FACE=\"Arial,Helvetica\"><INPUT TYPE=SUBMIT VALUE=Delete></FONT>\n";
907165ca 46 echo "</FORM><BR></TD></TR><BR>\n";
60573cd9 47
48 /** CREATING FOLDERS **/
f8f9bed9 49 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><FONT FACE=\"Arial,Helvetica\"><B>Create Folder</B></FONT></TD></TR>";
50 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
60573cd9 51 echo "<FORM ACTION=folders_create.php METHOD=POST>\n";
907165ca 52 echo "<INPUT TYPE=TEXT SIZE=25 NAME=folder_name><BR>\n";
7ce342dc 53 echo "<FONT FACE=\"Arial,Helvetica\">as a subfolder of</FONT><BR>";
54 echo "<TT><SELECT NAME=subfolder><FONT FACE=\"Arial,Helvetica\">\n";
d92b6f31 55 if ($default_sub_of_inbox == false)
56 echo "<OPTION SELECTED>[ None ]\n";
57 else
58 echo "<OPTION>[ None ]\n";
59
7ce342dc 60 for ($i = 0; $i < count($boxes); $i++) {
61 if (($boxes[$i]["UNFORMATTED"] == $special_folders[0]) && ($default_sub_of_inbox == true)) {
62 $box = $boxes[$i]["UNFORMATTED"];
63 $box2 = $boxes[$i]["FORMATTED"];
64 echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
65 } else {
66 $box = $boxes[$i]["UNFORMATTED"];
67 $box2 = $boxes[$i]["FORMATTED"];
68 echo "<OPTION VALUE=\"$box\">$box2\n";
69 }
60573cd9 70 }
7ce342dc 71 echo "</SELECT></TT><BR>\n";
72 echo "<FONT FACE=\"Arial,Helvetica\">";
73 if ($show_contain_subfolders_option)
74 echo "<INPUT TYPE=CHECKBOX NAME=\"contain_subs\"><FONT FACE=\"Arial,Helvetica\"> &nbsp;Let this folder contain subfolders</FONT><BR>";
75 echo "<INPUT TYPE=SUBMIT VALUE=Create></FONT>\n";
907165ca 76 echo "</FORM><BR></TD></TR><BR>\n";
60573cd9 77
78 /** RENAMING FOLDERS **/
d92b6f31 79 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><FONT FACE=\"Arial,Helvetica\"><B>Rename a Folder</B></FONT></TD></TR>";
f8f9bed9 80 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
3e054c43 81 echo "<FORM ACTION=folders_rename_getname.php METHOD=POST>\n";
7ce342dc 82 echo "<TT><SELECT NAME=old><FONT FACE=\"Arial,Helvetica\">\n";
83 for ($i = 0; $i < count($boxes); $i++) {
60573cd9 84 $use_folder = true;
85 for ($p = 0; $p < count($special_folders); $p++) {
7ce342dc 86 if ($boxes[$i]["UNFORMATTED"] == $special_folders[$p]) {
87 $use_folder = false;
88 } else if (substr($boxes[$i]["UNFORMATTED"], 0, strlen($trash_folder)) == $trash_folder) {
60573cd9 89 $use_folder = false;
907165ca 90 }
60573cd9 91 }
7ce342dc 92 if ($use_folder == true) {
93 $box = $boxes[$i]["UNFORMATTED"];
94 $box2 = $boxes[$i]["FORMATTED"];
95 echo " <OPTION VALUE=\"$box\">$box2\n";
96 }
60573cd9 97 }
7ce342dc 98 echo "</SELECT></TT>\n";
99 echo "<FONT FACE=\"Arial,Helvetica\"><INPUT TYPE=SUBMIT VALUE=\"Rename\"></FONT>\n";
907165ca 100 echo "</FORM></TD></TR></TABLE><BR>\n";
60573cd9 101
aa42fbfb 102?>
2aa12d5e 103</BODY></HTML>