From d0651799938ec14f380a382b5baf140c56e7c723 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Fri, 4 Nov 2011 21:26:25 +0000 Subject: [PATCH] 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 --- create-domain.php | 8 +------- templates/editform.tpl | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/create-domain.php b/create-domain.php index c23a0a7a..5fa6e3e2 100644 --- a/create-domain.php +++ b/create-domain.php @@ -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]); } } diff --git a/templates/editform.tpl b/templates/editform.tpl index f8bdf909..c9952416 100644 --- a/templates/editform.tpl +++ b/templates/editform.tpl @@ -21,7 +21,7 @@ {if $table == 'foo' && $key == 'bar'} Special handling (td content) for {$table} / {$key} {elseif $field.type == 'bool'} - + {elseif $field.type == 'enum'}