0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

create-domain.php:

- assign smarty values only for fields that have the display_in_form flag

model/DomainHandler.php:
- initStruct(): make default_aliases display_in_form dependant on $this->new
  (it's useless in edit mode)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1235 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
Christian Boltz 2011-10-24 22:17:43 +00:00
parent 7b15c4b47d
commit 72441d7dd6
2 changed files with 3 additions and 1 deletions

View File

@ -112,6 +112,7 @@ if ($error != 1 && $new) { # no error and not in edit mode - reset fields to def
}
foreach($form_fields as $key => $field) {
if($form_fields[$key]['display_in_form']) {
$smartykey = "t" . ucfirst($key); # TODO: ugly workaround until I decide on the template variable names
switch ($field['type']) {
case 'bool':
@ -123,6 +124,7 @@ foreach($form_fields as $key => $field) {
default:
$smarty->assign ($smartykey, $values[$key]);
}
}
}
$smarty->assign ('mode', $mode);

View File

@ -117,7 +117,7 @@ class DomainHandler extends PFAHandler {
/*options*/ $this->getTransports() ),
'backupmx' => pacol( 1, 1, 1, 'bool', 'pAdminEdit_domain_backupmx' , '' ),
'active' => pacol( 1, 1, 1, 'bool', 'pAdminEdit_domain_active' , '' , 1 ),
'default_aliases' => pacol( $this->new, 1, 0, 'bool', 'pAdminCreate_domain_defaultaliases ', '' , 1,'', /*not in db*/ 1 ),
'default_aliases' => pacol( $this->new, $this->new, 0, 'bool', 'pAdminCreate_domain_defaultaliases ', '' , 1,'', /*not in db*/ 1 ),
'created' => pacol( 0, 0, 1, 'ts', '' /* TODO: "created" label */ , '' ),
'modified' => pacol( 0, 0, 1, 'ts', 'pAdminList_domain_modified' , '' ),
);