Link to resume composing a draft email.
[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 ** $Id$
11 **/
12
13 require_once('../src/validate.php');
14 require_once('../functions/display_messages.php');
15 require_once('../functions/imap.php');
16 require_once('../functions/array.php');
17 require_once('../functions/plugin.php');
18
19 displayPageHeader($color, 'None');
20
21 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
22 $boxes = sqimap_mailbox_list($imapConnection);
23 sqimap_logout($imapConnection);
24 ?>
25 <br>
26 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
27 <tr><td bgcolor="<?php echo $color[0] ?>" align="center">
28
29 <b><?php echo _("Options") . " - " . _("Folder Preferences"); ?></b>
30
31 <table width="100%" border="0" cellpadding="1" cellspacing="1">
32 <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
33
34 <form name="f" action="options.php" method="post"><br>
35
36 <table width="100%" cellpadding="2" cellspacing="0" border="0">
37
38 <?php if ($show_prefix_option == true) { ?>
39 <tr>
40 <td align=right nowrap><?php echo _("Folder Path"); ?>:
41 </td><td>
42 <?php if (isset ($folder_prefix))
43 echo ' <input type="text" name="folderprefix" value="'.$folder_prefix.'" size="35"><br>';
44 else
45 echo ' <input type="text" name="folderprefix" value="'.$default_folder_prefix.'" size="35"><br>';
46 ?>
47 </td>
48 </tr>
49 <?php }
50
51 // TRASH FOLDER
52 echo '<tr><td nowrap align="right">';
53 echo _("Trash Folder:");
54 echo '</td><td>';
55 echo "<TT><SELECT NAME=trash>\n";
56 if ($move_to_trash == true)
57 echo '<option value="none">' . _("Don't use Trash");
58 else
59 echo '<option value="none" selected>' . _("Do not use Trash");
60
61 for ($i = 0; $i < count($boxes); $i++) {
62 $use_folder = true;
63 if (strtolower($boxes[$i]['unformatted']) == 'inbox') {
64 $use_folder = false;
65 }
66 if ($use_folder == true) {
67 $box = $boxes[$i]['unformatted-dm'];
68 $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['formatted']);
69 if (($boxes[$i]['unformatted'] == $trash_folder) && ($move_to_trash == true))
70 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
71 else
72 echo " <OPTION VALUE=\"$box\">$box2\n";
73 }
74 }
75 echo "</SELECT></TT>\n";
76 echo '</td></tr>';
77
78
79 // SENT FOLDER
80 echo '<tr><td nowrap align="right">';
81 echo _("Sent Folder:");
82 echo '</td><td>';
83 echo '<TT><SELECT NAME="sent">' . "\n";
84 if ($move_to_sent == true)
85 echo '<option value="none">' . _("Don't use Sent");
86 else
87 echo "<option value=none selected>" . _("Do not use Sent");
88
89 for ($i = 0; $i < count($boxes); $i++) {
90 $use_folder = true;
91 if (strtolower($boxes[$i]['unformatted']) == 'inbox') {
92 $use_folder = false;
93 }
94 if ($use_folder == true) {
95 $box = $boxes[$i]['unformatted-dm'];
96 $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['formatted']);
97 if (($boxes[$i]['unformatted'] == $sent_folder) && ($move_to_sent == true))
98 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
99 else
100 echo " <OPTION VALUE=\"$box\">$box2\n";
101 }
102 }
103 echo "</SELECT></TT>\n";
104 echo '</td></tr>';
105
106 // Drafts Folder
107 echo '<tr><td nowrap align="right">';
108 echo _("Drafts Folder:");
109 echo '</td><td>';
110 echo '<TT><SELECT NAME="draft">';
111 if ($save_as_draft == true)
112 echo '<option value="none">' . _("Don't use drafts");
113 else
114 echo '<option value="none selected">' . _("Do not use Drafts");
115
116 for ($i = 0; $i < count($boxes); $i++) {
117 $use_folder = true;
118 if (strtolower($boxes[$i]['unformatted']) == 'inbox') {
119 $use_folder = false;
120 }
121 if ($use_folder == true) {
122 $box = $boxes[$i]['unformatted-dm'];
123 $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['formatted']);
124 $select_draft_value = rtrim($boxes[$i]['unformatted']);
125 if (($select_draft_value == $draft_folder) && ($save_as_draft == true)) {
126 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
127 } else {
128 echo " <OPTION VALUE=\"$box\">$box2\n";
129 }
130 }
131 }
132 echo "</SELECT></TT>\n";
133 echo '</td></tr>';
134 ?>
135 <tr>
136 <td valign=top align=right>
137 <?php echo _("Unseen message notification"); ?>:
138 </td>
139 <td>
140 <input type=radio name=unseennotify value=1<?php if ($unseen_notify == 1) echo " checked"; ?>> <?php echo _("No notification") ?><br>
141 <input type=radio name=unseennotify value=2<?php if ($unseen_notify != 1 && $unseen_notify != 3) echo " checked"; ?>> <?php echo _("Only INBOX") ?><br>
142 <input type=radio name=unseennotify value=3<?php if ($unseen_notify == 3) echo " checked"; ?>> <?php echo _("All Folders") ?><br>
143 </td>
144 </tr>
145 <tr>
146 <td valign=top align=right>
147 <?php echo _("Unseen message notification type"); ?>:
148 </td>
149 <td>
150 <input type=radio name=unseentype value=1<?php if ($unseen_type < 2 || $unseen_type > 2) echo " checked"; ?>> <?php echo _("Only unseen"); ?> - (4)<br>
151 <input type=radio name=unseentype value=2<?php if ($unseen_type == 2) echo " checked"; ?>> <?php echo _("Unseen and Total"); ?> - (4/27)
152 </td>
153 </tr>
154 <tr>
155 <td valign=top align=right>
156 <?php echo _("Collapseable folders"); ?>:
157 </td>
158 <td>
159 <input type=checkbox name=collapsefolders <?php if (isset($collapse_folders) && $collapse_folders) echo " checked"; ?>>
160 <?php echo _("Enable Collapseable Folders"); ?>
161 </td>
162 </tr>
163 <?php do_hook("options_folders_inside"); ?>
164 <tr>
165 <td>&nbsp;
166 </td><td>
167 <input type="submit" value="<?php echo _("Submit"); ?>" name="submit_folder">
168 </td>
169 </tr>
170 </table>
171 </form>
172
173 <?php do_hook('options_folders_bottom'); ?>
174
175 </td></tr>
176 </table>
177
178 </td></tr>
179 </table>
180 </body></html>