1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-09 01:56:39 +02:00

Ajout de la possibilité d'avoir une liste en paramètre, voir exemple d'utilisation dans DauphineLibereBridge.

This commit is contained in:
teromene
2015-09-14 13:59:20 +01:00
parent c030d011d2
commit 81f89b1246
3 changed files with 36 additions and 9 deletions

View File

@@ -155,10 +155,22 @@ CARD;
<input type="hidden" name="action" value="display" />
<input type="hidden" name="bridge" value="' . $bridgeReference . '" />' . PHP_EOL;
foreach($anUse as $argName => $argDescription)
foreach($anUse as $argValue)
{
$idArg = 'arg-' . $bridgeReference . '-' . $anUseNum . '-' . $argName;
$card .= '<input id="' . $idArg . '" type="text" value="" placeholder="' . $argDescription . '" name="' . $argName . '" />' . PHP_EOL;
$idArg = 'arg-' . $bridgeReference . '-' . $anUseNum . '-' . $argValue['query-name'];
if($argValue['type'] == "text") {
$card .= '<input id="' . $idArg . '" type="text" value="" placeholder="' . $argValue['value'] . '" name="' . $argValue['query-name'] . '" />' . PHP_EOL;
} else if($argValue['type'] == "list") {
$card .= '<select id="' . $idArg . '" name="' . $argValue['query-name'] . '" >' . PHP_EOL;
$optionList = explode(";", $argValue['value']);
foreach($optionList as $option) {
$option = explode("=>", $option);
$card .= "<option value='".$option[1]."'>".$option[0]."</option>";
}
$card .= "</select>";
}
}
$card .= '<br />';