Fixed bug #479867 - Turning Sqclock Off Not Working
[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
ff8a98e7 13 require_once('../src/validate.php');
14 require_once('../functions/display_messages.php');
15 require_once('../functions/imap.php');
16 require_once('../functions/array.php');
17 require_once('../functions/plugin.php');
2016e645 18 require_once('../functions/options.php');
f740c049 19
e8e0acdf 20 displayPageHeader($color, 'None');
c36ed9cf 21
22 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
4ebfe18a 23 $boxes = sqimap_mailbox_list($imapConnection);
1195c340 24 sqimap_logout($imapConnection);
c36ed9cf 25?>
e9f8ea4e 26 <br>
e7db48af 27<table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
28<tr><td bgcolor="<?php echo $color[0] ?>" align="center">
c36ed9cf 29
e7db48af 30 <b><?php echo _("Options") . " - " . _("Folder Preferences"); ?></b>
31
32 <table width="100%" border="0" cellpadding="1" cellspacing="1">
33 <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
34
35 <form name="f" action="options.php" method="post"><br>
36
37 <table width="100%" cellpadding="2" cellspacing="0" border="0">
c36ed9cf 38
6170c5b6 39<?php if ($show_prefix_option == true) { ?>
c36ed9cf 40 <tr>
6170c5b6 41 <td align=right nowrap><?php echo _("Folder Path"); ?>:
c36ed9cf 42 </td><td>
6170c5b6 43<?php if (isset ($folder_prefix))
e8e0acdf 44 echo ' <input type="text" name="folderprefix" value="'.$folder_prefix.'" size="35"><br>';
c36ed9cf 45 else
e8e0acdf 46 echo ' <input type="text" name="folderprefix" value="'.$default_folder_prefix.'" size="35"><br>';
c36ed9cf 47?>
48 </td>
49 </tr>
6170c5b6 50<?php }
c36ed9cf 51
f7b1b3b1 52 /* TRASH FOLDER */
e8e0acdf 53 echo '<tr><td nowrap align="right">';
c36ed9cf 54 echo _("Trash Folder:");
e8e0acdf 55 echo '</td><td>';
c36ed9cf 56 echo "<TT><SELECT NAME=trash>\n";
f7b1b3b1 57 if ($move_to_trash == true) {
58 echo '<option value="none">' . _("Do not use Trash");
59 } else {
e8e0acdf 60 echo '<option value="none" selected>' . _("Do not use Trash");
f7b1b3b1 61 }
c36ed9cf 62
63 for ($i = 0; $i < count($boxes); $i++) {
64 $use_folder = true;
adb5d89e 65 if (strtolower($boxes[$i]['unformatted']) == 'inbox') {
c36ed9cf 66 $use_folder = false;
67 }
68 if ($use_folder == true) {
e8e0acdf 69 $box = $boxes[$i]['unformatted-dm'];
235a65d5 70 $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['formatted']);
e8e0acdf 71 if (($boxes[$i]['unformatted'] == $trash_folder) && ($move_to_trash == true))
c36ed9cf 72 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
73 else
74 echo " <OPTION VALUE=\"$box\">$box2\n";
75 }
76 }
77 echo "</SELECT></TT>\n";
e8e0acdf 78 echo '</td></tr>';
c36ed9cf 79
80
f7b1b3b1 81 /* SENT FOLDER */
e8e0acdf 82 echo '<tr><td nowrap align="right">';
c36ed9cf 83 echo _("Sent Folder:");
e8e0acdf 84 echo '</td><td>';
85 echo '<TT><SELECT NAME="sent">' . "\n";
c36ed9cf 86 if ($move_to_sent == true)
f7b1b3b1 87 echo '<option value="none">' . _("Do not use Sent");
c36ed9cf 88 else
8a09fdfa 89 echo "<option value=\"none\" selected>" . _("Do not use Sent");
c36ed9cf 90
91 for ($i = 0; $i < count($boxes); $i++) {
92 $use_folder = true;
e8e0acdf 93 if (strtolower($boxes[$i]['unformatted']) == 'inbox') {
c36ed9cf 94 $use_folder = false;
95 }
96 if ($use_folder == true) {
e8e0acdf 97 $box = $boxes[$i]['unformatted-dm'];
235a65d5 98 $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['formatted']);
e8e0acdf 99 if (($boxes[$i]['unformatted'] == $sent_folder) && ($move_to_sent == true))
c36ed9cf 100 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
101 else
102 echo " <OPTION VALUE=\"$box\">$box2\n";
103 }
104 }
105 echo "</SELECT></TT>\n";
e8e0acdf 106 echo '</td></tr>';
9322386e 107
f7b1b3b1 108 /* Drafts Folder. */
9322386e 109 echo '<tr><td nowrap align="right">';
110 echo _("Drafts Folder:");
111 echo '</td><td>';
112 echo '<TT><SELECT NAME="draft">';
113 if ($save_as_draft == true)
f7b1b3b1 114 echo '<option value="none">' . _("Do not use Drafts");
9322386e 115 else
8a09fdfa 116 echo '<option value="none" selected>' . _("Do not use Drafts");
9322386e 117
118 for ($i = 0; $i < count($boxes); $i++) {
119 $use_folder = true;
120 if (strtolower($boxes[$i]['unformatted']) == 'inbox') {
121 $use_folder = false;
122 }
123 if ($use_folder == true) {
124 $box = $boxes[$i]['unformatted-dm'];
125 $box2 = str_replace(' ', '&nbsp;', $boxes[$i]['formatted']);
126 $select_draft_value = rtrim($boxes[$i]['unformatted']);
127 if (($select_draft_value == $draft_folder) && ($save_as_draft == true)) {
128 echo " <OPTION SELECTED VALUE=\"$box\">$box2\n";
129 } else {
130 echo " <OPTION VALUE=\"$box\">$box2\n";
131 }
132 }
133 }
134 echo "</SELECT></TT>\n";
135 echo '</td></tr>';
2016e645 136 // if( $unseen_notify == '' )
137 // $unseen_notify = '2';
138 OptionRadio( _("Unseen message notification"),
139 'unseennotify',
140 array( 1 => _("No notification"),
141 2 => _("Only INBOX"),
142 3 => _("All Folders") ),
143 $unseen_notify, '', '',
144 '<br>' );
145 OptionRadio( _("Unseen message notification type"),
146 'unseentype',
147 array( 1 => _("Only unseen"),
148 2 => _("Unseen and Total") ),
149 $unseen_type, '', '',
150 '<br>' );
151 OptionCheck( _("Collapseable folders"),
152 'collapsefolders',
153 $collapse_folders,
154 _("Enable Collapseable Folders") );
155 OptionSelect( '<b>' . _("Show Clock on Folders Panel") . '</b> ' . _("Date format"),
156 'dateformat',
157 array( '1' => 'MM/DD/YY HH:MM',
158 '2' => 'DD/MM/YY HH:MM',
159 '3' => 'DDD, HH:MM',
160 '4' => 'HH:MM:SS',
161 '5' => 'HH:MM',
162 '6' => _("No Clock") ),
163 $date_format );
164 OptionSelect( _("Hour format"),
165 'hourformat',
166 array( '1' => _("24-hour clock"),
167 '2' => _("12-hour clock") ),
168 $hour_format );
169
170 echo '<tr><td colspan=2><hr noshade></td></tr>';
171 do_hook("options_folders_inside");
84c18709 172 OptionSubmit( 'submit_folder' );
2016e645 173?>
174
c36ed9cf 175 </table>
176 </form>
e7db48af 177
e8e0acdf 178 <?php do_hook('options_folders_bottom'); ?>
e7db48af 179
180 </td></tr>
181 </table>
182
183</td></tr>
184</table>
2016e645 185</body></html>