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