From 6c35590eb723d64cb4ea0b2b1363adf0bec54644 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 31 Jul 2011 14:32:51 +0000 Subject: [PATCH] Merge admin_edit-domain.tpl and admin_create-domain.tpl admin_edit-domain.tpl: - merged with admin_create-domain.tpl - added various {if $mode = ...} - added 4th column for error messages admin_create-domain.tpl: - deleted edit-domain.php: - added mode = edit smarty variable - added pAdminCreate_domain_domain_text_error smarty variable to avoid "undefined variable" warning create-domain.php - added mode = create smarty variable - switch to admin_edit-domain template git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1152 a1433add-5e2c-0410-b055-b7f2511e0802 --- create-domain.php | 3 +- edit-domain.php | 2 + templates/admin_create-domain.tpl | 73 ------------------------------- templates/admin_edit-domain.tpl | 42 +++++++++++++++--- 4 files changed, 40 insertions(+), 80 deletions(-) delete mode 100644 templates/admin_create-domain.tpl diff --git a/create-domain.php b/create-domain.php index 6d2cd482..fabfd038 100644 --- a/create-domain.php +++ b/create-domain.php @@ -156,6 +156,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") } +$smarty->assign ('mode', 'create'); $smarty->assign ('tDomain', $tDomain); $smarty->assign ('pAdminCreate_domain_domain_text', $pAdminCreate_domain_domain_text, false); $smarty->assign ('pAdminCreate_domain_domain_text_error', $pAdminCreate_domain_domain_text_error, false); @@ -167,7 +168,7 @@ $smarty->assign ('tMaxquota', $tMaxquota,false); # TODO: why is sanitize disable $smarty->assign ('select_options', select_options ($CONF ['transport_options'], array ($tTransport)),false); $smarty->assign ('tDefaultaliases', ($tDefaultaliases == 'on') ? ' checked="checked"' : ''); $smarty->assign ('tBackupmx', ($tBackupmx == 'on') ? ' checked="checked"' : ''); -$smarty->assign ('smarty_template', 'admin_create-domain'); +$smarty->assign ('smarty_template', 'admin_edit-domain'); $smarty->display ('index.tpl'); /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ diff --git a/edit-domain.php b/edit-domain.php index bbd933e2..8cc242cb 100644 --- a/edit-domain.php +++ b/edit-domain.php @@ -119,6 +119,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") } } +$smarty->assign ('mode', 'edit'); +$smarty->assign ('pAdminCreate_domain_domain_text_error', ''); $smarty->assign ('domain', $domain); $smarty->assign ('tDescription', $tDescription); $smarty->assign ('tAliases', $tAliases); diff --git a/templates/admin_create-domain.tpl b/templates/admin_create-domain.tpl deleted file mode 100644 index 10cfd758..00000000 --- a/templates/admin_create-domain.tpl +++ /dev/null @@ -1,73 +0,0 @@ -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -{if $CONF.domain_quota===YES} - - - - - - -{/if} -{if $CONF.quota===YES} - - - - - - -{/if} -{if $CONF.transport===YES} - - - - - - -{/if} - - - - - - - - - - - - - - - - - -
{$PALANG.pAdminCreate_domain_welcome}
 {$pAdminCreate_domain_domain_text_error}
 
{$PALANG.pAdminEdit_domain_aliases_text} 
{$PALANG.pAdminEdit_domain_mailboxes_text} 
{$PALANG.pAdminEdit_domain_maxquota_text} 
{$PALANG.pAdminEdit_domain_maxquota_text} 
{$PALANG.pAdminEdit_domain_transport_text} 
{$PALANG.pAdminCreate_domain_defaultaliases_text} 
  
  
-
-
diff --git a/templates/admin_edit-domain.tpl b/templates/admin_edit-domain.tpl index fcffb3a6..95bea21e 100644 --- a/templates/admin_edit-domain.tpl +++ b/templates/admin_edit-domain.tpl @@ -2,33 +2,49 @@
- + - + + - + + + {if $CONF.domain_quota===YES} + {/if} {if $CONF.quota===YES} @@ -36,6 +52,7 @@ + {/if} {if $CONF.transport===YES} @@ -43,21 +60,34 @@ + + +{/if} +{if $mode == 'create'} + + + + + {/if} - + + +{if $mode == 'edit'} + - + +{/if} - +
{$PALANG.pAdminEdit_domain_welcome} +{if $mode == 'edit'} + {$PALANG.pAdminEdit_domain_welcome} +{else} + {$PALANG.pAdminCreate_domain_welcome} +{/if} +
{$domain} +{if $mode == 'edit'} + {$domain} +{else} + +{/if} +  {$pAdminCreate_domain_domain_text_error}
  
{$PALANG.pAdminEdit_domain_aliases_text} 
{$PALANG.pAdminEdit_domain_mailboxes_text} 
{$PALANG.pAdminEdit_domain_maxquota_text} 
{$PALANG.pAdminEdit_domain_maxquota_text} 
{$PALANG.pAdminEdit_domain_transport_text} 
{$PALANG.pAdminCreate_domain_defaultaliases_text}