mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-04 12:30:04 +01:00
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'];
|
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
|
// Add empty as an option, we check for required value later
|
||||||
$allowed[] = '';
|
$allowed[] = '';
|
||||||
|
@ -363,7 +363,7 @@ class preferences_hooks
|
|||||||
'type' => 'multiselect',
|
'type' => 'multiselect',
|
||||||
'label' => 'Permanent time zone selection',
|
'label' => 'Permanent time zone selection',
|
||||||
'name' => 'tz_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.',
|
'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,
|
'xmlrpc' => True,
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
|
Loading…
Reference in New Issue
Block a user