SF.net SVN: postfixadmin:[1107] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2011-07-22 20:25:12
|
Revision: 1107 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1107&view=rev Author: christian_boltz Date: 2011-07-22 20:25:06 +0000 (Fri, 22 Jul 2011) Log Message: ----------- create-mailbox.php: - renamed $pCreate_mailbox_*_text to $pCreate_mailbox_*_text_error - replaced $tMessage with flash_error() / flash_info() templates/create-mailbox.tpl: - added 4th column for error messaegs - replaced <h3> with <th> - marked lables with <label> - aligned button with input fields - 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-mailbox.php trunk/templates/create-mailbox.tpl Modified: trunk/create-mailbox.php =================================================================== --- trunk/create-mailbox.php 2011-07-22 20:17:17 UTC (rev 1106) +++ trunk/create-mailbox.php 2011-07-22 20:25:06 UTC (rev 1107) @@ -17,7 +17,6 @@ * * Template Variables: * - * tMessage * tUsername * tName * tQuota @@ -49,6 +48,9 @@ $pCreate_mailbox_password_text = $PALANG['pCreate_mailbox_password_text']; $pCreate_mailbox_quota_text = $PALANG['pCreate_mailbox_quota_text']; +$pCreate_mailbox_username_text_error = ""; +$pCreate_mailbox_password_text_error = ""; +$pCreate_mailbox_quota_text_error = ""; if ($_SERVER['REQUEST_METHOD'] == "GET") { @@ -88,7 +90,7 @@ $tName = $fName; $tQuota = $fQuota; $tDomain = $fDomain; - $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1']; + $pCreate_mailbox_username_text_error = $PALANG['pCreate_mailbox_username_text_error1']; } if (!check_mailbox ($fDomain)) @@ -98,7 +100,7 @@ $tName = $fName; $tQuota = $fQuota; $tDomain = $fDomain; - $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error3']; + $pCreate_mailbox_username_text_error = $PALANG['pCreate_mailbox_username_text_error3']; } if (empty ($fUsername) or !check_email ($fUsername)) @@ -108,7 +110,7 @@ $tName = $fName; $tQuota = $fQuota; $tDomain = $fDomain; - $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error1']; + $pCreate_mailbox_username_text_error = $PALANG['pCreate_mailbox_username_text_error1']; } $tPassGenerated = 0; @@ -126,7 +128,7 @@ $tName = $fName; $tQuota = $fQuota; $tDomain = $fDomain; - $pCreate_mailbox_password_text = $PALANG['pCreate_mailbox_password_text_error']; + $pCreate_mailbox_password_text_error = $PALANG['pCreate_mailbox_password_text_error']; } } @@ -139,7 +141,7 @@ $tName = $fName; $tQuota = $fQuota; $tDomain = $fDomain; - $pCreate_mailbox_quota_text = $PALANG['pCreate_mailbox_quota_text_error']; + $pCreate_mailbox_quota_text_error = $PALANG['pCreate_mailbox_quota_text_error']; } } @@ -151,7 +153,7 @@ $tName = $fName; $tQuota = $fQuota; $tDomain = $fDomain; - $pCreate_mailbox_username_text = $PALANG['pCreate_mailbox_username_text_error2']; + $pCreate_mailbox_username_text_error = $PALANG['pCreate_mailbox_username_text_error2']; } if ($error != 1) @@ -204,7 +206,7 @@ if ($result['rows'] != 1) { $tDomain = $fDomain; - $tMessage = $PALANG['pAlias_result_error'] . "<br />($fUsername -> $fUsername)</br />"; + flash_error($PALANG['pAlias_result_error'] . "<br />($fUsername -> $fUsername)"); } // apparently uppercase usernames really confuse some IMAP clients. @@ -218,7 +220,7 @@ if ($result['rows'] != 1 || !mailbox_postcreation($fUsername,$fDomain,$maildir, $quota)) { $tDomain = $fDomain; - $tMessage .= $PALANG['pCreate_mailbox_result_error'] . "<br />($fUsername)<br />"; + flash_error($PALANG['pCreate_mailbox_result_error'] . "<br />($fUsername)"); db_query('ROLLBACK'); } else @@ -238,11 +240,11 @@ if (!smtp_mail ($fTo, $fFrom, $fSubject, $fBody)) { - $tMessage .= "<br />" . $PALANG['pSendmail_result_error'] . "<br />"; + flash_error($PALANG['pSendmail_result_error']); } else { - $tMessage .= "<br />" . $PALANG['pSendmail_result_success'] . "<br />"; + flash_info($PALANG['pSendmail_result_success']); } } @@ -251,9 +253,9 @@ if (create_mailbox_subfolders($fUsername,$fPassword)) { - $tMessage .= $PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername$tShowpass)"; + flash_info($PALANG['pCreate_mailbox_result_success'] . "<br />($fUsername$tShowpass)"); } else { - $tMessage .= $PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername$tShowpass)"; + flash_info($PALANG['pCreate_mailbox_result_succes_nosubfolders'] . "<br />($fUsername$tShowpass)"); } } @@ -263,11 +265,13 @@ $smarty->assign ('tUsername', $tUsername); $smarty->assign ('select_options', select_options ($list_domains, array ($tDomain)), false); $smarty->assign ('pCreate_mailbox_username_text', $pCreate_mailbox_username_text, false); +$smarty->assign ('pCreate_mailbox_username_text_error', $pCreate_mailbox_username_text_error, false); $smarty->assign ('pCreate_mailbox_password_text', $pCreate_mailbox_password_text, false); +$smarty->assign ('pCreate_mailbox_password_text_error', $pCreate_mailbox_password_text_error, false); $smarty->assign ('tName', $tName, false); $smarty->assign ('tQuota', $tQuota); $smarty->assign ('pCreate_mailbox_quota_text', $pCreate_mailbox_quota_text, false); -$smarty->assign ('tMessage', $tMessage, false); +$smarty->assign ('pCreate_mailbox_quota_text_error', $pCreate_mailbox_quota_text_error, false); $smarty->assign ('smarty_template', 'create-mailbox'); $smarty->display ('index.tpl'); Modified: trunk/templates/create-mailbox.tpl =================================================================== --- trunk/templates/create-mailbox.tpl 2011-07-22 20:17:17 UTC (rev 1106) +++ trunk/templates/create-mailbox.tpl 2011-07-22 20:25:06 UTC (rev 1107) @@ -3,54 +3,57 @@ <form name="mailbox" method="post" action=""> <table> <tr> - <td colspan="3"><h3>{$PALANG.pCreate_mailbox_welcome}</h3></td> + <th colspan="4">{$PALANG.pCreate_mailbox_welcome}</th> </tr> <tr> - <td>{$PALANG.pCreate_mailbox_username}:</td> + <td class="label"><label>{$PALANG.pCreate_mailbox_username}:</label></td> <td><input class="flat" type="text" name="fUsername" value="{$tUsername}"/></td> <td>@ <select name="fDomain">{$select_options}</select> {$pCreate_mailbox_username_text} </td> + <td><span class="error_msg">{$pCreate_mailbox_username_text_error}</span></td> </tr> <tr> - <td>{$PALANG.pCreate_mailbox_password}:</td> + <td class="label"><label>{$PALANG.pCreate_mailbox_password}:</label></td> <td><input class="flat" type="password" name="fPassword" /></td> <td>{$pCreate_mailbox_password_text}</td> + <td><span class="error_msg">{$pCreate_mailbox_password_text_error}</span></td> </tr> <tr> - <td>{$PALANG.pCreate_mailbox_password2}:</td> + <td class="label"><label>{$PALANG.pCreate_mailbox_password2}:</label></td> <td><input class="flat" type="password" name="fPassword2" /></td> - <td> </td> + <td colspan="2"> </td> </tr> <tr> - <td>{$PALANG.pCreate_mailbox_name}:</td> + <td class="label"><label>{$PALANG.pCreate_mailbox_name}:</label></td> <td><input class="flat" type="text" name="fName" value="{$tName}" /></td> <td>{$PALANG.pCreate_mailbox_name_text}</td> + <td> </td> </tr> {if $CONF.quota===YES} <tr> - <td>{$PALANG.pCreate_mailbox_quota}:</td> + <td class="label"><label>{$PALANG.pCreate_mailbox_quota}:</label></td> <td><input class="flat" type="text" name="fQuota" value="{$tQuota}" /></td> <td>{$pCreate_mailbox_quota_text}</td> + <td><span class="error_msg">{$pCreate_mailbox_quota_text_error}</span></td> </tr> {/if} <tr> - <td>{$PALANG.pCreate_mailbox_active}:</td> + <td class="label"><label>{$PALANG.pCreate_mailbox_active}:</label></td> <td><input class="flat" type="checkbox" name="fActive" checked="checked" /></td> - <td> </td> + <td colspan="2"> </td> </tr> <tr> - <td>{$PALANG.pCreate_mailbox_mail}:</td> + <td class="label"><label>{$PALANG.pCreate_mailbox_mail}:</label></td> <td><input class="flat" type="checkbox" name="fMail" 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_mailbox_button}" /></td> + <td> </td> + <td><input class="button" type="submit" name="submit" value="{$PALANG.pCreate_mailbox_button}" /></td> + <td colspan="2"> </td> </tr> - <tr> - <td colspan="3" class="standout">{$tMessage}</td> - </tr> </table> </form> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |