forked from blallo/rss-bridge
[core] render two levels 'values' parameter property with optgroup
example: $parameterSet=array( 'feed'=>array( 'name'=>'Feed', 'type'=>'list', 'values'=>array( 'list A'=>array( 'feed A1'=>'fA1', 'feed A2'=>'fA2' ), 'list B'=>array( 'feed B1'=>'fB1', 'feed B2'=>'fB2 ) ) ) ); Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
4717de9d08
commit
2f09ae56ad
1 changed files with 11 additions and 0 deletions
|
@ -104,10 +104,21 @@ CARD;
|
|||
else
|
||||
$card .= '<option value="' . $listValues['value'] . '">' . $listValues['name'] . '</option>';
|
||||
}else{
|
||||
if(is_array($value)){
|
||||
$card.='<optgroup label="'.htmlentities($name).'">';
|
||||
foreach($value as $subname=>$subvalue){
|
||||
if($inputEntry['defaultValue'] === $subname || $inputEntry['defaultValue'] === $subvalue)
|
||||
$card .= '<option value="' . $subvalue . '" selected>' . $subname . '</option>';
|
||||
else
|
||||
$card .= '<option value="' . $subvalue . '">' . $subname . '</option>';
|
||||
}
|
||||
$card.='</optgroup>';
|
||||
}else{
|
||||
if($inputEntry['defaultValue'] === $name || $inputEntry['defaultValue'] === $value)
|
||||
$card .= '<option value="' . $value . '" selected>' . $name . '</option>';
|
||||
else
|
||||
$card .= '<option value="' . $value . '">' . $name . '</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue