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