editform.tpl:

- implement handling of 'list' fields (<select> with multiple choices 
  allowed)
- also include alternative implementation with checkboxes (commented out)
- change {$value_{$key}} to $value_{$key} for 'enum' to stay in sync 
  with 'list' ('list' fails with the additional {...} because it converts
  the array to the string "Array") (seems to be new behaviour in Smarty 
  3.1.5 - IIRC 3.0.7 required the additional {...})


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1290 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 13 years ago
parent 06c2d414ef
commit 9104b0652a

@ -25,8 +25,18 @@
<input class="flat" type="checkbox" value='1' name="{$key}"{if {$value_{$key}} == 1} checked="checked"{/if}/> <input class="flat" type="checkbox" value='1' name="{$key}"{if {$value_{$key}} == 1} checked="checked"{/if}/>
{elseif $field.type == 'enum'} {elseif $field.type == 'enum'}
<select class="flat" name="{$key}"> <select class="flat" name="{$key}">
{html_options output=$struct.{$key}.options values=$struct.{$key}.options selected={$value_{$key}}} {html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key}}
</select> </select>
{elseif $field.type == 'list'}
<select class="flat" name="{$key}[]" size="10" multiple="multiple">
{html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key}}
</select>
<!-- alternative:
<div style='max-height:30em; overflow:auto;'>
{html_checkboxes name={$key} output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key} separator="<br />"}
</div>
-->
{else} {else}
<input class="flat" type="text" name="{$key}" value="{$value_{$key}}" /> <input class="flat" type="text" name="{$key}" value="{$value_{$key}}" />
{/if} {/if}

Loading…
Cancel
Save