0dd352f6f02d69cac0206dda18935e88b7e73d8d
[squirrelmail.git] / src / folders.php
1 <?
2 include("../config/config.php");
3 include("../functions/strings.php");
4 include("../functions/page_header.php");
5 include("../functions/imap.php");
6 include("../functions/mailbox.php");
7
8 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
9
10 displayPageHeader($color, "None");
11
12 echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
13 echo " <TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>\n";
14 echo " <FONT FACE=\"Arial,Helvetica\">Folders</FONT>\n";
15 echo " </TD></TR>\n";
16 echo "</TABLE>\n";
17
18 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
19 getFolderList($imapConnection, $boxesFormatted, $boxesUnformatted);
20
21 /** DELETING FOLDERS **/
22 echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER>\n";
23 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><FONT FACE=\"Arial,Helvetica\"><B>Delete Folder</B></FONT></TD></TR>";
24 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
25 echo "<FORM ACTION=folders_delete.php METHOD=SUBMIT>\n";
26 echo "<SELECT NAME=mailbox><FONT FACE=\"Arial,Helvetica\">\n";
27 for ($i = 0; $i < count($boxesUnformatted); $i++) {
28 $use_folder = true;
29 for ($p = 0; $p < count($special_folders); $p++) {
30 if ($boxesUnformatted[$i] == $special_folders[$p]) {
31 $use_folder = false;
32 } else if (substr($boxesUnformatted[$i], 0, strlen($trash_folder)) == $trash_folder) {
33 $use_folder = false;
34 }
35 }
36
37 if ($use_folder == true)
38 echo "<OPTION>$boxesUnformatted[$i]\n";
39 }
40 echo "</SELECT>\n";
41 echo "<INPUT TYPE=SUBMIT VALUE=Delete>\n";
42 echo "</FORM><BR></TD></TR><BR>\n";
43
44 /** CREATING FOLDERS **/
45 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><FONT FACE=\"Arial,Helvetica\"><B>Create Folder</B></FONT></TD></TR>";
46 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
47 echo "<FORM ACTION=folders_create.php METHOD=POST>\n";
48 echo "<INPUT TYPE=TEXT SIZE=25 NAME=folder_name><BR>\n";
49 echo "&nbsp;&nbsp;as a subfolder of<BR>";
50 echo "<SELECT NAME=subfolder><FONT FACE=\"Arial,Helvetica\">\n";
51 for ($i = 0;$i < count($boxesUnformatted); $i++) {
52 echo "<OPTION>$boxesUnformatted[$i]\n";
53 }
54 echo "</SELECT><BR>\n";
55 echo "<INPUT TYPE=SUBMIT VALUE=Create>\n";
56 echo "</FORM><BR></TD></TR><BR>\n";
57
58 /** RENAMING FOLDERS **/
59 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><FONT FACE=\"Arial,Helvetica\"><B>Rename or Move Folder</B></FONT></TD></TR>";
60 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
61 echo "<FORM ACTION=folders_rename_getname.php METHOD=POST>\n";
62 echo "<SELECT NAME=old><FONT FACE=\"Arial,Helvetica\">\n";
63 for ($i = 0; $i < count($boxesUnformatted); $i++) {
64 $use_folder = true;
65 for ($p = 0; $p < count($special_folders); $p++) {
66 if ($boxesUnformatted[$i] == $special_folders[$p]) {
67 $use_folder = false;
68 }
69 }
70 if ($use_folder == true)
71 echo " <OPTION>$boxesUnformatted[$i]\n";
72 }
73 echo "</SELECT>\n";
74 echo "<INPUT TYPE=SUBMIT VALUE=\"Rename or Move\">\n";
75 echo "</FORM></TD></TR></TABLE><BR>\n";
76
77 ?>
78 </BODY></HTML>