From 2f09ae56adb75b6e1767dcad63feaf1a9d2a87c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 22 Aug 2016 01:23:20 +0200 Subject: [PATCH] [core] render two levels 'values' parameter property with optgroup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/HTMLUtils.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/HTMLUtils.php b/lib/HTMLUtils.php index 03763af..bf150fb 100644 --- a/lib/HTMLUtils.php +++ b/lib/HTMLUtils.php @@ -104,10 +104,21 @@ CARD; else $card .= ''; }else{ + if(is_array($value)){ + $card.=''; + foreach($value as $subname=>$subvalue){ + if($inputEntry['defaultValue'] === $subname || $inputEntry['defaultValue'] === $subvalue) + $card .= ''; + else + $card .= ''; + } + $card.=''; + }else{ if($inputEntry['defaultValue'] === $name || $inputEntry['defaultValue'] === $value) $card .= ''; else $card .= ''; + } } }