diff --git a/lib/HTMLUtils.php b/lib/HTMLUtils.php index bf150fb..330ce6f 100644 --- a/lib/HTMLUtils.php +++ b/lib/HTMLUtils.php @@ -45,18 +45,10 @@ CARD; $hasGlobalParameter = array_key_exists('global', $bridgeElement->parameters); if($hasGlobalParameter){ - if(is_array($bridgeElement->parameters['global'])){ - $globalParameters = $bridgeElement->parameters['global']; - }else{ - $globalParameters = json_decode($bridgeElement->parameters['global'], true); - } + $globalParameters = $bridgeElement->parameters['global']; } foreach($bridgeElement->parameters as $parameterName => $parameter){ - if(!is_array($parameter)){ - $parameter = json_decode($parameter, true); - } - if(!is_numeric($parameterName) && $parameterName == 'global') continue; @@ -86,48 +78,40 @@ CARD; if(!isset($inputEntry['defaultValue'])) $inputEntry['defaultValue'] = ''; - $idArg = 'arg-' . urlencode($bridgeName) . '-' . urlencode($parameterName) . '-' . (isset($inputEntry['identifier'])?urlencode($inputEntry['identifier']):urlencode($id)); + $idArg = 'arg-' . urlencode($bridgeName) . '-' . urlencode($parameterName) . '-' . urlencode($id); $card .= '' . PHP_EOL; if(!isset($inputEntry['type']) || $inputEntry['type'] == 'text') { - $card .= '
' . PHP_EOL; + $card .= '
' . PHP_EOL; } else if($inputEntry['type'] == 'number') { - $card .= '
' . PHP_EOL; + $card .= '
' . PHP_EOL; } else if($inputEntry['type'] == 'list') { - $card .= ''; foreach($inputEntry['values'] as $name=>$value) { - if(is_array($value) && is_numeric($name)){ - $listValues=$value; - if($inputEntry['defaultValue'] === $listValues['name'] || $inputEntry['defaultValue'] === $listValues['value']) - $card .= ''; - else - $card .= ''; - }else{ - if(is_array($value)){ - $card.=''; - foreach($value as $subname=>$subvalue){ + 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 .= ''; } + $card.=''; + }else{ + if($inputEntry['defaultValue'] === $name || $inputEntry['defaultValue'] === $value) + $card .= ''; + else + $card .= ''; } } $card .= '
'; } else if($inputEntry['type'] == 'checkbox') { if($inputEntry['defaultValue'] === 'checked') - $card .= '
' . PHP_EOL; + $card .= '
' . PHP_EOL; else - $card .= '
' . PHP_EOL; + $card .= '
' . PHP_EOL; } }