SF.net SVN: postfixadmin:[1104] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2011-07-22 18:36:28
|
Revision: 1104 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1104&view=rev Author: christian_boltz Date: 2011-07-22 18:36:21 +0000 (Fri, 22 Jul 2011) Log Message: ----------- create-alias.php: - renamed $pCreate_alias_address_text to $pCreate_alias_address_text_error - replaced $tMessage with flash_error() / flash_info() - changes compared to Dale's patch: - do not add $fAddress and $fGoto to $PALANG['pCreate_alias_goto_text_error'] error message templates/create-alias.tpl: - added 4th column for error messages - replace <h3> with <th> - mark labels with <label> - aligned button with input fields - added $PALANG[pCreate_alias_help] - removed tMessage 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 Modified Paths: -------------- trunk/create-alias.php trunk/templates/create-alias.tpl Modified: trunk/create-alias.php =================================================================== --- trunk/create-alias.php 2011-07-21 22:47:53 UTC (rev 1103) +++ trunk/create-alias.php 2011-07-22 18:36:21 UTC (rev 1104) @@ -19,7 +19,6 @@ * * Template Variables: * - * tMessage * tAddress * tGoto * tDomain @@ -45,6 +44,7 @@ } $pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text']; +$pCreate_alias_address_text_error = ""; if ($_SERVER['REQUEST_METHOD'] == "GET") { @@ -87,7 +87,7 @@ $tAddress = escape_string ($_POST['fAddress']); $tGoto = $fGoto; $tDomain = $fDomain; - $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error1']; + $pCreate_alias_address_text_error = $PALANG['pCreate_alias_address_text_error1']; } if(!check_alias($fDomain)) { @@ -95,7 +95,7 @@ $tAddress = escape_string ($_POST['fAddress']); $tGoto = $fGoto; $tDomain = $fDomain; - $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error3']; + $pCreate_alias_address_text_error = $PALANG['pCreate_alias_address_text_error3']; } if(empty ($fAddress) || !check_email ($fAddress)) { @@ -103,7 +103,7 @@ $tAddress = escape_string ($_POST['fAddress']); $tGoto = $fGoto; $tDomain = $fDomain; - $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error1']; + $pCreate_alias_address_text_error = $PALANG['pCreate_alias_address_text_error1']; } // Begin check alias email @@ -117,7 +117,7 @@ if (empty ($goto) && !authentication_has_role('global-admin')) { $error = 1; $tGoto = $_POST['fGoto']; - $tMessage = $PALANG['pEdit_alias_goto_text_error1']; + flash_error($PALANG['pEdit_alias_goto_text_error1']); } $new_aliases = array(); @@ -132,8 +132,7 @@ if (!check_email($address)) { $error = 1; $tGoto = $goto; - if (!empty($tMessage)) $tMessage .= "<br />"; - $tMessage .= $PALANG['pEdit_alias_goto_text_error2'] . "$address</span>"; + flash_error($PALANG['pEdit_alias_goto_text_error2'] . "$address"); } } @@ -146,7 +145,7 @@ $tAddress = escape_string ($_POST['fAddress']); $tGoto = $fGoto; $tDomain = $fDomain; - $pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text_error']; + flash_error($PALANG['pCreate_alias_goto_text_error']"); } if (escape_string($_POST['fAddress']) == "*") { @@ -160,7 +159,7 @@ $tAddress = escape_string ($_POST['fAddress']); $tGoto = $fGoto; $tDomain = $fDomain; - $pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error2']; + $pCreate_alias_address_text_error = $PALANG['pCreate_alias_address_text_error2']; } if ($fActive == "on") { @@ -178,13 +177,13 @@ $result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified,active) VALUES ('$fAddress','$fGoto','$fDomain',NOW(),NOW(),'$sqlActive')"); if ($result['rows'] != 1) { $tDomain = $fDomain; - $tMessage = $PALANG['pCreate_alias_result_error'] . "<br />($fAddress -> $fGoto)<br />\n"; + flash_error($PALANG['pCreate_alias_result_error'] . "<br />($fAddress -> $fGoto)<br />\n"); } else { db_log ($fDomain, 'create_alias', "$fAddress -> $fGoto"); $tDomain = $fDomain; - $tMessage = $PALANG['pCreate_alias_result_success'] . "<br />($fAddress -> $fGoto)<br />\n"; + flash_info($PALANG['pCreate_alias_result_success'] . "<br />($fAddress -> $fGoto)<br />\n"); } } else { # on error $tAddress = htmlentities($_POST['fAddress']); @@ -196,9 +195,9 @@ $smarty->assign ('tAddress', $tAddress); $smarty->assign ('select_options', select_options ($list_domains, array ($tDomain)), false); $smarty->assign ('pCreate_alias_address_text', $pCreate_alias_address_text, false); +$smarty->assign ('pCreate_alias_address_text_error', $pCreate_alias_address_text_error, false); $smarty->assign ('tGoto', $tGoto, false); $smarty->assign ('pCreate_alias_goto_text', $pCreate_alias_goto_text); -$smarty->assign ('tMessage', $tMessage, false); $smarty->assign ('smarty_template', 'create-alias'); $smarty->display ('index.tpl'); Modified: trunk/templates/create-alias.tpl =================================================================== --- trunk/templates/create-alias.tpl 2011-07-21 22:47:53 UTC (rev 1103) +++ trunk/templates/create-alias.tpl 2011-07-22 18:36:21 UTC (rev 1104) @@ -3,34 +3,33 @@ <form name="alias" method="post" action=""> <table> <tr> - <td colspan="3"><h3>{$PALANG.pCreate_alias_welcome}</h3></td> + <th colspan="4">{$PALANG.pCreate_alias_welcome}</th> </tr> <tr> - <td>{$PALANG.pCreate_alias_address}</td> - <td><input class="flat" type="text" name="fAddress" value="{$tAddress}" /></td> - <td>@ + <td class="label"><label>{$PALANG.pCreate_alias_address}:</label></td> + <td colspan="2"><input class="flat" type="text" name="fAddress" value="{$tAddress}" /> + @ <select class="flat" name="fDomain">{$select_options}</select> {$pCreate_alias_address_text} </td> + <td><span class="error_msg">{$pCreate_alias_address_text_error}</span></td> </tr> <tr> - <td>{$PALANG.pCreate_alias_goto}:</td> - <td colspan="2"><textarea class="flat" rows="10" cols="60" name="fGoto">{$tGoto}</textarea></td> + <td class="label"><label>{$PALANG.pCreate_alias_goto}:</label></td> + <td><textarea class="flat" rows="10" cols="35" name="fGoto">{$tGoto}</textarea></td> + <td>{$PALANG.pCreate_alias_help}<br /><br />{$PALANG.pCreate_alias_catchall_text}</td> + <td> </td> </tr> <tr> - <td>{$PALANG.pCreate_alias_active}:</td> + <td class="label"><label>{$PALANG.pCreate_alias_active}:</label></td> <td><input class="flat" type="checkbox" name="fActive" checked="checked"/></td> - <td> </td> + <td colspan="2"> </td> </tr> <tr> - <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="{$PALANG.pCreate_alias_button}" /></td> + <td> </td> + <td><input class="button" type="submit" name="submit" value="{$PALANG.pCreate_alias_button}" /></td> + <td colspan="2"> </td> </tr> - <tr> - <td colspan="3" class="standout">{$tMessage}</td> - </tr> - <tr> - <td colspan="3" class="help_text">{$PALANG.pCreate_alias_catchall_text}</td> - </tr> </table> </form> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |