mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Better handling of defaults - options can be more than key => value maps
This commit is contained in:
parent
94ce4db297
commit
085733faa1
@ -372,11 +372,25 @@ class preferences_settings
|
|||||||
$GLOBALS['egw']->preferences->group[$appname][$setting['name']] :
|
$GLOBALS['egw']->preferences->group[$appname][$setting['name']] :
|
||||||
$GLOBALS['egw']->preferences->default[$appname][$setting['name']];
|
$GLOBALS['egw']->preferences->default[$appname][$setting['name']];
|
||||||
|
|
||||||
if (isset($setting['values']) && !is_array($setting['values'][$default]) && (string)$setting['values'][$default] !== '')
|
if (isset($setting['values']) && !is_array($default) && (string)$setting['values'][$default] !== '')
|
||||||
{
|
{
|
||||||
$default = $setting['values'][$default];
|
if(is_array($setting['values'][$default]))
|
||||||
|
{
|
||||||
|
foreach($setting['values'] as $key => $value)
|
||||||
|
{
|
||||||
|
if($value['value'] == $default && $value['label'])
|
||||||
|
{
|
||||||
|
$default = $value['label'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$default = $setting['values'][$default];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif (strpos($default, ',') !== false)
|
else if (strpos($default, ',') !== false)
|
||||||
{
|
{
|
||||||
$default = explode(',',$default);
|
$default = explode(',',$default);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user