forked from extern/egroupware
fixed handling of optgroups, eg. notification chains in prefs
This commit is contained in:
parent
dbb4de0876
commit
243f20e98c
@ -288,15 +288,26 @@ class etemplate_widget_menupopup extends etemplate_widget
|
|||||||
$values = array();
|
$values = array();
|
||||||
foreach($options as $key => $val)
|
foreach($options as $key => $val)
|
||||||
{
|
{
|
||||||
if (is_array($val) && isset($val['value']))
|
if (is_array($val))
|
||||||
|
{
|
||||||
|
if (isset($val['value']))
|
||||||
{
|
{
|
||||||
$values[] = $val['value'];
|
$values[] = $val['value'];
|
||||||
}
|
}
|
||||||
|
else // optgroup
|
||||||
|
{
|
||||||
|
foreach($val as $k => $v)
|
||||||
|
{
|
||||||
|
$values[] = is_array($v) && isset($v['value']) ? $v['value'] : $k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$values[] = $key;
|
$values[] = $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//error_log(__METHOD__."('$name', TRUE) options=".array2string($options).' --> values='.array2string($values));
|
||||||
$options = $values;
|
$options = $values;
|
||||||
}
|
}
|
||||||
//error_log(__METHOD__."('$name') returning ".array2string($options));
|
//error_log(__METHOD__."('$name') returning ".array2string($options));
|
||||||
|
@ -684,7 +684,7 @@ var et2_selectbox = et2_inputWidget.extend(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this._appendOptionElement(key, _options[key][sub],undefined,group);
|
this._appendOptionElement(sub, _options[key][sub],undefined,group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user