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