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

- move handling of displaying checkboxes to editform.tpl.
  This means: One switch block less in create-domain.php



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1262 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 13 years ago
parent 398ce70132
commit d065179993

@ -122,13 +122,7 @@ foreach($form_fields as $key => $field) {
$fielderror[$key] = '';
}
switch ($field['type']) {
case 'bool':
$smarty->assign ("value_$key", ($values[$key] == '1') ? ' checked="checked"' : '');
break;
default:
$smarty->assign ("value_$key", $values[$key]);
}
$smarty->assign ("value_$key", $values[$key]);
}
}

@ -21,7 +21,7 @@
{if $table == 'foo' && $key == 'bar'}
Special handling (td content) for {$table} / {$key}
{elseif $field.type == 'bool'}
<input class="flat" type="checkbox" value='1' name="{$key}"{$value_{$key}}/>
<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_transport}

Loading…
Cancel
Save