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