48 lines
1.7 KiB
HTML
48 lines
1.7 KiB
HTML
{{* -*- brindille -*- *}}
|
|
|
|
{{*
|
|
Récupérer soit la config enregistrée, soit la config par défaut
|
|
résultat : config.input_nature et config.output_nature
|
|
*}}
|
|
|
|
{{* 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"}}
|
|
{{: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"}}
|
|
{{: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*}}
|
|
|
|
{{*
|
|
{{:assign var="label" from="config.input_nature.%s.label"|args:"9e909c25-14dc-4e02-b97e-73c34ab2ee9b"}}
|
|
{{:assign var="type" from="config.input_nature.%s.type"|args:"30eb854c-f89a-4c19-85e4-baa5e34a0317"}}
|
|
{{:debug label=$label type=$type}}
|
|
*}}
|
|
|
|
{{if $module.config.output_nature != null}}
|
|
{{#foreach from=$module.config.output_nature item="elem"}}
|
|
{{: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"}}
|
|
{{:assign var="item" label=$label type=$type}}
|
|
{{:assign var="config.output_nature.%s"|args:$key value=$item}}
|
|
{{/foreach}}
|
|
{{/if}}
|
|
{{*:debug config.output_nature=$config.output_nature*}}
|