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 | |
bbcafebd |
52 | |
b5efadfa |
53 | /* Build a simple array into which we will build options. */ |
bbcafebd |
54 | $optgrps = array(); |
b5efadfa |
55 | $optvals = array(); |
56 | |
bbcafebd |
57 | /******************************************************/ |
58 | /* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */ |
59 | /******************************************************/ |
60 | define('SMOPT_GRP_SPCFOLDER', 0); |
61 | define('SMOPT_GRP_FOLDERLIST', 1); |
62 | |
63 | /*** Load the General Options into the array ***/ |
64 | $optgrps[SMOPT_GRP_SPCFOLDER] = _("Special Folder Options"); |
65 | $optvals[SMOPT_GRP_SPCFOLDER] = array(); |
66 | |
b5efadfa |
67 | $special_folder_values = array(); |
68 | foreach ($boxes as $folder) { |
69 | if (strtolower($folder['unformatted']) != 'inbox') { |
70 | $real_value = $folder['unformatted-dm']; |
71 | $disp_value = str_replace(' ', ' ', $folder['formatted']); |
72 | $special_folder_values[$real_value] = $disp_value; |
73 | } |
74 | } |
75 | |
76 | $trash_none = array(SMPREF_NONE => _("Do not use Trash")); |
77 | $trash_folder_values = array_merge($trash_none, $special_folder_values); |
bbcafebd |
78 | $optvals[SMOPT_GRP_SPCFOLDER][] = array( |
b5efadfa |
79 | 'name' => 'trash_folder', |
80 | 'caption' => _("Trash Folder"), |
81 | 'type' => SMOPT_TYPE_STRLIST, |
82 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
83 | 'posvals' => $trash_folder_values |
84 | ); |
85 | |
86 | $sent_none = array(SMPREF_NONE => _("Do not use Sent")); |
87 | $sent_folder_values = array_merge($sent_none, $special_folder_values); |
bbcafebd |
88 | $optvals[SMOPT_GRP_SPCFOLDER][] = array( |
b5efadfa |
89 | 'name' => 'sent_folder', |
90 | 'caption' => _("Sent Folder"), |
91 | 'type' => SMOPT_TYPE_STRLIST, |
92 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
93 | 'posvals' => $sent_folder_values |
94 | ); |
95 | |
96 | $drafts_none = array(SMPREF_NONE => _("Do not use Drafts")); |
97 | $draft_folder_values = array_merge($draft_none, $special_folder_values); |
bbcafebd |
98 | $optvals[SMOPT_GRP_SPCFOLDER][] = array( |
b5efadfa |
99 | 'name' => 'draft_folder', |
100 | 'caption' => _("Draft Folder"), |
101 | 'type' => SMOPT_TYPE_STRLIST, |
102 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
103 | 'posvals' => $draft_folder_values |
104 | ); |
105 | |
bbcafebd |
106 | /*** Load the General Options into the array ***/ |
107 | $optgrps[SMOPT_GRP_FOLDERLIST] = _("Folder List Options"); |
108 | $optvals[SMOPT_GRP_FOLDERLIST] = array(); |
109 | |
110 | $optvals[SMOPT_GRP_FOLDERLIST][] = array( |
a440e68f |
111 | 'name' => 'location_of_bar', |
112 | 'caption' => _("Location of Folder List"), |
113 | 'type' => SMOPT_TYPE_STRLIST, |
114 | 'refresh' => SMOPT_REFRESH_ALL, |
115 | 'posvals' => array(SMPREF_LOC_LEFT => _("Left"), |
116 | SMPREF_LOC_RIGHT => _("Right")) |
117 | ); |
118 | |
119 | $left_size_values = array(); |
120 | for ($lsv = 100; $lsv <= 300; $lsv += 10) { |
121 | $left_size_values[$lsv] = "$lsv " . _("pixels"); |
122 | } |
bbcafebd |
123 | $optvals[SMOPT_GRP_FOLDERLIST][] = array( |
a440e68f |
124 | 'name' => 'left_size', |
125 | 'caption' => _("Width of Folder List"), |
126 | 'type' => SMOPT_TYPE_STRLIST, |
127 | 'refresh' => SMOPT_REFRESH_ALL, |
128 | 'posvals' => $left_size_values |
129 | ); |
130 | |
131 | $minute_str = _("Minutes"); |
132 | $left_refresh_values = array(SMPREF_NONE => _("Never")); |
133 | foreach (array(30,60,120,180,300,600) as $lr_val) { |
134 | if ($lr_val < 60) { |
135 | $left_refresh_values[$lr_val] = "$lr_val " . _("Seconds"); |
136 | } else if ($lr_val == 60) { |
137 | $left_refresh_values[$lr_val] = "1 " . _("Minute"); |
138 | } else { |
139 | $left_refresh_values[$lr_val] = ($lr_val/60) . " $minute_str"; |
140 | } |
141 | } |
bbcafebd |
142 | $optvals[SMOPT_GRP_FOLDERLIST][] = array( |
a440e68f |
143 | 'name' => 'left_refresh', |
144 | 'caption' => _("Auto Refresh Folder List"), |
145 | 'type' => SMOPT_TYPE_STRLIST, |
146 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
147 | 'posvals' => $left_refresh_values |
148 | ); |
149 | |
bbcafebd |
150 | $optvals[SMOPT_GRP_FOLDERLIST][] = array( |
a440e68f |
151 | 'name' => 'unseen_notify', |
152 | 'caption' => _("Enable Unseen Message Notification"), |
153 | 'type' => SMOPT_TYPE_STRLIST, |
154 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
155 | 'posvals' => array(SMPREF_UNSEEN_NONE => _("No Notification"), |
156 | SMPREF_UNSEEN_INBOX => _("Only INBOX"), |
157 | SMPREF_UNSEEN_ALL => _("All Folders")) |
158 | ); |
159 | |
bbcafebd |
160 | $optvals[SMOPT_GRP_FOLDERLIST][] = array( |
a440e68f |
161 | 'name' => 'unseen_type', |
162 | 'caption' => _("Unseen Message Notification Type"), |
163 | 'type' => SMOPT_TYPE_STRLIST, |
164 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
165 | 'posvals' => array(SMPREF_UNSEEN_ONLY => _("Only Unseen"), |
166 | SMPREF_UNSEEN_TOTAL => _("Unseen and Total")) |
167 | ); |
168 | |
bbcafebd |
169 | $optvals[SMOPT_GRP_FOLDERLIST][] = array( |
a440e68f |
170 | 'name' => 'collapse_folders', |
171 | 'caption' => _("Enable Collapsable Folders"), |
172 | 'type' => SMOPT_TYPE_BOOLEAN, |
173 | 'refresh' => SMOPT_REFRESH_FOLDERLIST |
174 | ); |
175 | |
bbcafebd |
176 | $optvals[SMOPT_GRP_FOLDERLIST][] = array( |
a440e68f |
177 | 'name' => 'date_format', |
178 | 'caption' => _("Show Clock on Folders Panel"), |
179 | 'type' => SMOPT_TYPE_STRLIST, |
180 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
181 | 'posvals' => array( '1' => 'MM/DD/YY HH:MM', |
182 | '2' => 'DD/MM/YY HH:MM', |
183 | '3' => 'DDD, HH:MM', |
184 | '4' => 'HH:MM:SS', |
185 | '5' => 'HH:MM', |
186 | '6' => _("No Clock")), |
187 | ); |
188 | |
bbcafebd |
189 | $optvals[SMOPT_GRP_FOLDERLIST][] = array( |
a440e68f |
190 | 'name' => 'hour_format', |
191 | 'caption' => _("Hour Format"), |
192 | 'type' => SMOPT_TYPE_STRLIST, |
193 | 'refresh' => SMOPT_REFRESH_FOLDERLIST, |
194 | 'posvals' => array(SMPREF_TIME_12HR => _("12-hour clock"), |
195 | SMPREF_TIME_24HR => _("24-hour clock")) |
196 | ); |
197 | |
198 | |
bbcafebd |
199 | /* Build and output the option groups. */ |
200 | $option_groups = createOptionGroups($optgrps, $optvals); |
201 | printOptionGroups($option_groups); |
2016e645 |
202 | |
bbcafebd |
203 | echo '<TR><TD ALIGN="CENTER" VALIGN="MIDDLE" COLSPAN="2" NOWRAP><B>' |
204 | . _("Plugin Options") . "</B></TD></TR>\n"; |
205 | OptionSubmit( 'submit_folder' ); |
2016e645 |
206 | ?> |
207 | |
c36ed9cf |
208 | </table> |
209 | </form> |
e7db48af |
210 | |
e8e0acdf |
211 | <?php do_hook('options_folders_bottom'); ?> |
e7db48af |
212 | |
213 | </td></tr> |
214 | </table> |
215 | |
216 | </td></tr> |
217 | </table> |
b5efadfa |
218 | </body></html> |