forked from extern/egroupware
Fix for option group validation
This commit is contained in:
parent
2748376f6f
commit
3e54b25a91
@ -169,7 +169,13 @@ class Select extends Etemplate\Widget
|
||||
{
|
||||
if ($child->type == 'option') $allowed[] = (string)$child->attrs['value'];
|
||||
}
|
||||
$allowed = array_map('strval', $allowed);
|
||||
// Make sure values are strings so they match, also handling option groups
|
||||
$stringified = array();
|
||||
array_walk_recursive($allowed, function ($a, $b) use (&$stringified) {
|
||||
if($b == 'value') $stringified[] = $a;
|
||||
else if (is_int($b)) $stringified[] = strval($a);
|
||||
});
|
||||
$allowed = $stringified;
|
||||
|
||||
// Add empty as an option, we check for required value later
|
||||
$allowed[] = '';
|
||||
|
@ -363,7 +363,7 @@ class preferences_hooks
|
||||
'type' => 'multiselect',
|
||||
'label' => 'Permanent time zone selection',
|
||||
'name' => 'tz_selection',
|
||||
'values' => $tzs ? array_merge(...array_values($tzs)) : null, // only flat arrays supported
|
||||
'values' => $tzs
|
||||
'help' => 'Please select timezones, you want to be able to quickly switch between. Switch is NOT shown, if less then two are selected.',
|
||||
'xmlrpc' => True,
|
||||
'admin' => False,
|
||||
|
Loading…
Reference in New Issue
Block a user