SF.net SVN: postfixadmin:[1262] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2011-11-04 21:26:31
|
Revision: 1262 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1262&view=rev Author: christian_boltz Date: 2011-11-04 21:26:25 +0000 (Fri, 04 Nov 2011) Log Message: ----------- create-domain.php, templates/editform.tpl: - move handling of displaying checkboxes to editform.tpl. This means: One switch block less in create-domain.php Modified Paths: -------------- trunk/create-domain.php trunk/templates/editform.tpl Modified: trunk/create-domain.php =================================================================== --- trunk/create-domain.php 2011-11-01 00:00:13 UTC (rev 1261) +++ trunk/create-domain.php 2011-11-04 21:26:25 UTC (rev 1262) @@ -122,13 +122,7 @@ $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]); } } Modified: trunk/templates/editform.tpl =================================================================== --- trunk/templates/editform.tpl 2011-11-01 00:00:13 UTC (rev 1261) +++ trunk/templates/editform.tpl 2011-11-04 21:26:25 UTC (rev 1262) @@ -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} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |