diff --git a/config.html b/config.html index 6f9c811..3cb2593 100644 --- a/config.html +++ b/config.html @@ -14,14 +14,8 @@ {{:assign var="labels" value=$_POST.input_fields.label}} {{:assign var="owner_keys" value=$_POST.input_fields.owner|keys}} -{{#foreach from=$labels item="label"}} - {{if $label|in:$owner_keys}} - {{* label présent *}} - {{:assign var="input_fields." label=$label|trim owner=1|boolval}} - {{else}} - {{* label absent *}} - {{:assign var="input_fields." label=$label|trim owner=0|boolval}} - {{/if}} +{{#foreach from=$_POST.input_fields|array_transpose item="field"}} + {{:assign var="input_fields." label=$field.label|trim owner=$field.owner|boolval}} {{/foreach}} {{:save key="config" @@ -56,11 +50,17 @@ Action - + {{#foreach from=$module.config.inputNature item="input_field"}} {{:input type="text" name="input_fields[label][]" default=$input_field.label}} - + + + {{:button label="Retirer" shape="minus" onclick="this.parentNode.parentNode.remove();"}} @@ -69,7 +69,13 @@ {{#foreach from=$types_entrees key="label" item="value"}} {{:input type="text" name="input_fields[label][]" default=$label}} - + + + {{:button label="Retirer" shape="minus" onclick="this.parentNode.parentNode.remove();"}} @@ -81,11 +87,7 @@

{{:button shape="plus" label="Ajouter un champ" - onclick="var a = document.querySelector('.input_fields tbody').lastElementChild; - var b = a.cloneNode(true); - b.querySelector('input[type="text"]').value = null; - b.querySelector('input[type="checkbox"]').checked = false; - a.parentNode.append(b);"}} + onclick="addLine('#input_body')"}}

@@ -98,7 +100,7 @@ Action - + {{#foreach from=$module.config.outputNature item="output_field"}} {{:input type="text" name="output_fields[]" default=$output_field.label}} @@ -121,17 +123,49 @@

{{:button shape="plus" label="Ajouter un champ" - onclick="var a = document.querySelector('.output_fields tbody').lastElementChild; - var b = a.cloneNode(true); - b.querySelector('input[type="text"]').value = null; - a.parentNode.append(b);"}} + onclick="addLine('#output_body')"}}

- {{:button type="submit" name="save" label="Enregistrer" shape="right" class="main"}} + {{:button + type="submit" + name="save" + label="Enregistrer" + shape="right" + class="main" + onclick="return desactiverCache('#input_body');" + }}

+ {{:admin_footer}}