From 64f20dae0cdd3a53114053e3520eb30b71bfa42c Mon Sep 17 00:00:00 2001 From: thomascube Date: Thu, 31 Jul 2008 21:30:25 +0000 Subject: Show real names in folder drop-down + rebuild default_imap_folders property when saving prefs --- program/steps/settings/func.inc | 4 ++-- program/steps/settings/save_prefs.inc | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'program/steps') diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 1b4481881..5b6e11308 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -227,9 +227,9 @@ function rcmail_user_prefs_form($attrib) $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagescomposition'))) . $table->show($attrib)); // Configure special folders - if (!isset($no_override['folders'])) { + if (!isset($no_override['default_imap_folders'])) { $RCMAIL->imap_init(true); - $select = rcmail_mailbox_select(array('noselection' => '---')); + $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true)); $table = new html_table(array('cols' => 2)); diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index ccd6e5f7b..3bccffae2 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -46,6 +46,18 @@ $a_user_prefs = array( foreach ((array)$CONFIG['dont_override'] as $p) $a_user_prefs[$p] = $CONFIG[$p]; +// special handling for 'default_imap_folders' +if (in_array('default_imap_folders', (array)$CONFIG['dont_override'])) { + foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p) + $a_user_prefs[$p] = $CONFIG[$p]; +} +else { + $a_user_prefs['default_imap_folders'] = array('INBOX'); + foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p) { + if ($a_user_prefs[$p]) + $a_user_prefs['default_imap_folders'][] = $a_user_prefs[$p]; + } +} // switch UI language if (isset($_POST['_language'])) { -- cgit v1.2.3