LSformElement :: select_list / select_box : permit to put possible values in labelled...
[ldapsaisie.git] / public_html / templates / default / LSformElement_select.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   <li>
15     <select name='{$attr_name}[]' {if $multiple}multiple{/if} class='LSformElement_select'>
16       {foreach from=$possible_values key=key item=label}
17         {if is_array($label)}
18           {if count($label.possible_values)>0}
19           <optgroup label="{$label.label}">
20             {html_options options=$label.possible_values selected=$values}
21           </optgroup>
22           {/if}
23         {else}
24           <option value="{$key}" {if in_array($key,$values)}selected{/if}>{$label}</option>
25         {/if}
26       {/foreach}
27     </select>
28   </li>
29 {/if}
30 </ul>