SF.net SVN: postfixadmin:[1101] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2011-07-20 23:38:48
|
Revision: 1101 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=1101&view=rev Author: christian_boltz Date: 2011-07-20 23:38:42 +0000 (Wed, 20 Jul 2011) Log Message: ----------- edit-mailbox.php: - replace $tMessaeg with flash_error() - use pEdit_mailbox_quota_text_error instead of pEdit_mailbox_quota_text for error message templates/edit-mailbox.tpl: - added 4th column for error messages - replaced <h3> with <th> - marked labels with <label> - marked non-editable fields with <em> - aligned buttons 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/edit-mailbox.php trunk/templates/edit-mailbox.tpl Modified: trunk/edit-mailbox.php =================================================================== --- trunk/edit-mailbox.php 2011-07-20 23:29:40 UTC (rev 1100) +++ trunk/edit-mailbox.php 2011-07-20 23:38:42 UTC (rev 1101) @@ -18,7 +18,6 @@ * * Template Variables: * - * tMessage * tName * tQuota * @@ -48,15 +47,15 @@ $pEdit_mailbox_name_text = $PALANG['pEdit_mailbox_name_text']; $pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text']; +$pEdit_mailbox_quota_text_error = ""; - if (!(check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) ) { $error = 1; $tName = $fName; $tQuota = $fQuota; $tActive = $fActive; - $tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</span>"; + flash_error($PALANG['pEdit_mailbox_domain_error'] . "$fDomain"); } $result = db_query("SELECT * FROM $table_mailbox WHERE username = '$fUsername' AND domain = '$fDomain'"); @@ -123,7 +122,7 @@ $tName = $fName; $tQuota = $fQuota; $tActive = $fActive; - $pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text_error']; + $pEdit_mailbox_quota_text_error = $PALANG['pEdit_mailbox_quota_text_error']; } } if ($error != 1) @@ -157,7 +156,7 @@ $result = db_update_q('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars); # TODO: check if we need the AND domain=... clause, if not, switch to db_update() $maildir = $user_details['maildir']; if ($result != 1 || !mailbox_postedit($fUsername,$fDomain,$maildir, $quota)) { - $tMessage = $PALANG['pEdit_mailbox_result_error']; + flash_error($PALANG['pEdit_mailbox_result_error']); } else { db_log ($fDomain, 'edit_mailbox', $fUsername); @@ -182,8 +181,8 @@ $smarty->assign ('tMaxquota', $tMaxquota); $smarty->assign ('tQuota', $tQuota); $smarty->assign ('pEdit_mailbox_quota_text', $pEdit_mailbox_quota_text); +$smarty->assign ('pEdit_mailbox_quota_text_error', $pEdit_mailbox_quota_text_error); if ($tActive) $smarty->assign ('tActive', ' checked="checked"'); -$smarty->assign ('tMessage', $tMessage, false); $smarty->assign ('smarty_template', 'edit-mailbox'); $smarty->display ('index.tpl'); /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ Modified: trunk/templates/edit-mailbox.tpl =================================================================== --- trunk/templates/edit-mailbox.tpl 2011-07-20 23:29:40 UTC (rev 1100) +++ trunk/templates/edit-mailbox.tpl 2011-07-20 23:38:42 UTC (rev 1101) @@ -3,49 +3,53 @@ <form name="mailbox" method="post" action=""> <table> <tr> - <td colspan="3"><h3>{$PALANG.pEdit_mailbox_welcome}</h3></td> + <th colspan="4">{$PALANG.pEdit_mailbox_welcome}</th> </tr> <tr> - <td>{$PALANG.pEdit_mailbox_username}</td> - <td>{$fUsername}</td> + <td class="label"><label>{$PALANG.pEdit_mailbox_username}:</label></td> + <td><em>{$fUsername}</em></td> <td>{$pEdit_mailbox_username_text}</td> + <td> </td> </tr> <tr> - <td>{$PALANG.pEdit_mailbox_password}:</td> + <td class="label"><label>{$PALANG.pEdit_mailbox_password}:</label></td> <td><input class="flat" type="password" name="fPassword" /></td> <td>{$pEdit_mailbox_password_text}</td> + <td> </td> </tr> <tr> - <td>{$PALANG.pEdit_mailbox_password2}:</td> + <td class="label"><label>{$PALANG.pEdit_mailbox_password2}:</label></td> <td><input class="flat" type="password" name="fPassword2" /></td> <td> </td> + <td> </td> </tr> <tr> - <td>{$PALANG.pEdit_mailbox_name}:</td> + <td class="label"><label>{$PALANG.pEdit_mailbox_name}:</label></td> <td><input class="flat" type="text" name="fName" value="{$tName}" /></td> <td>{$pEdit_mailbox_name_text}</td> + <td> </td> </tr> {if $CONF.quota===YES} <tr> - <td>{$PALANG.pEdit_mailbox_quota} (max: {$tMaxquota}):</td> + <td class="label"><label>{$PALANG.pEdit_mailbox_quota} (max: {$tMaxquota}):</label></td> <td><input class="flat" type="text" name="fQuota" value="{$tQuota}" /></td> <td>{$pEdit_mailbox_quota_text}</td> + <td>{$pEdit_mailbox_quota_text_error}</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"{$tActive}/></td> - <td> </td> + <td colspan="2"> </td> </tr> - <tr> - <td colspan="3" class="hlp_center"> + <tr> + <td> </td> + <td> <input class="button" type="submit" name="submit" value="{$PALANG.save}" /> <input class="button" type="submit" name="cancel" value="{$PALANG.exit}"/> </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. |