Gestion config par défaut + ajout contrôles
This commit is contained in:
parent
be70b6ef6e
commit
794094b712
11 changed files with 226 additions and 161 deletions
36
_get_config.html
Normal file
36
_get_config.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{{*
|
||||
Récupérer soit la config enregistrée, soit la config par défaut
|
||||
résultat : config.inputNature et config.outputNature
|
||||
*}}
|
||||
|
||||
{{* config par défaut *}}
|
||||
{{:read file="/%s/defaut.json"|args:$module.name assign="config_defaut"}}
|
||||
{{:assign config_defaut=$config_defaut|json_decode}}
|
||||
|
||||
{{if $module.config.inputNature != null}}
|
||||
{{:assign var=config.inputNature value=$module.config.inputNature}}
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser la config par défaut *}}
|
||||
{{#foreach from=$config_defaut.entrées item="elem"}}
|
||||
{{#foreach from=$elem key=label item=value}}
|
||||
{{:assign var="item.label" value=$label}}
|
||||
{{:assign var="item.type" value=$value}}
|
||||
{{:assign var="config.inputNature." value=$item}}
|
||||
{{/foreach}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
||||
{{if $module.config.outputNature != null}}
|
||||
{{:assign var=config.outputNature value=$module.config.outputNature}}
|
||||
{{else}}
|
||||
{{* pas de config enregistrée : utiliser la config par défaut *}}
|
||||
{{#foreach from=$config_defaut.sorties item="elem"}}
|
||||
{{#foreach from=$elem key=label item=value}}
|
||||
{{:assign var="item.label" value=$label}}
|
||||
{{:assign var="item.type" value=$value}}
|
||||
{{:assign var="config.outputNature." value=$item}}
|
||||
{{/foreach}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue