LSattr_html :: jsonCompositeAttribute : first version
[ldapsaisie.git] / public_html / templates / default / LSformElement_jsonCompositeAttribute_field.tpl
1 {if $freeze}
2   {if isset($parseValue)}
3   {foreach $components as $c => $cconf}
4     {if !isset($parseValue[$c])}{continue}{/if}
5     <p>
6                 <label>{tr msg=$cconf.label} : </label>
7                 <span title="{$parseValue[$c].value}">{$parseValue[$c].translated}</span>
8     </p>
9   {/foreach}
10   {else}
11   {$noValueTxt}
12   {/if}
13 {else}
14   {foreach $components as $c => $cconf}
15     <p data-component="{$c}">
16                 <label>{tr msg=$cconf.label}{if $cconf.required}*{/if}  :</label>
17                 {if $cconf.type=='select_list'}
18                         <select name='{$attr_name}__{$c}[]'>
19                                 {foreach from=$cconf.possible_values key=key item=label}
20                                         {if is_array($label)}
21                                                 {if count($label.possible_values)>0}
22                                                 <optgroup label="{$label.label}">
23                                                         {html_options options=$label.possible_values selected=$parseValue[$c].value}
24                                                 </optgroup>
25                                                 {/if}
26                                         {else}
27                                                 <option value="{$key}" {if $key == $parseValue[$c].value}selected{/if}>{$label}</option>
28                                         {/if}
29                                 {/foreach}
30                         </select>
31                 {else}
32                         <input type='text' name='{$attr_name}__{$c}[]' value="{if $parseValue and $parseValue[$c]}{$parseValue[$c].value}{/if}"/>
33                 {/if}
34     </p>
35   {/foreach}
36 {/if}