diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-03-19 20:18:23 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-03-19 20:18:23 +0000 |
| commit | ef6583b0d51cd479d7abf1a780c61b046031fd97 (patch) | |
| tree | c1a1508e1582e83a28c0cabbfdfeb5ebc7b16ae6 /roundcubemail/program | |
| parent | 39e804c8b5583eb4eb192bcbe549dba5bc997419 (diff) | |
- hide threads related prefs when threads are not supported by IMAP server
- performance: don't load folders list when we don't need it
git-svn-id: https://svn.roundcube.net/trunk@3391 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/steps/settings/func.inc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/roundcubemail/program/steps/settings/func.inc b/roundcubemail/program/steps/settings/func.inc index 421fb37bf..7ad2449b5 100644 --- a/roundcubemail/program/steps/settings/func.inc +++ b/roundcubemail/program/steps/settings/func.inc @@ -300,7 +300,12 @@ function rcmail_user_prefs($current=null) ); } - if (!isset($no_override['autoexpand_threads'])) { + $RCMAIL->imap_connect(); + $threading_supported = $RCMAIL->imap->get_capability('thread=references') + || $RCMAIL->imap->get_capability('thread=orderedsubject') + || $RCMAIL->imap->get_capability('thread=refs'); + + if (!isset($no_override['autoexpand_threads']) && $threading_supported) { $field_id = 'rcmfd_autoexpand_threads'; $select_autoexpand_threads = new html_select(array('name' => '_autoexpand_threads', 'id' => $field_id)); $select_autoexpand_threads->add(rcube_label('never'), 0); @@ -532,9 +537,16 @@ function rcmail_user_prefs($current=null) // Configure special folders if (!isset($no_override['default_imap_folders'])) { + $RCMAIL->imap_connect(); - $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, - 'maxlength' => 30, 'exceptions' => array('INBOX'))); + + // load folders list only when needed + if ($current) { + $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, + 'maxlength' => 30, 'exceptions' => array('INBOX'))); + } + else // dummy select + $select = new html_select(); if (!isset($no_override['drafts_mbox'])) $blocks['main']['options']['drafts_mbox'] = array( |
