fixed handling of optgroups, eg. notification chains in prefs

This commit is contained in:
Ralf Becker 2014-01-10 07:08:45 +00:00
parent dbb4de0876
commit 243f20e98c
2 changed files with 14 additions and 3 deletions

View File

@ -288,15 +288,26 @@ class etemplate_widget_menupopup extends etemplate_widget
$values = array();
foreach($options as $key => $val)
{
if (is_array($val) && isset($val['value']))
if (is_array($val))
{
$values[] = $val['value'];
if (isset($val['value']))
{
$values[] = $val['value'];
}
else // optgroup
{
foreach($val as $k => $v)
{
$values[] = is_array($v) && isset($v['value']) ? $v['value'] : $k;
}
}
}
else
{
$values[] = $key;
}
}
//error_log(__METHOD__."('$name', TRUE) options=".array2string($options).' --> values='.array2string($values));
$options = $values;
}
//error_log(__METHOD__."('$name') returning ".array2string($options));

View File

@ -684,7 +684,7 @@ var et2_selectbox = et2_inputWidget.extend(
}
else
{
this._appendOptionElement(key, _options[key][sub],undefined,group);
this._appendOptionElement(sub, _options[key][sub],undefined,group);
}
}
}