Fix defaults showing "Array" instead of array values

This commit is contained in:
Nathan Gray 2013-11-26 16:50:59 +00:00
parent fe5650e144
commit 127663af77

View File

@ -372,14 +372,18 @@ class preferences_settings
$GLOBALS['egw']->preferences->group[$appname][$setting['name']] :
$GLOBALS['egw']->preferences->default[$appname][$setting['name']];
if (isset($setting['values']) && (string)$setting['values'][$default] !== '')
if (isset($setting['values']) && !is_array($setting['values'][$default]) && (string)$setting['values'][$default] !== '')
{
$default = $setting['values'][$default];
}
elseif (strpos($default, ',') !== false)
{
$default = explode(',',$default);
}
if(is_array($default))
{
$values = array();
foreach(explode(',', $default) as $value)
foreach($default as $value)
{
if (isset($setting['values'][$value])) $values[] = $setting['values'][$value];
}