create-domain.php:

- renamed $pAdminCreate_domain_domain_text to $pAdminCreate_domain_domain_text_error 
- replaced $tMessage with flash_error(), flash_info() and 
  $pAdminCreate_domain_domain_text_error 
- differences to Dale's patch:
  - removed now always empty smarty->assign for $pAdminCreate_domain_domain_text

templates/admin_create-domain.tpl:
- added 4th column for error messages
- marked labels as <label>
- aligned button to input fields
- removed tMessage
- differences to Dale's patch:
  - removed now unused $pAdminCreate_domain_domain_text

variables.inc.php:
- removed now unused $pAdminCreate_domain_domain_text
  (this was not part of Dale's patch)

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1102 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 14 years ago
parent 5f4f20accf
commit 12694a420f

@ -18,7 +18,6 @@
*
* Template Variables:
*
* tMessage
* tDomain
* tDescription
* tAliases
@ -102,8 +101,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
if (isset ($_POST['fTransport'])) $tTransport = $fTransport;
if (isset ($_POST['fDefaultaliases'])) $tDefaultaliases = $fDefaultaliases;
if (isset ($_POST['fBackupmx'])) $tBackupmx = $fBackupmx;
$pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error2'];
if (domain_exist ($fDomain)) $pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error'];
$pAdminCreate_domain_domain_text_error = $PALANG['pAdminCreate_domain_domain_text_error2'];
if (domain_exist ($fDomain)) $pAdminCreate_domain_domain_text_error = $PALANG['pAdminCreate_domain_domain_text_error'];
}
if ($error != 1)
@ -128,7 +127,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$result = db_query($sql_query);
if ($result['rows'] != 1)
{
$tMessage = $PALANG['pAdminCreate_domain_result_error'] . "<br />($fDomain)<br />";
$pAdminCreate_domain_domain_text_error = $PALANG['pAdminCreate_domain_result_error'] . "<br />($fDomain)<br />";
}
else
{
@ -140,17 +139,19 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified) VALUES ('$address','$goto','$fDomain',NOW(),NOW())");
}
}
$tMessage = $PALANG['pAdminCreate_domain_result_success'] . "<br />($fDomain)</br />";
flash_info($PALANG['pAdminCreate_domain_result_success'] . "<br />($fDomain)</br />");
}
if (!domain_postcreation($fDomain))
{
$tMessage = $PALANG['pAdminCreate_domain_error'];
flash_error($PALANG['pAdminCreate_domain_error']);
}
}
}
$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);
$smarty->assign ('tDescription', $tDescription, false);
$smarty->assign ('tAliases', $tAliases);
$smarty->assign ('tMailboxes', $tMailboxes);
@ -159,7 +160,6 @@ $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 ('tMessage', $tMessage, false);
$smarty->assign ('smarty_template', 'admin_create-domain');
$smarty->display ('index.tpl');

@ -2,64 +2,71 @@
<form name="create_domain" method="post" action="">
<table>
<tr>
<td colspan="3"><h3>{$PALANG.pAdminCreate_domain_welcome}</h3></td>
<th colspan="4">{$PALANG.pAdminCreate_domain_welcome}</th>
</tr>
<tr>
<td>{$PALANG.pAdminCreate_domain_domain}:</td>
<td class="label"><label>{$PALANG.pAdminCreate_domain_domain}:</label></td>
<td><input class="flat" type="text" name="fDomain" value="{$tDomain}" /></td>
<td>{$pAdminCreate_domain_domain_text}</td>
<td>&nbsp;</td>
<td><span class="error_msg">{$pAdminCreate_domain_domain_text_error}</span></td>
</tr>
<tr>
<td>{$PALANG.pAdminCreate_domain_description}:</td>
<td class="label"><label>{$PALANG.pAdminCreate_domain_description}:</label></td>
<td><input class="flat" type="text" name="fDescription" value="{$tDescription}" /></td>
<td>&nbsp;</td>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td>{$PALANG.pAdminCreate_domain_aliases}:</td>
<td class="label"><label>{$PALANG.pAdminCreate_domain_aliases}:</label></td>
<td><input class="flat" type="text" name="fAliases" value="{$tAliases}" /></td>
<td>{$PALANG.pAdminCreate_domain_aliases_text}</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>{$PALANG.pAdminCreate_domain_mailboxes}:</td>
<td class="label"><label>{$PALANG.pAdminCreate_domain_mailboxes}:</label></td>
<td><input class="flat" type="text" name="fMailboxes" value="{$tMailboxes}" /></td>
<td>{$PALANG.pAdminCreate_domain_mailboxes_text}</td>
<td>&nbsp;</td>
</tr>
{if $CONF.domain_quota===YES}
<tr>
<td>{$PALANG.pAdminEdit_domain_quota}:</td>
<td class="label"><label>{$PALANG.pAdminEdit_domain_quota}:</label></td>
<td><input class="flat" type="text" name="fDomainquota" value="{$tDomainquota}" /></td>
<td>{$PALANG.pAdminCreate_domain_maxquota_text}</td>
<td>&nbsp;</td>
</tr>
{/if}
{if $CONF.quota===YES}
<tr>
<td>{$PALANG.pAdminCreate_domain_maxquota}:</td>
<td class="label"><label>{$PALANG.pAdminCreate_domain_maxquota}:</label></td>
<td><input class="flat" type="text" name="fMaxquota" value="{$tMaxquota}" /></td>
<td>{$PALANG.pAdminCreate_domain_maxquota_text}</td>
<td>&nbsp;</td>
</tr>
{/if}
{if $CONF.transport===YES}
<tr>
<td>{$PALANG.pAdminCreate_domain_transport}:</td>
<td class="label"><label>{$PALANG.pAdminCreate_domain_transport}:</label></td>
<td><select class="flat" name="fTransport">{$select_options}</select></td>
<td>{$PALANG.pAdminCreate_domain_transport_text}</td>
<td>&nbsp;</td>
</tr>
{/if}
<tr>
<td>{$PALANG.pAdminCreate_domain_defaultaliases}:</td>
<td class="label"><label>{$PALANG.pAdminCreate_domain_defaultaliases}:</label></td>
<td><input class="flat" type="checkbox" value='on' name="fDefaultaliases"{$tDefaultaliases}/></td>
<td>{$PALANG.pAdminCreate_domain_defaultaliases_text}</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>{$PALANG.pAdminCreate_domain_backupmx}:</td>
<td class="label"><label>{$PALANG.pAdminCreate_domain_backupmx}:</label></td>
<td><input class="flat" type="checkbox" value='on' name="fBackupmx"{$tBackupmx}/></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="{$PALANG.pAdminCreate_domain_button}" /></td>
</tr>
<tr>
<td colspan="3" class="standout">{$tMessage}</td>
<td>&nbsp;</td>
<td><input class="button" type="submit" name="submit" value="{$PALANG.pAdminCreate_domain_button}" /></td>
<td colspan="2">&nbsp;</td>
</tr>
</table>
</form>

@ -77,7 +77,6 @@ $tSubject = "";
$tUsername = "";
$tTransport = "";
$pAdminCreate_domain_domain_text = "&nbsp;";
$pCreate_alias_address_text = "&nbsp;";
$pCreate_alias_goto_text = "&nbsp;";
$pCreate_mailbox_password_text = "&nbsp;";

Loading…
Cancel
Save