diff options
author | alecpl <alec@alec.pl> | 2012-01-19 07:17:06 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2012-01-19 07:17:06 +0000 |
commit | ce4c6103114ad45c69ff2a6a06e3b847b64dfc8f (patch) | |
tree | 4c48d870b30fe135b82430b903a3e5e78b50f474 /program | |
parent | e88a14acd91b9e34d4382931da4a95a8e8a03457 (diff) |
- Fix warning when default_folders setting is not an array
Diffstat (limited to 'program')
-rw-r--r-- | program/steps/settings/folders.inc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index 6fc72d9ea..d82d8366b 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -186,7 +186,7 @@ if ($OUTPUT->ajax_call) // build table with all folders listed by server function rcube_subscription_form($attrib) { - global $RCMAIL, $CONFIG, $OUTPUT; + global $RCMAIL, $OUTPUT; list($form_start, $form_end) = get_form_tags($attrib, 'folders'); unset($attrib['form']); @@ -215,6 +215,9 @@ function rcube_subscription_form($attrib) $seen = array(); $list_folders = array(); + $default_folders = (array) $RCMAIL->config->get('default_folders'); + $protect_default = $RCMAIL->config->get('protect_default_folders'); + // pre-process folders list foreach ($a_unsubscribed as $i => $folder) { $folder_id = $folder; @@ -274,7 +277,7 @@ function rcube_subscription_form($attrib) $idx = $i + 1; $sub_key = array_search($folder['id'], $a_subscribed); $subscribed = $sub_key !== false; - $protected = ($CONFIG['protect_default_folders'] == true && in_array($folder['id'], $CONFIG['default_folders'])); + $protected = $protect_default && in_array($folder['id'], $default_folders); $noselect = false; $classes = array($i%2 ? 'even' : 'odd'); @@ -347,7 +350,7 @@ function rcube_subscription_form($attrib) $OUTPUT->add_gui_object('subscriptionlist', $attrib['id']); $OUTPUT->set_env('subscriptionrows', $a_js_folders); - $OUTPUT->set_env('defaultfolders', $CONFIG['default_folders']); + $OUTPUT->set_env('defaultfolders', $default_folders); $OUTPUT->set_env('delimiter', $delimiter); return $form_start . $table->show($attrib) . $form_end; |