create-domain.php, templates/editform.tpl:

- move special handling for enum fields from PHP select_options() to 
  the template using smarty {html_options}


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1260 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 13 years ago
parent 161c9b1ed2
commit def9c22fb1

@ -126,9 +126,6 @@ foreach($form_fields as $key => $field) {
case 'bool':
$smarty->assign ("value_$key", ($values[$key] == '1') ? ' checked="checked"' : '');
break;
case 'enum':
$smarty->assign ("value_$key", select_options ($form_fields[$key]['options'], array ($values[$key])),false); # non-escaped
break;
default:
$smarty->assign ("value_$key", $values[$key]);
}

@ -23,7 +23,9 @@
{elseif $field.type == 'bool'}
<input class="flat" type="checkbox" value='1' name="{$key}"{$value_{$key}}/>
{elseif $field.type == 'enum'}
<select class="flat" name="{$key}">{$value_{$key}}</select>
<select class="flat" name="{$key}">
{html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_transport}
</select>
{else}
<input class="flat" type="text" name="{$key}" value="{$value_{$key}}" />
{/if}

Loading…
Cancel
Save