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