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