create-domain.php:

- assign $values to smarty in a foreach loop

edit-domain.php, templates/admin_edit-domain.tpl:
- rename some smarty variables to match column name


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1221 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 13 years ago
parent 95bf0161c6
commit 7fd57740cd

@ -70,18 +70,22 @@ if ($error != 1) {
} }
} }
foreach($form_fields as $key => $field) {
$smartykey = "t" . ucfirst($key); # TODO: ugly workaround until I decide on the template variable names
switch ($field['type']) {
case 'bool':
$smarty->assign ($smartykey, ($values[$key] == '1') ? ' checked="checked"' : '');
break;
case 'enum':
$smarty->assign ($smartykey, select_options ($form_fields[$key]['options'], array ($values[$key])),false);
break;
default:
$smarty->assign ($smartykey, $values[$key]);
}
}
$smarty->assign ('mode', 'create'); $smarty->assign ('mode', 'create');
$smarty->assign ('pAdminCreate_domain_domain_text_error', $pAdminCreate_domain_domain_text_error, false); $smarty->assign ('pAdminCreate_domain_domain_text_error', $pAdminCreate_domain_domain_text_error, false);
$smarty->assign ('tDomain', $values['domain']);
$smarty->assign ('tDescription', $values['description']);
$smarty->assign ('tAliases', $values['aliases']);
$smarty->assign ('tMailboxes', $values['mailboxes']);
$smarty->assign ('tDomainquota', $values['quota']);
$smarty->assign ('tMaxquota', $values['maxquota']);
$smarty->assign ('select_options', select_options ($form_fields['transport']['options'], array ($values['transport'])),false);
$smarty->assign ('tDefaultaliases', ($values['default_aliases'] == '1') ? ' checked="checked"' : '');
$smarty->assign ('tBackupmx', ($values['backupmx'] == '1') ? ' checked="checked"' : '');
$smarty->assign ('tActive', ($values['active'] == '1') ? ' checked="checked"' : '');
$smarty->assign ('smarty_template', 'admin_edit-domain'); $smarty->assign ('smarty_template', 'admin_edit-domain');
$smarty->display ('index.tpl'); $smarty->display ('index.tpl');

@ -126,8 +126,8 @@ $smarty->assign ('tDescription', $tDescription);
$smarty->assign ('tAliases', $tAliases); $smarty->assign ('tAliases', $tAliases);
$smarty->assign ('tMailboxes', $tMailboxes); $smarty->assign ('tMailboxes', $tMailboxes);
$smarty->assign ('tMaxquota', $tMaxquota); $smarty->assign ('tMaxquota', $tMaxquota);
$smarty->assign ('tDomainquota', $tDomainquota); $smarty->assign ('tQuota', $tDomainquota);
$smarty->assign ('select_options', select_options($CONF['transport_options'], array($tTransport)), false); $smarty->assign ('tTransport', select_options($CONF['transport_options'], array($tTransport)), false);
if ($tBackupmx) $smarty->assign ('tBackupmx', ' checked="checked"'); if ($tBackupmx) $smarty->assign ('tBackupmx', ' checked="checked"');
if ($tActive) $smarty->assign ('tActive', ' checked="checked"'); if ($tActive) $smarty->assign ('tActive', ' checked="checked"');
$smarty->assign ('smarty_template', 'admin_edit-domain'); $smarty->assign ('smarty_template', 'admin_edit-domain');

@ -42,7 +42,7 @@
{if $CONF.domain_quota===YES} {if $CONF.domain_quota===YES}
<tr> <tr>
<td class="label"><label>{$PALANG.pAdminEdit_domain_quota}:</label></td> <td class="label"><label>{$PALANG.pAdminEdit_domain_quota}:</label></td>
<td><input class="flat" type="text" name="quota" value="{$tDomainquota}" /></td> <td><input class="flat" type="text" name="quota" value="{$tQuota}" /></td>
<td>{$PALANG.pAdminEdit_domain_maxquota_text}</td> <td>{$PALANG.pAdminEdit_domain_maxquota_text}</td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
@ -58,7 +58,7 @@
{if $CONF.transport===YES} {if $CONF.transport===YES}
<tr> <tr>
<td class="label"><label>{$PALANG.pAdminEdit_domain_transport}:</label></td> <td class="label"><label>{$PALANG.pAdminEdit_domain_transport}:</label></td>
<td><select class="flat" name="transport">{$select_options}</select></td> <td><select class="flat" name="transport">{$tTransport}</select></td>
<td>{$PALANG.pAdminEdit_domain_transport_text}</td> <td>{$PALANG.pAdminEdit_domain_transport_text}</td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
@ -66,7 +66,7 @@
{if $mode == 'create'} {if $mode == 'create'}
<tr> <tr>
<td class="label"><label>{$PALANG.pAdminCreate_domain_defaultaliases}:</label></td> <td class="label"><label>{$PALANG.pAdminCreate_domain_defaultaliases}:</label></td>
<td><input class="flat" type="checkbox" value='1' name="default_aliases"{$tDefaultaliases}/></td> <td><input class="flat" type="checkbox" value='1' name="default_aliases"{$tDefault_aliases}/></td>
<td>{$PALANG.pAdminCreate_domain_defaultaliases_text}</td> <td>{$PALANG.pAdminCreate_domain_defaultaliases_text}</td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>

Loading…
Cancel
Save