mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-28 02:43:22 +01:00
$options can be a real array, still using the key as value e.g. ["no", "yes"]
This commit is contained in:
parent
de6c649bef
commit
703eb3ffc1
@ -326,12 +326,16 @@ class Select extends Etemplate\Widget
|
||||
/**
|
||||
* Get all values from an option array, which can be an associate array with values as key, or a "real" array or arrays with key "value"
|
||||
*
|
||||
* $options can be a real array, still using the key as value:
|
||||
* - ["", "low", "normal", "high"]
|
||||
*
|
||||
* @param array|array[] $options incl. possible children
|
||||
* @return string[]
|
||||
*/
|
||||
static function optionValues(array $options)
|
||||
{
|
||||
if (!$options || (function_exists('array_is_list') && !array_is_list($options)) ||
|
||||
if (!$options || !is_array(current($options)) || !isset(current($options)['value']) ||
|
||||
(function_exists('array_is_list') && !array_is_list($options)) ||
|
||||
(!function_exists('array_is_list') && !isset($options[0]) && !isset($options[count($options) - 1])))
|
||||
{
|
||||
return array_keys($options);
|
||||
|
Loading…
Reference in New Issue
Block a user