commit | author | age
|
4e17e6
|
1 |
<?php |
T |
2 |
|
|
3 |
/* |
|
4 |
+-----------------------------------------------------------------------+ |
|
5 |
| program/steps/settings/func.inc | |
|
6 |
| | |
e019f2
|
7 |
| This file is part of the Roundcube Webmail client | |
438753
|
8 |
| Copyright (C) 2005-2012, The Roundcube Dev Team | |
7fe381
|
9 |
| | |
T |
10 |
| Licensed under the GNU General Public License version 3 or | |
|
11 |
| any later version with exceptions for skins & plugins. | |
|
12 |
| See the README file for a full license statement. | |
4e17e6
|
13 |
| | |
T |
14 |
| PURPOSE: | |
|
15 |
| Provide functionality for user's settings & preferences | |
|
16 |
| | |
|
17 |
+-----------------------------------------------------------------------+ |
|
18 |
| Author: Thomas Bruederli <roundcube@gmail.com> | |
|
19 |
+-----------------------------------------------------------------------+ |
|
20 |
|
|
21 |
$Id$ |
|
22 |
|
|
23 |
*/ |
|
24 |
|
681969
|
25 |
if (!$OUTPUT->ajax_call) |
A |
26 |
$OUTPUT->set_pagetitle(rcube_label('preferences')); |
4e17e6
|
27 |
|
b19097
|
28 |
|
f05834
|
29 |
// similar function as /steps/settings/identities.inc::rcmail_identity_frame() |
A |
30 |
function rcmail_preferences_frame($attrib) |
d11fb2
|
31 |
{ |
f05834
|
32 |
global $OUTPUT; |
cb3538
|
33 |
|
f05834
|
34 |
if (!$attrib['id']) |
A |
35 |
$attrib['id'] = 'rcmprefsframe'; |
35c31e
|
36 |
|
f05834
|
37 |
$attrib['name'] = $attrib['id']; |
35c31e
|
38 |
|
f05834
|
39 |
$OUTPUT->set_env('contentframe', $attrib['name']); |
A |
40 |
$OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif'); |
f8e8af
|
41 |
|
f05834
|
42 |
return html::iframe($attrib); |
d11fb2
|
43 |
} |
f05834
|
44 |
|
A |
45 |
|
|
46 |
function rcmail_sections_list($attrib) |
d11fb2
|
47 |
{ |
49771b
|
48 |
global $RCMAIL; |
f8e8af
|
49 |
|
f05834
|
50 |
// add id to message list table if not specified |
A |
51 |
if (!strlen($attrib['id'])) |
|
52 |
$attrib['id'] = 'rcmsectionslist'; |
|
53 |
|
49771b
|
54 |
list($list, $cols) = rcmail_user_prefs(); |
f8e8af
|
55 |
|
f05834
|
56 |
// create XHTML table |
49771b
|
57 |
$out = rcube_table_output($attrib, $list, $cols, 'id'); |
f05834
|
58 |
|
A |
59 |
// set client env |
|
60 |
$RCMAIL->output->add_gui_object('sectionslist', $attrib['id']); |
|
61 |
$RCMAIL->output->include_script('list.js'); |
|
62 |
|
35c31e
|
63 |
return $out; |
d11fb2
|
64 |
} |
4e17e6
|
65 |
|
T |
66 |
|
|
67 |
function rcmail_identities_list($attrib) |
d11fb2
|
68 |
{ |
a90ad2
|
69 |
global $OUTPUT, $RCMAIL; |
4e17e6
|
70 |
|
T |
71 |
// add id to message list table if not specified |
|
72 |
if (!strlen($attrib['id'])) |
|
73 |
$attrib['id'] = 'rcmIdentitiesList'; |
|
74 |
|
54759c
|
75 |
// get identities list and define 'mail' column |
a90ad2
|
76 |
$list = $RCMAIL->user->list_identities(); |
54759c
|
77 |
foreach ($list as $idx => $row) |
e8d5bd
|
78 |
$list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_idn_to_utf8($row['email']) .'>'); |
54759c
|
79 |
|
3ca3bd
|
80 |
// get all identites from DB and define list of cols to be displayed |
e6ce00
|
81 |
$plugin = $RCMAIL->plugins->exec_hook('identities_list', array( |
54759c
|
82 |
'list' => $list, |
A |
83 |
'cols' => array('mail'))); |
4e17e6
|
84 |
|
54759c
|
85 |
// @TODO: use <UL> instead of <TABLE> for identities list |
A |
86 |
// create XHTML table |
3ca3bd
|
87 |
$out = rcube_table_output($attrib, $plugin['list'], $plugin['cols'], 'identity_id'); |
54759c
|
88 |
|
4e17e6
|
89 |
// set client env |
f11541
|
90 |
$OUTPUT->add_gui_object('identitieslist', $attrib['id']); |
4e17e6
|
91 |
|
T |
92 |
return $out; |
d11fb2
|
93 |
} |
4e17e6
|
94 |
|
T |
95 |
|
|
96 |
// similar function as in /steps/addressbook/edit.inc |
57f0c8
|
97 |
function get_form_tags($attrib, $action, $id = null, $hidden = null) |
d11fb2
|
98 |
{ |
197601
|
99 |
global $EDIT_FORM, $RCMAIL; |
4e17e6
|
100 |
|
57f0c8
|
101 |
$form_start = $form_end = ''; |
f8e8af
|
102 |
|
57f0c8
|
103 |
if (empty($EDIT_FORM)) { |
T |
104 |
$request_key = $action . (isset($id) ? '.'.$id : ''); |
f05834
|
105 |
$form_start = $RCMAIL->output->request_form(array( |
d11fb2
|
106 |
'name' => 'form', |
A |
107 |
'method' => 'post', |
|
108 |
'task' => $RCMAIL->task, |
|
109 |
'action' => $action, |
|
110 |
'request' => $request_key, |
|
111 |
'noclose' => true |
|
112 |
) + $attrib); |
f8e8af
|
113 |
|
57f0c8
|
114 |
if (is_array($hidden)) { |
T |
115 |
$hiddenfields = new html_hiddenfield($hidden); |
|
116 |
$form_start .= $hiddenfields->show(); |
4e17e6
|
117 |
} |
f8e8af
|
118 |
|
57f0c8
|
119 |
$form_end = !strlen($attrib['form']) ? '</form>' : ''; |
4e17e6
|
120 |
|
57f0c8
|
121 |
$EDIT_FORM = !empty($attrib['form']) ? $attrib['form'] : 'form'; |
T |
122 |
$RCMAIL->output->add_gui_object('editform', $EDIT_FORM); |
|
123 |
} |
4e17e6
|
124 |
|
197601
|
125 |
return array($form_start, $form_end); |
d11fb2
|
126 |
} |
4e17e6
|
127 |
|
ec0171
|
128 |
|
49771b
|
129 |
function rcmail_user_prefs($current=null) |
A |
130 |
{ |
|
131 |
global $RCMAIL; |
|
132 |
|
|
133 |
$sections['general'] = array('id' => 'general', 'section' => rcube_label('uisettings')); |
|
134 |
$sections['mailbox'] = array('id' => 'mailbox', 'section' => rcube_label('mailboxview')); |
|
135 |
$sections['compose'] = array('id' => 'compose', 'section' => rcube_label('messagescomposition')); |
|
136 |
$sections['mailview'] = array('id' => 'mailview','section' => rcube_label('messagesdisplaying')); |
d73448
|
137 |
$sections['addressbook'] = array('id' => 'addressbook','section' => rcube_label('addressbook')); |
49771b
|
138 |
$sections['folders'] = array('id' => 'folders', 'section' => rcube_label('specialfolders')); |
A |
139 |
$sections['server'] = array('id' => 'server', 'section' => rcube_label('serversettings')); |
|
140 |
|
|
141 |
// hook + define list cols |
e6ce00
|
142 |
$plugin = $RCMAIL->plugins->exec_hook('preferences_sections_list', |
49771b
|
143 |
array('list' => $sections, 'cols' => array('section'))); |
A |
144 |
|
|
145 |
$sections = $plugin['list']; |
f8e8af
|
146 |
|
49771b
|
147 |
$config = $RCMAIL->config->all(); |
A |
148 |
$no_override = array_flip($RCMAIL->config->get('dont_override', array())); |
f8e8af
|
149 |
|
49771b
|
150 |
foreach ($sections as $idx => $sect) { |
f8e8af
|
151 |
|
49771b
|
152 |
if ($current && $sect['id'] != $current) |
A |
153 |
continue; |
f8e8af
|
154 |
|
49771b
|
155 |
$blocks = array(); |
f8e8af
|
156 |
|
49771b
|
157 |
switch ($sect['id']) { |
A |
158 |
// general |
|
159 |
case 'general': |
f8e8af
|
160 |
|
49771b
|
161 |
$blocks = array( |
06c990
|
162 |
'main' => array('name' => Q(rcube_label('mainoptions'))), |
A |
163 |
'browser' => array('name' => Q(rcube_label('browseroptions'))), |
49771b
|
164 |
); |
f8e8af
|
165 |
|
49771b
|
166 |
// language selection |
A |
167 |
if (!isset($no_override['language'])) { |
|
168 |
$a_lang = $RCMAIL->list_languages(); |
|
169 |
asort($a_lang); |
|
170 |
|
|
171 |
$field_id = 'rcmfd_lang'; |
|
172 |
$select_lang = new html_select(array('name' => '_language', 'id' => $field_id)); |
|
173 |
$select_lang->add(array_values($a_lang), array_keys($a_lang)); |
|
174 |
|
|
175 |
$blocks['main']['options']['language'] = array( |
|
176 |
'title' => html::label($field_id, Q(rcube_label('language'))), |
|
177 |
'content' => $select_lang->show($RCMAIL->user->language), |
|
178 |
); |
|
179 |
} |
|
180 |
|
08ffd9
|
181 |
// timezone selection |
49771b
|
182 |
if (!isset($no_override['timezone'])) { |
A |
183 |
$field_id = 'rcmfd_timezone'; |
5879c0
|
184 |
$select_timezone = new html_select(array('name' => '_timezone', 'id' => $field_id)); |
49771b
|
185 |
$select_timezone->add(rcube_label('autodetect'), 'auto'); |
5879c0
|
186 |
|
T |
187 |
$now = new DateTime(); |
|
188 |
foreach (DateTimeZone::listIdentifiers() as $i => $tzs) { |
|
189 |
$tz = new DateTimeZone($tzs); |
|
190 |
$date = new DateTime('2012-12-21', $tz); |
|
191 |
$offset = $date->format('Z') + 45000; |
|
192 |
$sortkey = sprintf('%06d.%s', $offset, $tzs); |
|
193 |
$zones[$sortkey] = array($tzs, $date->format('P')); |
|
194 |
} |
|
195 |
|
|
196 |
ksort($zones); |
|
197 |
foreach ($zones as $zone) { |
|
198 |
list($tzs, $offset) = $zone; |
|
199 |
$select_timezone->add('(GMT ' . $offset . ') ' . strtr($tzs, '_', ' '), $tzs); |
|
200 |
} |
|
201 |
|
|
202 |
if (is_numeric($config['timezone'])) |
|
203 |
timezone_name_from_abbr("", $config['timezone'] * 3600, 0); |
49771b
|
204 |
|
A |
205 |
$blocks['main']['options']['timezone'] = array( |
|
206 |
'title' => html::label($field_id, Q(rcube_label('timezone'))), |
|
207 |
'content' => $select_timezone->show((string)$config['timezone']), |
|
208 |
); |
|
209 |
} |
|
210 |
|
1cc9e2
|
211 |
// date/time formatting |
T |
212 |
if (!isset($no_override['time_format'])) { |
|
213 |
$reftime = mktime(7,30,0); |
|
214 |
$field_id = 'rcmfd_time_format'; |
|
215 |
$select_time = new html_select(array('name' => '_time_format', 'id' => $field_id)); |
|
216 |
foreach ((array)$RCMAIL->config->get('time_formats', array('G:i', 'H:i', 'g:i a', 'h:i A')) as $choice) |
|
217 |
$select_time->add(date($choice, $reftime), $choice); |
|
218 |
|
|
219 |
$blocks['main']['options']['time_format'] = array( |
|
220 |
'title' => html::label($field_id, Q(rcube_label('timeformat'))), |
|
221 |
'content' => $select_time->show($RCMAIL->config->get('time_format')), |
|
222 |
); |
|
223 |
} |
|
224 |
|
|
225 |
if (!isset($no_override['date_format'])) { |
|
226 |
$refdate = mktime(12,30,0,7,24); |
|
227 |
$field_id = 'rcmfd_date_format'; |
|
228 |
$select_date = new html_select(array('name' => '_date_format', 'id' => $field_id)); |
|
229 |
foreach ((array)$RCMAIL->config->get('date_formats', array('Y-m-d','d-m-Y','Y/m/d','m/d/Y','d/m/Y','d.m.Y','j.n.Y')) as $choice) |
|
230 |
$select_date->add(date($choice, $refdate), $choice); |
|
231 |
|
|
232 |
$blocks['main']['options']['date_format'] = array( |
|
233 |
'title' => html::label($field_id, Q(rcube_label('dateformat'))), |
|
234 |
'content' => $select_date->show($config['date_format']), |
|
235 |
); |
|
236 |
} |
|
237 |
|
49771b
|
238 |
// MM: Show checkbox for toggling 'pretty dates' |
A |
239 |
if (!isset($no_override['prettydate'])) { |
|
240 |
$field_id = 'rcmfd_prettydate'; |
|
241 |
$input_prettydate = new html_checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); |
|
242 |
|
|
243 |
$blocks['main']['options']['prettydate'] = array( |
|
244 |
'title' => html::label($field_id, Q(rcube_label('prettydate'))), |
|
245 |
'content' => $input_prettydate->show($config['prettydate']?1:0), |
|
246 |
); |
|
247 |
} |
|
248 |
|
|
249 |
// show drop-down for available skins |
|
250 |
if (!isset($no_override['skin'])) { |
|
251 |
$skins = rcmail_get_skins(); |
|
252 |
|
|
253 |
if (count($skins) > 1) { |
|
254 |
$field_id = 'rcmfd_skin'; |
|
255 |
$input_skin = new html_select(array('name'=>'_skin', 'id'=>$field_id)); |
|
256 |
|
|
257 |
foreach($skins as $skin) |
|
258 |
$input_skin->add($skin, $skin); |
|
259 |
|
|
260 |
$blocks['main']['options']['skin'] = array( |
|
261 |
'title' => html::label($field_id, Q(rcube_label('skin'))), |
|
262 |
'content' => $input_skin->show($config['skin']), |
|
263 |
); |
|
264 |
} |
|
265 |
} |
f8e8af
|
266 |
|
06c990
|
267 |
$product_name = $RCMAIL->config->get('product_name', 'Roundcube Webmail'); |
A |
268 |
$RCMAIL->output->add_script(sprintf("%s.check_protocol_handler('%s', '#mailtoprotohandler');", |
|
269 |
JS_OBJECT_NAME, JQ($product_name)), 'foot'); |
|
270 |
|
|
271 |
$blocks['browser']['options']['mailtoprotohandler'] = array( |
|
272 |
'content' => html::a(array( |
|
273 |
'href' => '#', |
|
274 |
'id' => 'mailtoprotohandler'), Q(rcube_label('mailtoprotohandler'))), |
|
275 |
); |
|
276 |
|
f8e8af
|
277 |
break; |
A |
278 |
|
49771b
|
279 |
// Mailbox view (mail screen) |
A |
280 |
case 'mailbox': |
f8e8af
|
281 |
|
49771b
|
282 |
$blocks = array( |
A |
283 |
'main' => array('name' => Q(rcube_label('mainoptions'))), |
|
284 |
'new_message' => array('name' => Q(rcube_label('newmessage'))), |
|
285 |
); |
|
286 |
|
|
287 |
// show config parameter for preview pane |
|
288 |
if (!isset($no_override['preview_pane'])) { |
|
289 |
$field_id = 'rcmfd_preview'; |
bc4960
|
290 |
$input_preview = new html_checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1, |
81c2ce
|
291 |
'onchange' => "$('#rcmfd_preview_pane_mark_read').prop('disabled', !this.checked)")); |
49771b
|
292 |
|
A |
293 |
$blocks['main']['options']['preview_pane'] = array( |
|
294 |
'title' => html::label($field_id, Q(rcube_label('previewpane'))), |
|
295 |
'content' => $input_preview->show($config['preview_pane']?1:0), |
|
296 |
); |
|
297 |
} |
|
298 |
|
bc4960
|
299 |
// show config parameter for preview pane auto mark as read delay |
T |
300 |
if (!isset($no_override['preview_pane_mark_read'])) { |
|
301 |
// apply default if config option is not set at all |
|
302 |
$config['preview_pane_mark_read'] = $RCMAIL->config->get('preview_pane_mark_read', 0); |
f8e8af
|
303 |
|
bc4960
|
304 |
$field_id = 'rcmfd_preview_pane_mark_read'; |
T |
305 |
$select_delay = new html_select(array('name' => '_preview_pane_mark_read', 'id' => $field_id, |
|
306 |
'disabled' => $config['preview_pane']?0:1)); |
|
307 |
|
|
308 |
$select_delay->add(rcube_label('never'), '-1'); |
|
309 |
$select_delay->add(rcube_label('immediately'), 0); |
|
310 |
foreach(array(5, 10, 20, 30) as $sec) |
|
311 |
$select_delay->add(rcube_label(array('name' => 'afternseconds', 'vars' => array('n' => $sec))), $sec); |
|
312 |
|
|
313 |
$blocks['main']['options']['preview_pane_mark_read'] = array( |
|
314 |
'title' => html::label($field_id, Q(rcube_label('previewpanemarkread'))), |
|
315 |
'content' => $select_delay->show(intval($config['preview_pane_mark_read'])), |
|
316 |
); |
|
317 |
} |
|
318 |
|
49771b
|
319 |
if (!isset($no_override['mdn_requests'])) { |
A |
320 |
$field_id = 'rcmfd_mdn_requests'; |
|
321 |
$select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); |
|
322 |
$select_mdn_requests->add(rcube_label('askuser'), 0); |
|
323 |
$select_mdn_requests->add(rcube_label('autosend'), 1); |
a99968
|
324 |
$select_mdn_requests->add(rcube_label('autosendknown'), 3); |
6c6bb0
|
325 |
$select_mdn_requests->add(rcube_label('autosendknownignore'), 4); |
49771b
|
326 |
$select_mdn_requests->add(rcube_label('ignore'), 2); |
A |
327 |
|
|
328 |
$blocks['main']['options']['mdn_requests'] = array( |
|
329 |
'title' => html::label($field_id, Q(rcube_label('mdnrequests'))), |
|
330 |
'content' => $select_mdn_requests->show($config['mdn_requests']), |
|
331 |
); |
|
332 |
} |
|
333 |
|
c321a9
|
334 |
$storage = $RCMAIL->get_storage(); |
T |
335 |
$threading_supported = $storage->get_capability('THREAD'); |
63ab02
|
336 |
|
A |
337 |
if (!isset($no_override['autoexpand_threads']) && $threading_supported) { |
f52c93
|
338 |
$field_id = 'rcmfd_autoexpand_threads'; |
T |
339 |
$select_autoexpand_threads = new html_select(array('name' => '_autoexpand_threads', 'id' => $field_id)); |
|
340 |
$select_autoexpand_threads->add(rcube_label('never'), 0); |
|
341 |
$select_autoexpand_threads->add(rcube_label('do_expand'), 1); |
|
342 |
$select_autoexpand_threads->add(rcube_label('expand_only_unread'), 2); |
f8e8af
|
343 |
|
f52c93
|
344 |
$blocks['main']['options']['autoexpand_threads'] = array( |
600bb1
|
345 |
'title' => html::label($field_id, Q(rcube_label('autoexpand_threads'))), |
A |
346 |
'content' => $select_autoexpand_threads->show($config['autoexpand_threads']), |
08ffd9
|
347 |
); |
A |
348 |
} |
|
349 |
|
|
350 |
// show page size selection |
a61cce
|
351 |
if (!isset($no_override['mail_pagesize'])) { |
A |
352 |
$field_id = 'rcmfd_mail_pagesize'; |
|
353 |
$input_pagesize = new html_inputfield(array('name' => '_mail_pagesize', 'id' => $field_id, 'size' => 5)); |
|
354 |
|
|
355 |
$size = intval($config['mail_pagesize'] ? $config['mail_pagesize'] : $config['pagesize']); |
08ffd9
|
356 |
|
A |
357 |
$blocks['main']['options']['pagesize'] = array( |
|
358 |
'title' => html::label($field_id, Q(rcube_label('pagesize'))), |
a61cce
|
359 |
'content' => $input_pagesize->show($size ? $size : 50), |
f52c93
|
360 |
); |
T |
361 |
} |
|
362 |
|
49771b
|
363 |
if (!isset($no_override['keep_alive'])) { |
A |
364 |
$field_id = 'rcmfd_keep_alive'; |
|
365 |
$select_keep_alive = new html_select(array('name' => '_keep_alive', 'id' => $field_id)); |
|
366 |
|
|
367 |
foreach(array(1, 3, 5, 10, 15, 30, 60) as $min) |
|
368 |
if((!$config['min_keep_alive'] || $config['min_keep_alive'] <= $min * 60) |
|
369 |
&& (!$config['session_lifetime'] || $config['session_lifetime'] > $min)) { |
|
370 |
$select_keep_alive->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min); |
|
371 |
} |
|
372 |
|
|
373 |
$blocks['new_message']['options']['keep_alive'] = array( |
|
374 |
'title' => html::label($field_id, Q(rcube_label('keepalive'))), |
|
375 |
'content' => $select_keep_alive->show($config['keep_alive']/60), |
|
376 |
); |
|
377 |
} |
|
378 |
|
|
379 |
if (!isset($no_override['check_all_folders'])) { |
|
380 |
$field_id = 'rcmfd_check_all_folders'; |
|
381 |
$input_check_all = new html_checkbox(array('name' => '_check_all_folders', 'id' => $field_id, 'value' => 1)); |
|
382 |
|
|
383 |
$blocks['new_message']['options']['check_all_folders'] = array( |
|
384 |
'title' => html::label($field_id, Q(rcube_label('checkallfolders'))), |
|
385 |
'content' => $input_check_all->show($config['check_all_folders']?1:0), |
|
386 |
); |
|
387 |
} |
|
388 |
|
|
389 |
break; |
f8e8af
|
390 |
|
49771b
|
391 |
// Message viewing |
A |
392 |
case 'mailview': |
f8e8af
|
393 |
|
49771b
|
394 |
$blocks = array( |
A |
395 |
'main' => array('name' => Q(rcube_label('mainoptions'))), |
|
396 |
); |
|
397 |
|
|
398 |
// show checkbox for HTML/plaintext messages |
|
399 |
if (!isset($no_override['prefer_html'])) { |
|
400 |
$field_id = 'rcmfd_htmlmsg'; |
|
401 |
$input_preferhtml = new html_checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1, |
81c2ce
|
402 |
'onchange' => "$('#rcmfd_show_images').prop('disabled', !this.checked).val(0)")); |
49771b
|
403 |
|
A |
404 |
$blocks['main']['options']['prefer_html'] = array( |
|
405 |
'title' => html::label($field_id, Q(rcube_label('preferhtml'))), |
|
406 |
'content' => $input_preferhtml->show($config['prefer_html']?1:0), |
|
407 |
); |
|
408 |
} |
|
409 |
|
e55ab0
|
410 |
if (!isset($no_override['default_charset'])) { |
A |
411 |
$field_id = 'rcmfd_default_charset'; |
|
412 |
|
|
413 |
$blocks['main']['options']['default_charset'] = array( |
|
414 |
'title' => html::label($field_id, Q(rcube_label('defaultcharset'))), |
|
415 |
'content' => $RCMAIL->output->charset_selector(array( |
81c2ce
|
416 |
'name' => '_default_charset', 'selected' => $config['default_charset'] |
A |
417 |
)) |
e55ab0
|
418 |
); |
A |
419 |
} |
|
420 |
|
49771b
|
421 |
if (!isset($no_override['show_images'])) { |
A |
422 |
$field_id = 'rcmfd_show_images'; |
e01e79
|
423 |
$input_show_images = new html_select(array('name' => '_show_images', 'id' => $field_id, |
A |
424 |
'disabled' => !$config['prefer_html'])); |
49771b
|
425 |
$input_show_images->add(rcube_label('never'), 0); |
A |
426 |
$input_show_images->add(rcube_label('fromknownsenders'), 1); |
|
427 |
$input_show_images->add(rcube_label('always'), 2); |
|
428 |
|
|
429 |
$blocks['main']['options']['show_images'] = array( |
|
430 |
'title' => html::label($field_id, Q(rcube_label('showremoteimages'))), |
e01e79
|
431 |
'content' => $input_show_images->show($config['prefer_html'] ? $config['show_images'] : 0), |
49771b
|
432 |
); |
A |
433 |
} |
|
434 |
|
|
435 |
if (!isset($no_override['inline_images'])) { |
|
436 |
$field_id = 'rcmfd_inline_images'; |
|
437 |
$input_inline_images = new html_checkbox(array('name' => '_inline_images', 'id' => $field_id, 'value' => 1)); |
|
438 |
|
|
439 |
$blocks['main']['options']['inline_images'] = array( |
|
440 |
'title' => html::label($field_id, Q(rcube_label('showinlineimages'))), |
|
441 |
'content' => $input_inline_images->show($config['inline_images']?1:0), |
|
442 |
); |
|
443 |
} |
|
444 |
|
|
445 |
// "display after delete" checkbox |
|
446 |
if (!isset($no_override['display_next'])) { |
|
447 |
$field_id = 'rcmfd_displaynext'; |
|
448 |
$input_displaynext = new html_checkbox(array('name' => '_display_next', 'id' => $field_id, 'value' => 1)); |
|
449 |
|
|
450 |
$blocks['main']['options']['display_next'] = array( |
|
451 |
'title' => html::label($field_id, Q(rcube_label('displaynext'))), |
|
452 |
'content' => $input_displaynext->show($config['display_next']?1:0), |
|
453 |
); |
|
454 |
} |
|
455 |
|
|
456 |
break; |
f8e8af
|
457 |
|
49771b
|
458 |
// Mail composition |
A |
459 |
case 'compose': |
f8e8af
|
460 |
|
49771b
|
461 |
$blocks = array( |
66df08
|
462 |
'main' => array('name' => Q(rcube_label('mainoptions'))), |
A |
463 |
'spellcheck' => array('name' => Q(rcube_label('spellcheckoptions'))), |
|
464 |
'sig' => array('name' => Q(rcube_label('signatureoptions'))), |
49771b
|
465 |
); |
A |
466 |
|
|
467 |
if (!isset($no_override['htmleditor'])) { |
|
468 |
$field_id = 'rcmfd_htmleditor'; |
868deb
|
469 |
$select_htmleditor = new html_select(array('name' => '_htmleditor', 'id' => $field_id)); |
A |
470 |
$select_htmleditor->add(rcube_label('never'), 0); |
|
471 |
$select_htmleditor->add(rcube_label('always'), 1); |
|
472 |
$select_htmleditor->add(rcube_label('htmlonreply'), 2); |
49771b
|
473 |
|
A |
474 |
$blocks['main']['options']['htmleditor'] = array( |
|
475 |
'title' => html::label($field_id, Q(rcube_label('htmleditor'))), |
868deb
|
476 |
'content' => $select_htmleditor->show(intval($config['htmleditor'])), |
49771b
|
477 |
); |
A |
478 |
} |
|
479 |
|
|
480 |
if (!isset($no_override['draft_autosave'])) { |
|
481 |
$field_id = 'rcmfd_autosave'; |
|
482 |
$select_autosave = new html_select(array('name' => '_draft_autosave', 'id' => $field_id, 'disabled' => empty($config['drafts_mbox']))); |
|
483 |
$select_autosave->add(rcube_label('never'), 0); |
|
484 |
foreach (array(1, 3, 5, 10) as $i => $min) |
|
485 |
$select_autosave->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min*60); |
|
486 |
|
|
487 |
$blocks['main']['options']['draft_autosave'] = array( |
|
488 |
'title' => html::label($field_id, Q(rcube_label('autosavedraft'))), |
|
489 |
'content' => $select_autosave->show($config['draft_autosave']), |
|
490 |
); |
|
491 |
} |
|
492 |
|
|
493 |
if (!isset($no_override['mime_param_folding'])) { |
|
494 |
$field_id = 'rcmfd_param_folding'; |
|
495 |
$select_param_folding = new html_select(array('name' => '_mime_param_folding', 'id' => $field_id)); |
|
496 |
$select_param_folding->add(rcube_label('2231folding'), 0); |
|
497 |
$select_param_folding->add(rcube_label('miscfolding'), 1); |
|
498 |
$select_param_folding->add(rcube_label('2047folding'), 2); |
|
499 |
|
|
500 |
$blocks['main']['options']['mime_param_folding'] = array( |
0207c4
|
501 |
'advanced' => true, |
49771b
|
502 |
'title' => html::label($field_id, Q(rcube_label('mimeparamfolding'))), |
A |
503 |
'content' => $select_param_folding->show($config['mime_param_folding']), |
|
504 |
); |
|
505 |
} |
47ad83
|
506 |
|
A |
507 |
if (!isset($no_override['force_7bit'])) { |
|
508 |
$field_id = 'rcmfd_force_7bit'; |
|
509 |
$input_7bit = new html_checkbox(array('name' => '_force_7bit', 'id' => $field_id, 'value' => 1)); |
|
510 |
|
|
511 |
$blocks['main']['options']['force_7bit'] = array( |
|
512 |
'title' => html::label($field_id, Q(rcube_label('force7bit'))), |
|
513 |
'content' => $input_7bit->show($config['force_7bit']?1:0), |
|
514 |
); |
|
515 |
} |
|
516 |
|
b3660b
|
517 |
if (!isset($no_override['mdn_default'])) { |
A |
518 |
$field_id = 'rcmfd_mdn_default'; |
|
519 |
$input_mdn = new html_checkbox(array('name' => '_mdn_default', 'id' => $field_id, 'value' => 1)); |
|
520 |
|
|
521 |
$blocks['main']['options']['mdn_default'] = array( |
|
522 |
'title' => html::label($field_id, Q(rcube_label('reqmdn'))), |
|
523 |
'content' => $input_mdn->show($config['mdn_default']?1:0), |
|
524 |
); |
|
525 |
} |
|
526 |
|
f22ea7
|
527 |
if (!isset($no_override['dsn_default'])) { |
A |
528 |
$field_id = 'rcmfd_dsn_default'; |
|
529 |
$input_dsn = new html_checkbox(array('name' => '_dsn_default', 'id' => $field_id, 'value' => 1)); |
|
530 |
|
|
531 |
$blocks['main']['options']['dsn_default'] = array( |
|
532 |
'title' => html::label($field_id, Q(rcube_label('reqdsn'))), |
|
533 |
'content' => $input_dsn->show($config['dsn_default']?1:0), |
|
534 |
); |
|
535 |
} |
|
536 |
|
eeb85f
|
537 |
if (!isset($no_override['reply_same_folder'])) { |
A |
538 |
$field_id = 'rcmfd_reply_same_folder'; |
|
539 |
$input_reply_same_folder = new html_checkbox(array('name' => '_reply_same_folder', 'id' => $field_id, 'value' => 1)); |
|
540 |
|
|
541 |
$blocks['main']['options']['reply_same_folder'] = array( |
|
542 |
'title' => html::label($field_id, Q(rcube_label('replysamefolder'))), |
|
543 |
'content' => $input_reply_same_folder->show($config['reply_same_folder']?1:0), |
|
544 |
); |
|
545 |
} |
|
546 |
|
50f56d
|
547 |
if (!isset($no_override['top_posting'])) { |
A |
548 |
$field_id = 'rcmfd_top_posting'; |
81c2ce
|
549 |
$select_replymode = new html_select(array('name' => '_top_posting', 'id' => $field_id, |
A |
550 |
'onchange' => "\$('#rcmfd_sig_above').attr('disabled',this.selectedIndex==0)")); |
0207c4
|
551 |
$select_replymode->add(rcube_label('replybottomposting'), 0); |
T |
552 |
$select_replymode->add(rcube_label('replytopposting'), 1); |
50f56d
|
553 |
|
A |
554 |
$blocks['main']['options']['top_posting'] = array( |
0207c4
|
555 |
'title' => html::label($field_id, Q(rcube_label('whenreplying'))), |
T |
556 |
'content' => $select_replymode->show($config['top_posting']?1:0), |
50f56d
|
557 |
); |
A |
558 |
} |
|
559 |
|
1d5779
|
560 |
if (!isset($no_override['spellcheck_before_send']) && $config['enable_spellcheck']) { |
A |
561 |
$field_id = 'rcmfd_spellcheck_before_send'; |
|
562 |
$input_spellcheck = new html_checkbox(array('name' => '_spellcheck_before_send', 'id' => $field_id, 'value' => 1)); |
|
563 |
|
66df08
|
564 |
$blocks['spellcheck']['options']['spellcheck_before_send'] = array( |
1d5779
|
565 |
'title' => html::label($field_id, Q(rcube_label('spellcheckbeforesend'))), |
A |
566 |
'content' => $input_spellcheck->show($config['spellcheck_before_send']?1:0), |
|
567 |
); |
|
568 |
} |
|
569 |
|
66df08
|
570 |
if ($config['enable_spellcheck']) { |
A |
571 |
foreach (array('syms', 'nums', 'caps') as $key) { |
|
572 |
$key = 'spellcheck_ignore_'.$key; |
|
573 |
if (!isset($no_override[$key])) { |
|
574 |
$input_spellcheck = new html_checkbox(array('name' => '_'.$key, 'id' => 'rcmfd_'.$key, 'value' => 1)); |
|
575 |
|
|
576 |
$blocks['spellcheck']['options'][$key] = array( |
|
577 |
'title' => html::label($field_id, Q(rcube_label(str_replace('_', '', $key)))), |
|
578 |
'content' => $input_spellcheck->show($config[$key]?1:0), |
|
579 |
); |
|
580 |
} |
|
581 |
} |
|
582 |
} |
|
583 |
|
50f56d
|
584 |
if (!isset($no_override['show_sig'])) { |
A |
585 |
$field_id = 'rcmfd_show_sig'; |
|
586 |
$select_show_sig = new html_select(array('name' => '_show_sig', 'id' => $field_id)); |
0207c4
|
587 |
$select_show_sig->add(rcube_label('never'), 0); |
T |
588 |
$select_show_sig->add(rcube_label('always'), 1); |
|
589 |
$select_show_sig->add(rcube_label('newmessageonly'), 2); |
|
590 |
$select_show_sig->add(rcube_label('replyandforwardonly'), 3); |
50f56d
|
591 |
|
0207c4
|
592 |
$blocks['sig']['options']['show_sig'] = array( |
T |
593 |
'title' => html::label($field_id, Q(rcube_label('autoaddsignature'))), |
655bd9
|
594 |
'content' => $select_show_sig->show($RCMAIL->config->get('show_sig', 1)), |
0207c4
|
595 |
); |
T |
596 |
} |
|
597 |
|
|
598 |
if (!isset($no_override['sig_above'])) { |
|
599 |
$field_id = 'rcmfd_sig_above'; |
655bd9
|
600 |
$select_sigabove = new html_select(array('name' => '_sig_above', 'id' => $field_id, 'disabled' => !$config['top_posting'])); |
T |
601 |
$select_sigabove->add(rcube_label('belowquote'), 0); |
|
602 |
$select_sigabove->add(rcube_label('abovequote'), 1); |
0207c4
|
603 |
|
T |
604 |
$blocks['sig']['options']['sig_above'] = array( |
655bd9
|
605 |
'title' => html::label($field_id, Q(rcube_label('replysignaturepos'))), |
T |
606 |
'content' => $select_sigabove->show($config['sig_above']?1:0), |
0207c4
|
607 |
); |
T |
608 |
} |
|
609 |
|
|
610 |
if (!isset($no_override['strip_existing_sig'])) { |
|
611 |
$field_id = 'rcmfd_strip_existing_sig'; |
|
612 |
$input_stripexistingsig = new html_checkbox(array('name' => '_strip_existing_sig', 'id' => $field_id, 'value' => 1)); |
|
613 |
|
|
614 |
$blocks['sig']['options']['strip_existing_sig'] = array( |
|
615 |
'title' => html::label($field_id, Q(rcube_label('replyremovesignature'))), |
|
616 |
'content' => $input_stripexistingsig->show($config['strip_existing_sig']?1:0), |
50f56d
|
617 |
); |
A |
618 |
} |
49771b
|
619 |
|
7e263e
|
620 |
if (!isset($no_override['default_font'])) { |
A |
621 |
$field_id = 'rcmfd_default_font'; |
|
622 |
$fonts = rcube_fontdefs(); |
|
623 |
$default_font = $config['default_font'] ? $config['default_font'] : 'Verdana'; |
|
624 |
|
|
625 |
$select = '<select name="_default_font" id="'.$field_id.'">'; |
|
626 |
foreach ($fonts as $fname => $font) |
|
627 |
$select .= '<option value="'.$fname.'"' |
|
628 |
. ($fname == $default_font ? ' selected="selected"' : '') |
|
629 |
. ' style=\'font-family: ' . $font . '\'>' |
|
630 |
. Q($fname) . '</option>'; |
|
631 |
$select .= '</select>'; |
|
632 |
|
|
633 |
$blocks['main']['options']['default_font'] = array( |
|
634 |
'title' => html::label($field_id, Q(rcube_label('defaultfont'))), |
|
635 |
'content' => $select |
|
636 |
); |
|
637 |
} |
|
638 |
|
49771b
|
639 |
break; |
f8e8af
|
640 |
|
d73448
|
641 |
|
A |
642 |
// Addressbook config |
|
643 |
case 'addressbook': |
|
644 |
|
|
645 |
$blocks = array( |
|
646 |
'main' => array('name' => Q(rcube_label('mainoptions'))), |
|
647 |
); |
|
648 |
|
|
649 |
if (!isset($no_override['default_addressbook']) |
|
650 |
&& ($books = $RCMAIL->get_address_sources(true)) |
|
651 |
) { |
|
652 |
$field_id = 'rcmfd_default_addressbook'; |
|
653 |
$select_abook = new html_select(array('name' => '_default_addressbook', 'id' => $field_id)); |
|
654 |
|
|
655 |
foreach ($books as $book) { |
|
656 |
$select_abook->add($book['name'], $book['id']); |
|
657 |
} |
|
658 |
|
|
659 |
$blocks['main']['options']['default_addressbook'] = array( |
|
660 |
'title' => html::label($field_id, Q(rcube_label('defaultaddressbook'))), |
|
661 |
'content' => $select_abook->show($config['default_addressbook']), |
|
662 |
); |
|
663 |
} |
|
664 |
|
f9a967
|
665 |
// show addressbook listing mode selection |
T |
666 |
if (!isset($no_override['addressbook_name_listing'])) { |
|
667 |
$field_id = 'rcmfd_addressbook_name_listing'; |
|
668 |
$select_listing = new html_select(array('name' => '_addressbook_name_listing', 'id' => $field_id)); |
|
669 |
$select_listing->add(rcube_label('name'), 0); |
|
670 |
$select_listing->add(rcube_label('firstname') . ' ' . rcube_label('surname'), 1); |
|
671 |
$select_listing->add(rcube_label('surname') . ' ' . rcube_label('firstname'), 2); |
|
672 |
$select_listing->add(rcube_label('surname') . ', ' . rcube_label('firstname'), 3); |
|
673 |
|
|
674 |
$blocks['main']['options']['list_name_listing'] = array( |
|
675 |
'title' => html::label($field_id, Q(rcube_label('listnamedisplay'))), |
|
676 |
'content' => $select_listing->show($config['addressbook_name_listing']), |
|
677 |
); |
|
678 |
} |
|
679 |
|
438753
|
680 |
// show addressbook sort column |
T |
681 |
if (!isset($no_override['addressbook_sort_col'])) { |
|
682 |
$field_id = 'rcmfd_addressbook_sort_col'; |
|
683 |
$select_sort = new html_select(array('name' => '_addressbook_sort_col', 'id' => $field_id)); |
|
684 |
$select_sort->add(rcube_label('name'), 'name'); |
|
685 |
$select_sort->add(rcube_label('firstname'), 'firstname'); |
|
686 |
$select_sort->add(rcube_label('surname'), 'surname'); |
710b1b
|
687 |
|
438753
|
688 |
$blocks['main']['options']['sort_col'] = array( |
T |
689 |
'title' => html::label($field_id, Q(rcube_label('listsorting'))), |
|
690 |
'content' => $select_sort->show($config['addressbook_sort_col']), |
710b1b
|
691 |
); |
A |
692 |
} |
|
693 |
|
08ffd9
|
694 |
// show addressbook page size selection |
A |
695 |
if (!isset($no_override['addressbook_pagesize'])) { |
|
696 |
$field_id = 'rcmfd_addressbook_pagesize'; |
|
697 |
$input_pagesize = new html_inputfield(array('name' => '_addressbook_pagesize', 'id' => $field_id, 'size' => 5)); |
|
698 |
|
a61cce
|
699 |
$size = intval($config['addressbook_pagesize'] ? $config['addressbook_pagesize'] : $config['pagesize']); |
08ffd9
|
700 |
|
A |
701 |
$blocks['main']['options']['pagesize'] = array( |
|
702 |
'title' => html::label($field_id, Q(rcube_label('pagesize'))), |
a61cce
|
703 |
'content' => $input_pagesize->show($size ? $size : 50), |
08ffd9
|
704 |
); |
A |
705 |
} |
|
706 |
|
438753
|
707 |
if (!isset($no_override['autocomplete_single'])) { |
T |
708 |
$field_id = 'rcmfd_autocomplete_single'; |
|
709 |
$checkbox = new html_checkbox(array('name' => '_autocomplete_single', 'id' => $field_id, 'value' => 1)); |
|
710 |
|
|
711 |
$blocks['main']['options']['autocomplete_single'] = array( |
|
712 |
'title' => html::label($field_id, Q(rcube_label('autocompletesingle'))), |
|
713 |
'content' => $checkbox->show($config['autocomplete_single']?1:0), |
|
714 |
); |
|
715 |
} |
|
716 |
|
d73448
|
717 |
break; |
A |
718 |
|
49771b
|
719 |
// Special IMAP folders |
A |
720 |
case 'folders': |
f8e8af
|
721 |
|
49771b
|
722 |
$blocks = array( |
A |
723 |
'main' => array('name' => Q(rcube_label('mainoptions'))), |
|
724 |
); |
|
725 |
|
|
726 |
// Configure special folders |
c321a9
|
727 |
if (!isset($no_override['default_folders'])) { |
63ab02
|
728 |
// load folders list only when needed |
A |
729 |
if ($current) { |
e2dfb5
|
730 |
$select = rcmail_mailbox_select(array( |
A |
731 |
'noselection' => '---', |
|
732 |
'realnames' => true, |
|
733 |
'maxlength' => 30, |
|
734 |
'folder_filter' => 'mail', |
|
735 |
'folder_rights' => 'w', |
|
736 |
// #1486114, #1488279 |
|
737 |
'onchange' => "if ($(this).val() == 'INBOX') $(this).val('')", |
|
738 |
)); |
63ab02
|
739 |
} |
A |
740 |
else // dummy select |
|
741 |
$select = new html_select(); |
49771b
|
742 |
|
A |
743 |
if (!isset($no_override['drafts_mbox'])) |
|
744 |
$blocks['main']['options']['drafts_mbox'] = array( |
|
745 |
'title' => Q(rcube_label('drafts')), |
|
746 |
'content' => $select->show($config['drafts_mbox'], array('name' => "_drafts_mbox")), |
|
747 |
); |
|
748 |
|
|
749 |
if (!isset($no_override['sent_mbox'])) |
|
750 |
$blocks['main']['options']['sent_mbox'] = array( |
|
751 |
'title' => Q(rcube_label('sent')), |
|
752 |
'content' => $select->show($config['sent_mbox'], array('name' => "_sent_mbox")), |
|
753 |
); |
|
754 |
|
|
755 |
if (!isset($no_override['junk_mbox'])) |
|
756 |
$blocks['main']['options']['junk_mbox'] = array( |
|
757 |
'title' => Q(rcube_label('junk')), |
|
758 |
'content' => $select->show($config['junk_mbox'], array('name' => "_junk_mbox")), |
|
759 |
); |
|
760 |
|
|
761 |
if (!isset($no_override['trash_mbox'])) |
|
762 |
$blocks['main']['options']['trash_mbox'] = array( |
|
763 |
'title' => Q(rcube_label('trash')), |
|
764 |
'content' => $select->show($config['trash_mbox'], array('name' => "_trash_mbox")), |
|
765 |
); |
|
766 |
} |
|
767 |
|
|
768 |
break; |
f8e8af
|
769 |
|
49771b
|
770 |
// Server settings |
A |
771 |
case 'server': |
f8e8af
|
772 |
|
49771b
|
773 |
$blocks = array( |
A |
774 |
'main' => array('name' => Q(rcube_label('mainoptions'))), |
|
775 |
'maintenance' => array('name' => Q(rcube_label('maintenance'))), |
|
776 |
); |
|
777 |
|
|
778 |
if (!isset($no_override['read_when_deleted'])) { |
|
779 |
$field_id = 'rcmfd_read_deleted'; |
|
780 |
$input_readdeleted = new html_checkbox(array('name' => '_read_when_deleted', 'id' => $field_id, 'value' => 1)); |
|
781 |
|
|
782 |
$blocks['main']['options']['read_when_deleted'] = array( |
|
783 |
'title' => html::label($field_id, Q(rcube_label('readwhendeleted'))), |
|
784 |
'content' => $input_readdeleted->show($config['read_when_deleted']?1:0), |
|
785 |
); |
|
786 |
} |
|
787 |
|
|
788 |
if (!isset($no_override['flag_for_deletion'])) { |
|
789 |
$field_id = 'rcmfd_flag_for_deletion'; |
|
790 |
$input_flagfordeletion = new html_checkbox(array('name' => '_flag_for_deletion', 'id' => $field_id, 'value' => 1)); |
|
791 |
|
|
792 |
$blocks['main']['options']['flag_for_deletion'] = array( |
|
793 |
'title' => html::label($field_id, Q(rcube_label('flagfordeletion'))), |
|
794 |
'content' => $input_flagfordeletion->show($config['flag_for_deletion']?1:0), |
|
795 |
); |
|
796 |
} |
|
797 |
|
|
798 |
// don't show deleted messages |
|
799 |
if (!isset($no_override['skip_deleted'])) { |
|
800 |
$field_id = 'rcmfd_skip_deleted'; |
|
801 |
$input_purge = new html_checkbox(array('name' => '_skip_deleted', 'id' => $field_id, 'value' => 1)); |
|
802 |
|
|
803 |
$blocks['main']['options']['skip_deleted'] = array( |
|
804 |
'title' => html::label($field_id, Q(rcube_label('skipdeleted'))), |
|
805 |
'content' => $input_purge->show($config['skip_deleted']?1:0), |
|
806 |
); |
|
807 |
} |
|
808 |
|
b7f952
|
809 |
if (!isset($no_override['delete_always'])) { |
A |
810 |
$field_id = 'rcmfd_delete_always'; |
|
811 |
$input_delete_always = new html_checkbox(array('name' => '_delete_always', 'id' => $field_id, 'value' => 1)); |
|
812 |
|
|
813 |
$blocks['main']['options']['delete_always'] = array( |
|
814 |
'title' => html::label($field_id, Q(rcube_label('deletealways'))), |
|
815 |
'content' => $input_delete_always->show($config['delete_always']?1:0), |
|
816 |
); |
|
817 |
} |
|
818 |
|
1b30a7
|
819 |
if (!isset($no_override['delete_junk'])) { |
A |
820 |
$field_id = 'rcmfd_delete_junk'; |
|
821 |
$input_delete_junk = new html_checkbox(array('name' => '_delete_junk', 'id' => $field_id, 'value' => 1)); |
|
822 |
|
|
823 |
$blocks['main']['options']['delete_junk'] = array( |
|
824 |
'title' => html::label($field_id, Q(rcube_label('deletejunk'))), |
|
825 |
'content' => $input_delete_junk->show($config['delete_junk']?1:0), |
|
826 |
); |
|
827 |
} |
|
828 |
|
49771b
|
829 |
// Trash purging on logout |
A |
830 |
if (!isset($no_override['logout_purge'])) { |
|
831 |
$field_id = 'rcmfd_logout_purge'; |
|
832 |
$input_purge = new html_checkbox(array('name' => '_logout_purge', 'id' => $field_id, 'value' => 1)); |
|
833 |
|
|
834 |
$blocks['maintenance']['options']['logout_purge'] = array( |
|
835 |
'title' => html::label($field_id, Q(rcube_label('logoutclear'))), |
|
836 |
'content' => $input_purge->show($config['logout_purge']?1:0), |
|
837 |
); |
|
838 |
} |
|
839 |
|
|
840 |
// INBOX compacting on logout |
|
841 |
if (!isset($no_override['logout_expunge'])) { |
|
842 |
$field_id = 'rcmfd_logout_expunge'; |
|
843 |
$input_expunge = new html_checkbox(array('name' => '_logout_expunge', 'id' => $field_id, 'value' => 1)); |
|
844 |
|
|
845 |
$blocks['maintenance']['options']['logout_expunge'] = array( |
|
846 |
'title' => html::label($field_id, Q(rcube_label('logoutcompact'))), |
|
847 |
'content' => $input_expunge->show($config['logout_expunge']?1:0), |
|
848 |
); |
|
849 |
} |
f8e8af
|
850 |
|
49771b
|
851 |
break; |
A |
852 |
} |
|
853 |
|
e6ce00
|
854 |
$data = $RCMAIL->plugins->exec_hook('preferences_list', array('section' => $sect['id'], 'blocks' => $blocks)); |
49771b
|
855 |
$found = false; |
f8e8af
|
856 |
|
49771b
|
857 |
// create output |
A |
858 |
foreach ($data['blocks'] as $block) { |
f8e8af
|
859 |
if (!empty($block['content']) || !empty($block['options'])) { |
A |
860 |
$found = true; |
|
861 |
break; |
49771b
|
862 |
} |
A |
863 |
} |
|
864 |
|
|
865 |
if (!$found) |
|
866 |
unset($sections[$idx]); |
|
867 |
else |
|
868 |
$sections[$idx]['blocks'] = $data['blocks']; |
|
869 |
} |
|
870 |
|
|
871 |
return array($sections, $plugin['cols']); |
|
872 |
} |
|
873 |
|
|
874 |
|
|
875 |
function rcmail_get_skins() |
|
876 |
{ |
|
877 |
$path = 'skins'; |
|
878 |
$skins = array(); |
|
879 |
|
|
880 |
$dir = opendir($path); |
f8e8af
|
881 |
|
49771b
|
882 |
if (!$dir) |
A |
883 |
return false; |
f8e8af
|
884 |
|
49771b
|
885 |
while (($file = readdir($dir)) !== false) |
A |
886 |
{ |
|
887 |
$filename = $path.'/'.$file; |
90b1cb
|
888 |
if (!preg_match('/^\./', $file) && is_dir($filename) && is_readable($filename)) |
49771b
|
889 |
$skins[] = $file; |
A |
890 |
} |
|
891 |
|
|
892 |
closedir($dir); |
|
893 |
|
|
894 |
return $skins; |
|
895 |
} |
|
896 |
|
bbce3e
|
897 |
|
254d5e
|
898 |
function rcmail_folder_options($mailbox) |
bbce3e
|
899 |
{ |
A |
900 |
global $RCMAIL; |
|
901 |
|
c321a9
|
902 |
$options = $RCMAIL->get_storage()->folder_info($mailbox); |
67975b
|
903 |
$options['protected'] = $options['is_root'] || ($options['special'] && $RCMAIL->config->get('protect_default_folders')); |
bbce3e
|
904 |
|
1a0343
|
905 |
return $options; |
bbce3e
|
906 |
} |
A |
907 |
|
1a0343
|
908 |
/** |
A |
909 |
* Updates (or creates) folder row in the subscriptions table |
|
910 |
* |
|
911 |
* @param string $name Folder name |
|
912 |
* @param string $oldname Old folder name (for update) |
|
913 |
* @param bool $subscribe Checks subscription checkbox |
|
914 |
* @param string $class CSS class name for folder row |
|
915 |
*/ |
|
916 |
function rcmail_update_folder_row($name, $oldname=null, $subscribe=false, $class_name=null) |
254d5e
|
917 |
{ |
63ff2a
|
918 |
global $RCMAIL, $OUTPUT; |
A |
919 |
|
|
920 |
$default_folders = (array) $RCMAIL->config->get('default_folders'); |
|
921 |
$protect_folders = $RCMAIL->config->get('protect_default_folders'); |
254d5e
|
922 |
|
c321a9
|
923 |
$storage = $RCMAIL->get_storage(); |
T |
924 |
$delimiter = $storage->get_hierarchy_delimiter(); |
254d5e
|
925 |
$name_utf8 = rcube_charset_convert($name, 'UTF7-IMAP'); |
63ff2a
|
926 |
$protected = $protect_folders && in_array($name, $default_folders); |
254d5e
|
927 |
|
c321a9
|
928 |
$foldersplit = explode($delimiter, $storage->mod_folder($name)); |
254d5e
|
929 |
$level = count($foldersplit) - 1; |
A |
930 |
$display_name = str_repeat(' ', $level) |
|
931 |
. Q($protected ? rcmail_localize_foldername($name) : rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP')); |
|
932 |
|
|
933 |
if ($oldname === null) |
1a0343
|
934 |
$OUTPUT->command('add_folder_row', $name_utf8, $display_name, $protected, $subscribe, |
A |
935 |
false, $class_name); |
254d5e
|
936 |
else |
A |
937 |
$OUTPUT->command('replace_folder_row', rcube_charset_convert($oldname, 'UTF7-IMAP'), |
1a0343
|
938 |
$name_utf8, $display_name, $protected, $class_name); |
254d5e
|
939 |
} |
A |
940 |
|
bbce3e
|
941 |
|
f11541
|
942 |
// register UI objects |
T |
943 |
$OUTPUT->add_handlers(array( |
f05834
|
944 |
'prefsframe' => 'rcmail_preferences_frame', |
A |
945 |
'sectionslist' => 'rcmail_sections_list', |
b89d5a
|
946 |
'identitieslist' => 'rcmail_identities_list', |
f11541
|
947 |
)); |
T |
948 |
|
68d2d5
|
949 |
// register action aliases |
A |
950 |
$RCMAIL->register_action_map(array( |
|
951 |
'folders' => 'folders.inc', |
|
952 |
'rename-folder' => 'folders.inc', |
|
953 |
'delete-folder' => 'folders.inc', |
|
954 |
'subscribe' => 'folders.inc', |
|
955 |
'unsubscribe' => 'folders.inc', |
|
956 |
'purge' => 'folders.inc', |
|
957 |
'folder-size' => 'folders.inc', |
|
958 |
'add-identity' => 'edit_identity.inc', |
|
959 |
)); |