Fixed collapsable folder stuff so that it actually works!
[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 <tr>
107 <td valign=top align=right>
108 <?php echo _("Unseen message notification"); ?>:
109 </td>
110 <td>
111 <input type=radio name=unseennotify value=1<?php if ($unseen_notify == 1) echo " checked"; ?>> <?php echo _("No notification") ?><br>
112 <input type=radio name=unseennotify value=2<?php if ($unseen_notify != 1 && $unseen_notify != 3) echo " checked"; ?>> <?php echo _("Only INBOX") ?><br>
113 <input type=radio name=unseennotify value=3<?php if ($unseen_notify == 3) echo " checked"; ?>> <?php echo _("All Folders") ?><br>
114 </td>
115 </tr>
116 <tr>
117 <td valign=top align=right>
118 <?php echo _("Unseen message notification type"); ?>:
119 </td>
120 <td>
121 <input type=radio name=unseentype value=1<?php if ($unseen_type < 2 || $unseen_type > 2) echo " checked"; ?>> <?php echo _("Only unseen"); ?> - (4)<br>
122 <input type=radio name=unseentype value=2<?php if ($unseen_type == 2) echo " checked"; ?>> <?php echo _("Unseen and Total"); ?> - (4/27)
123 </td>
124 </tr>
125 <tr>
126 <td valign=top align=right>
127 <?php echo _("Collapseable folders"); ?>:
128 </td>
129 <td>
130 <input type=checkbox name=collapsefolders <?php if (isset($collapse_folders) && $collapse_folders) echo " checked"; ?>>
131 <?php echo _("Enable Collapseable Folders"); ?>
132 </td>
133 </tr>
134 <?php do_hook("options_folders_inside"); ?>
135 <tr>
136 <td>&nbsp;
137 </td><td>
138 <input type="submit" value="<?php echo _("Submit"); ?>" name="submit_folder">
139 </td>
140 </tr>
141 </table>
142 </form>
143
144 <?php do_hook('options_folders_bottom'); ?>
145
146 </td></tr>
147 </table>
148
149 </td></tr>
150 </table>
151 </body></html>