From ce4c6103114ad45c69ff2a6a06e3b847b64dfc8f Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 19 Jan 2012 07:17:06 +0000 Subject: - Fix warning when default_folders setting is not an array --- program/steps/settings/folders.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'program/steps/settings/folders.inc') 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; -- cgit v1.2.3