Added the possibility to use a global array parameter, that is going to be displayed for every parameter count.
This commit is contained in:
parent
541ba9116a
commit
f8b9470622
1 changed files with 20 additions and 1 deletions
|
@ -56,8 +56,28 @@ CARD;
|
|||
|
||||
}
|
||||
|
||||
$hasGlobalParameter = array_key_exists("global", $bridgeElement->parameters);
|
||||
if($hasGlobalParameter) {
|
||||
$globalParameters = json_decode($bridgeElement->parameters['global'], true);
|
||||
}
|
||||
|
||||
foreach($bridgeElement->parameters as $parameterName => $parameter)
|
||||
{
|
||||
|
||||
$parameter = json_decode($parameter, true);
|
||||
|
||||
if(!is_numeric($parameterName) && $parameterName == "global") {
|
||||
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
if($hasGlobalParameter) {
|
||||
|
||||
$parameter = array_merge($parameter, $globalParameters);
|
||||
|
||||
}
|
||||
|
||||
if(!is_numeric($parameterName)) {
|
||||
$card .= '<h5>'.$parameterName.'</h5>' . PHP_EOL;
|
||||
}
|
||||
|
@ -65,7 +85,6 @@ CARD;
|
|||
<input type="hidden" name="action" value="display" />
|
||||
<input type="hidden" name="bridge" value="' . $bridgeName . '" />' . PHP_EOL;
|
||||
|
||||
$parameter = json_decode($parameter, true);
|
||||
|
||||
foreach($parameter as $inputEntry) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue