refonte config types ES
This commit is contained in:
parent
b19904b05b
commit
08ff1f82fd
16 changed files with 133 additions and 208 deletions
|
|
@ -8,41 +8,29 @@
|
|||
{{* config par défaut *}}
|
||||
{{:read file="./defaut.json" assign="config_defaut"}}
|
||||
{{:assign config_defaut=$config_defaut|json_decode}}
|
||||
{{*:debug config_defaut=$config_defaut*}}
|
||||
|
||||
{{if $module.config.input_nature != null}}
|
||||
{{*:debug module.config.input_nature=$module.config.input_nature*}}
|
||||
{{#foreach from=$module.config.input_nature item="elem"}}
|
||||
{{#foreach from=$elem key=label item=value}}
|
||||
{{:assign var="in.%s"|args:$label value=$value}}
|
||||
{{/foreach}}
|
||||
{{:assign var="config.input_nature." from="in"}}
|
||||
{{:assign var="item" label=$label type=$type}}
|
||||
{{:assign var="config.input_nature.%s"|args:$key value=$item}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser la config par défaut *}}
|
||||
{{#foreach from=$config_defaut.inputs item="elem"}}
|
||||
{{#foreach from=$elem key=label item=value}}
|
||||
{{:assign var="in.%s"|args:$label value=$value}}
|
||||
{{/foreach}}
|
||||
{{:assign var="config.input_nature." from="in"}}
|
||||
{{:assign var="item" label=$label type=$type}}
|
||||
{{:assign var="config.input_nature.%s"|args:$key value=$item}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{*:debug config.input_nature=$config.input_nature*}}
|
||||
|
||||
{{if $module.config.output_nature != null}}
|
||||
{{*:debug module.config.output_nature=$module.config.output_nature*}}
|
||||
{{#foreach from=$module.config.output_nature item="elem"}}
|
||||
{{#foreach from=$elem key=label item=value}}
|
||||
{{:assign var="out.%s"|args:$label value=$value}}
|
||||
{{/foreach}}
|
||||
{{:assign var="config.output_nature." from="out"}}
|
||||
{{:assign var="item" label=$label type=$type}}
|
||||
{{:assign var="config.output_nature.%s"|args:$key value=$item}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser la config par défaut *}}
|
||||
{{#foreach from=$config_defaut.outputs item="elem"}}
|
||||
{{#foreach from=$elem key=label item=value}}
|
||||
{{:assign var="out.%s"|args:$label value=$value}}
|
||||
{{/foreach}}
|
||||
{{:assign var="config.output_nature." from="out"}}
|
||||
{{:assign var="item" label=$label type=$type}}
|
||||
{{:assign var="config.output_nature.%s"|args:$key value=$item}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue