From 4a05e8a7e8a39aee331a1d5bc45fbc1710ac6a15 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Fri, 8 Nov 2013 10:57:00 +0100 Subject: Finish advanced prefs feature (#1488829) --- config/defaults.inc.php | 4 ++++ program/steps/settings/func.inc | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config/defaults.inc.php b/config/defaults.inc.php index ab0e188bd..fc7e92fd7 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -252,6 +252,10 @@ $config['enable_installer'] = false; // don't allow these settings to be overriden by the user $config['dont_override'] = array(); +// define which settings should be listed under the 'advanced' block +// which is hidden by default +$config['advanced_prefs'] = array(); + // provide an URL where a user can get support for this Roundcube installation // PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE! $config['support_url'] = ''; diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index c922aca08..016264128 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -1180,11 +1180,21 @@ function rcmail_user_prefs($current = null) $data = $RCMAIL->plugins->exec_hook('preferences_list', array('section' => $sect['id'], 'blocks' => $blocks, 'current' => $current)); + $advanced_prefs = $config['advanced_prefs']; + // create output - foreach ($data['blocks'] as $block) { + foreach ($data['blocks'] as $key => $block) { if (!empty($block['content']) || !empty($block['options'])) { $found = true; - break; + } + // move some options to the 'advanced' block as configured by admin + if ($key != 'advanced') { + foreach ($advanced_prefs as $opt) { + if ($block['options'][$opt]) { + $data['blocks']['advanced']['options'][$opt] = $block['options'][$opt]; + unset($data['blocks'][$key]['options'][$opt]); + } + } } } -- cgit v1.2.3