LSformElement :: select_list / select_box : permit to put possible values in labelled...
[ldapsaisie.git] / public_html / templates / default / LSformElement_select_box.tpl
1 <ul class='LSform' id='{$attr_name}'>
2 {if $freeze}
3   {foreach from=$values item=value}
4     {LSformElement_select_checkIsValidValue value=$value possible_values=$possible_values}
5     {if $LSformElement_select_isValidValue}
6     <li>{$LSformElement_select_isValidValue_label}</li>
7     {else}
8     <li class='LSform-errors'>{getFData format=$unrecognized_value_label_format data=$value}</li>
9     {/if}
10   {foreachelse}
11     <li>{$noValueTxt}</li>
12   {/foreach}
13 {else}
14     {foreach from=$possible_values item=label key=value name=LSformElement_selectbox}
15       {if is_array($label)}
16         {if count($label.possible_values)>0}
17         <li>
18           <span class='LSformElement_selectbox_sub_values_label'>{$label.label} :</span>
19           <ul class='LSformElement_selectbox_sub_values'>
20             {foreach from=$label.possible_values item=l key=v name=LSformElement_selectbox_sub_values}
21               <li>
22                 <input type='{if $multiple}checkbox{else}radio{/if}' name='{$attr_name}[]' class='LSformElement_selectbox' id='LSformElement_selectbox_{$attr_name}_{$smarty.foreach.LSformElement_selectbox.index}_{$smarty.foreach.LSformElement_selectbox_sub_values.index}' value="{$v}" {if in_array($v,$values)}checked{/if}/> <label for='LSformElement_selectbox_{$attr_name}_{$smarty.foreach.LSformElement_selectbox.index}_{$smarty.foreach.LSformElement_selectbox_sub_values.index}'>{tr msg=$l}</label>
23               </li>
24             {/foreach}
25           </ul>
26         </li>
27         {/if}
28       {else}
29         <li>
30           <input type='{if $multiple}checkbox{else}radio{/if}' name='{$attr_name}[]' class='LSformElement_selectbox' id='LSformElement_selectbox_{$attr_name}_{$smarty.foreach.LSformElement_selectbox.index}' value="{$value}" {if in_array($value,$values)}checked{/if}/> <label for='LSformElement_selectbox_{$attr_name}_{$smarty.foreach.LSformElement_selectbox.index}'>{tr msg=$label}</label>
31         </li>
32       {/if}
33     {/foreach}
34 {/if}
35 </ul>