LSattr_html::select_box: fix double translation of labels on unfreeze field

This commit is contained in:
Benjamin Renard 2020-09-10 15:52:29 +02:00
parent e62ddbdc19
commit b8c00a8708
2 changed files with 2 additions and 3 deletions

View file

@ -47,7 +47,6 @@ class LSformElement_select_box extends LSformElement_select {
if (!$this -> isFreeze()) {
LStemplate :: addCssFile('LSformElement_select_box.css');
}
$this -> fetchVariables['translate_labels'] = $this -> getParam('translate_labels', true);
return parent :: getDisplay();
}

View file

@ -19,7 +19,7 @@
<ul class='LSformElement_selectbox_sub_values'>
{foreach from=$label.possible_values item=l key=v name=LSformElement_selectbox_sub_values}
<li>
<input type='{if $multiple}checkbox{else}radio{/if}' name='{$attr_name|escape:"htmlall"}[]' class='LSformElement_selectbox' id='LSformElement_selectbox_{$attr_name|escape:"htmlall"}_{$smarty.foreach.LSformElement_selectbox.index}_{$smarty.foreach.LSformElement_selectbox_sub_values.index}' value='{$v|escape:"htmlall"}' {if in_array($v,$values)}checked{/if}/> <label for='LSformElement_selectbox_{$attr_name|escape:"htmlall"}_{$smarty.foreach.LSformElement_selectbox.index}_{$smarty.foreach.LSformElement_selectbox_sub_values.index}'>{if $translate_labels}{tr msg=$l}{else}{$l}{/if}</label>
<input type='{if $multiple}checkbox{else}radio{/if}' name='{$attr_name|escape:"htmlall"}[]' class='LSformElement_selectbox' id='LSformElement_selectbox_{$attr_name|escape:"htmlall"}_{$smarty.foreach.LSformElement_selectbox.index}_{$smarty.foreach.LSformElement_selectbox_sub_values.index}' value='{$v|escape:"htmlall"}' {if in_array($v,$values)}checked{/if}/> <label for='LSformElement_selectbox_{$attr_name|escape:"htmlall"}_{$smarty.foreach.LSformElement_selectbox.index}_{$smarty.foreach.LSformElement_selectbox_sub_values.index}'>{$l}</label>
</li>
{/foreach}
</ul>
@ -27,7 +27,7 @@
{/if}
{else}
<li>
<input type='{if $multiple}checkbox{else}radio{/if}' name='{$attr_name|escape:"htmlall"}[]' class='LSformElement_selectbox' id='LSformElement_selectbox_{$attr_name|escape:"htmlall"}_{$smarty.foreach.LSformElement_selectbox.index}' value='{$value|escape:"htmlall"}' {if in_array($value,$values)}checked{/if}/> <label for='LSformElement_selectbox_{$attr_name|escape:"htmlall"}_{$smarty.foreach.LSformElement_selectbox.index}'>{tr msg=$label}</label>
<input type='{if $multiple}checkbox{else}radio{/if}' name='{$attr_name|escape:"htmlall"}[]' class='LSformElement_selectbox' id='LSformElement_selectbox_{$attr_name|escape:"htmlall"}_{$smarty.foreach.LSformElement_selectbox.index}' value='{$value|escape:"htmlall"}' {if in_array($value,$values)}checked{/if}/> <label for='LSformElement_selectbox_{$attr_name|escape:"htmlall"}_{$smarty.foreach.LSformElement_selectbox.index}'>{$label}</label>
</li>
{/if}
{/foreach}