306f91488706e083b83199817653cfc59a8b384b
[squirrelmail.git] / src / options_folder.php
1 <?php
2 /**
3 ** options_folder.php
4 **
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
7 **
8 ** Displays all options relating to folders
9 **
10 **/
11
12 session_start();
13
14 if (!isset($config_php))
15 include("../config/config.php");
16 if (!isset($strings_php))
17 include("../functions/strings.php");
18 if (!isset($page_header_php))
19 include("../functions/page_header.php");
20 if (!isset($display_messages_php))
21 include("../functions/display_messages.php");
22 if (!isset($imap_php))
23 include("../functions/imap.php");
24 if (!isset($array_php))
25 include("../functions/array.php");
26 if (!isset($i18n_php))
27 include("../functions/i18n.php");
28
29 include("../src/load_prefs.php");
30 displayPageHeader($color, "None");
31
32 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
33 $boxes = sqimap_mailbox_list($imapConnection, $boxes);
34 sqimap_logout($imapConnection);
35 ?>
36 <table width=100% align=center border=0 cellpadding=2 cellspacing=0><tr><td bgcolor="<? echo $color[0] ?>">
37 <center><b><? echo _("Options") . " - " . _("Folder Preferences"); ?></b></center>
38 </td></tr></table>
39
40 <form action="options.php" method=post>
41 <table width=100% cellpadding=0 cellspacing=2 border=0>
42
43 <? if ($show_prefix_option == true) { ?>
44 <tr>
45 <td align=right nowrap><? echo _("Folder Path"); ?>:
46 </td><td>
47 <? if (isset ($folder_prefix))
48 echo " <input type=text name=folderprefix value=\"$folder_prefix\" size=50><br>";
49 else
50 echo " <input type=text name=folderprefix value=\"$default_folder_prefix\" size=50><br>";
51 ?>
52 </td>
53 </tr>
54 <? }
55
56 // TRASH FOLDER
57 echo "<tr><td nowrap align=right>";
58 echo _("Trash Folder:");
59 echo "</td><td>";
60 echo "<TT><SELECT NAME=trash>\n";
61 if ($move_to_trash == true)
62 echo "<option value=none>" . _("Don't use Trash");
63 else
64 echo "<option value=none selected>" . _("Do not use Trash");
65
66 for ($i = 0; $i < count($boxes); $i++) {
67 $use_folder = true;
68 if (strtolower($boxes[$i]["unformatted"]) == "inbox") {
69 $use_folder = false;
70 }
71 if ($use_folder == true) {
72 $box = $boxes[$i]["unformatted-dm"];
73 $box2 = replace_spaces($boxes[$i]["formatted"]);
74 if (($boxes[$i]["unformatted"] == $trash_folder) && ($move_to_trash == true))
75 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
76 else
77 echo " <OPTION VALUE=\"$box\">$box2\n";
78 }
79 }
80 echo "</SELECT></TT>\n";
81 echo "</td></tr>";
82
83
84 // SENT FOLDER
85 echo "<tr><td nowrap align=right>";
86 echo _("Sent Folder:");
87 echo "</td><td>";
88 echo "<TT><SELECT NAME=sent>\n";
89 if ($move_to_sent == true)
90 echo "<option value=none>" . _("Don't use Sent");
91 else
92 echo "<option value=none selected>" . _("Do not use Sent");
93
94 for ($i = 0; $i < count($boxes); $i++) {
95 $use_folder = true;
96 if (strtolower($boxes[$i]["unformatted"]) == "inbox") {
97 $use_folder = false;
98 }
99 if ($use_folder == true) {
100 $box = $boxes[$i]["unformatted-dm"];
101 $box2 = replace_spaces($boxes[$i]["formatted"]);
102 if (($boxes[$i]["unformatted"] == $sent_folder) && ($move_to_sent == true))
103 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
104 else
105 echo " <OPTION VALUE=\"$box\">$box2\n";
106 }
107 }
108 echo "</SELECT></TT>\n";
109 echo "</td></tr>";
110 ?>
111 <tr>
112 <td>&nbsp;
113 </td><td>
114 <input type="submit" value="Submit" name="submit_folder">
115 </td>
116 </tr>
117 </table>
118 </form>
119 </body></html>