Operation "foo_once".
[squirrelmail.git] / src / options_folder.php
CommitLineData
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
f740c049 13 include('../src/validate.php');
f740c049 14 include('../functions/display_messages.php');
15 include('../functions/imap.php');
16 include('../functions/array.php');
f740c049 17 include('../functions/plugin.php');
f740c049 18
e8e0acdf 19 displayPageHeader($color, 'None');
c36ed9cf 20
21 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
4ebfe18a 22 $boxes = sqimap_mailbox_list($imapConnection);
1195c340 23 sqimap_logout($imapConnection);
c36ed9cf 24?>
e9f8ea4e 25 <br>
e7db48af 26<table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
27<tr><td bgcolor="<?php echo $color[0] ?>" align="center">
c36ed9cf 28
e7db48af 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">
c36ed9cf 37
6170c5b6 38<?php if ($show_prefix_option == true) { ?>
c36ed9cf 39 <tr>
6170c5b6 40 <td align=right nowrap><?php echo _("Folder Path"); ?>:
c36ed9cf 41 </td><td>
6170c5b6 42<?php if (isset ($folder_prefix))
e8e0acdf 43 echo ' <input type="text" name="folderprefix" value="'.$folder_prefix.'" size="35"><br>';
c36ed9cf 44 else
e8e0acdf 45 echo ' <input type="text" name="folderprefix" value="'.$default_folder_prefix.'" size="35"><br>';
c36ed9cf 46?>
47 </td>
48 </tr>
6170c5b6 49<?php }
c36ed9cf 50
51 // TRASH FOLDER
e8e0acdf 52 echo '<tr><td nowrap align="right">';
c36ed9cf 53 echo _("Trash Folder:");
e8e0acdf 54 echo '</td><td>';
c36ed9cf 55 echo "<TT><SELECT NAME=trash>\n";
56 if ($move_to_trash == true)
e8e0acdf 57 echo '<option value="none">' . _("Don't use Trash");
c36ed9cf 58 else
e8e0acdf 59 echo '<option value="none" selected>' . _("Do not use Trash");
c36ed9cf 60
61 for ($i = 0; $i < count($boxes); $i++) {
62 $use_folder = true;
adb5d89e 63 if (strtolower($boxes[$i]['unformatted']) == 'inbox') {
c36ed9cf 64 $use_folder = false;
65 }
66 if ($use_folder == true) {
e8e0acdf 67 $box = $boxes[$i]['unformatted-dm'];
235a65d5 68 $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['formatted']);
e8e0acdf 69 if (($boxes[$i]['unformatted'] == $trash_folder) && ($move_to_trash == true))
c36ed9cf 70 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
71 else
72 echo " <OPTION VALUE=\"$box\">$box2\n";
73 }
74 }
75 echo "</SELECT></TT>\n";
e8e0acdf 76 echo '</td></tr>';
c36ed9cf 77
78
79 // SENT FOLDER
e8e0acdf 80 echo '<tr><td nowrap align="right">';
c36ed9cf 81 echo _("Sent Folder:");
e8e0acdf 82 echo '</td><td>';
83 echo '<TT><SELECT NAME="sent">' . "\n";
c36ed9cf 84 if ($move_to_sent == true)
e8e0acdf 85 echo '<option value="none">' . _("Don't use Sent");
c36ed9cf 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;
e8e0acdf 91 if (strtolower($boxes[$i]['unformatted']) == 'inbox') {
c36ed9cf 92 $use_folder = false;
93 }
94 if ($use_folder == true) {
e8e0acdf 95 $box = $boxes[$i]['unformatted-dm'];
235a65d5 96 $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['formatted']);
e8e0acdf 97 if (($boxes[$i]['unformatted'] == $sent_folder) && ($move_to_sent == true))
c36ed9cf 98 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
99 else
100 echo " <OPTION VALUE=\"$box\">$box2\n";
101 }
102 }
103 echo "</SELECT></TT>\n";
e8e0acdf 104 echo '</td></tr>';
c36ed9cf 105?>
106 <tr>
24fc5dd2 107 <td valign=top align=right>
6170c5b6 108 <?php echo _("Unseen message notification"); ?>:
24fc5dd2 109 </td>
110 <td>
6170c5b6 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>
24fc5dd2 114 </td>
115 </tr>
116 <tr>
117 <td valign=top align=right>
6170c5b6 118 <?php echo _("Unseen message notification type"); ?>:
24fc5dd2 119 </td>
235a65d5 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>
5c42b0dd 122 <input type=radio name=unseentype value=2<?php if ($unseen_type == 2) echo " checked"; ?>> <?php echo _("Unseen and Total"); ?> - (4/27)
0cd84d75 123 </td>
124 </tr>
235a65d5 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>
ef3c69f0 134 <?php do_hook("options_folders_inside"); ?>
24fc5dd2 135 <tr>
c36ed9cf 136 <td>&nbsp;
137 </td><td>
32f4685b 138 <input type="submit" value="<?php echo _("Submit"); ?>" name="submit_folder">
c36ed9cf 139 </td>
140 </tr>
141 </table>
142 </form>
e7db48af 143
e8e0acdf 144 <?php do_hook('options_folders_bottom'); ?>
e7db48af 145
146 </td></tr>
147 </table>
148
149</td></tr>
150</table>
c36ed9cf 151</body></html>