mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
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
This commit is contained in:
1 parent
06c2d414ef
commit
9104b0652a
1 file changed
+11
-1
+11
-1
@@ -25,8 +25,18 @@
|
||||
<input class="flat" type="checkbox" value='1' name="{$key}"{if {$value_{$key}} == 1} checked="checked"{/if}/>
|
||||
{elseif $field.type == 'enum'}
|
||||
<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>
|
||||
{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}
|
||||
<input class="flat" type="text" name="{$key}" value="{$value_{$key}}" />
|
||||
{/if}
|
||||
|
||||
Reference in new issue
Block a user