From f2b60b78b6096447a8aadc3d5075bb916f89880a Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 3 Apr 2010 10:26:43 -0700 Subject: Ticket #2272: Block confirmation form should let enter trigger the 'yes' button Setting focus into the form to make it easier to submit by keyboard. Enter or space will now trigger the button right off without having to mouse around to find the button after we've clicked into the conf form, and keyboarders can also get to the 'no' button more easily. --- actions/block.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actions/block.php') diff --git a/actions/block.php b/actions/block.php index 5fae45dff..fe4ec0088 100644 --- a/actions/block.php +++ b/actions/block.php @@ -168,4 +168,11 @@ class BlockAction extends ProfileFormAction return; } } + + function showScripts() + { + parent::showScripts(); + $this->autofocus('form_action-yes'); + } + } -- cgit v1.2.3-54-g00ecf From 3656a2cb13c0b6ba2326d6209739c1cd762ee2d2 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sat, 10 Apr 2010 00:58:57 +0200 Subject: Fix inconsistencies in clientError() messages * use correct punctuation * single quotes when replace was possible * wording updated when needed --- actions/apiaccountupdatedeliverydevice.php | 2 +- actions/apigroupcreate.php | 2 +- actions/apigroupismember.php | 2 +- actions/apigroupjoin.php | 2 +- actions/apigroupleave.php | 2 +- actions/apigroupmembership.php | 2 +- actions/apigroupshow.php | 2 +- actions/apistatusesupdate.php | 2 +- actions/apitimelinegroup.php | 2 +- actions/block.php | 2 +- actions/deleteuser.php | 4 ++-- actions/designadminpanel.php | 4 ++-- actions/disfavor.php | 2 +- actions/favor.php | 2 +- actions/grantrole.php | 8 ++++---- actions/invite.php | 2 +- actions/microsummary.php | 2 +- actions/oauthconnectionssettings.php | 4 ++-- actions/pathsadminpanel.php | 10 +++++----- actions/peopletag.php | 2 +- actions/postnotice.php | 2 +- actions/public.php | 2 +- actions/repeat.php | 10 +++++----- actions/revokerole.php | 6 +++--- actions/sandbox.php | 4 ++-- actions/shownotice.php | 2 +- actions/silence.php | 4 ++-- actions/siteadminpanel.php | 4 ++-- actions/sitenoticeadminpanel.php | 2 +- actions/snapshotadminpanel.php | 6 +++--- actions/unsandbox.php | 4 ++-- actions/unsilence.php | 4 ++-- actions/unsubscribe.php | 2 +- actions/userauthorization.php | 2 +- actions/userrss.php | 2 +- 35 files changed, 58 insertions(+), 58 deletions(-) (limited to 'actions/block.php') diff --git a/actions/apiaccountupdatedeliverydevice.php b/actions/apiaccountupdatedeliverydevice.php index 684906fe9..05d19c22d 100644 --- a/actions/apiaccountupdatedeliverydevice.php +++ b/actions/apiaccountupdatedeliverydevice.php @@ -103,7 +103,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction $this->clientError( _( 'You must specify a parameter named ' . - '\'device\' with a value of one of: sms, im, none' + '\'device\' with a value of one of: sms, im, none.' ) ); return; diff --git a/actions/apigroupcreate.php b/actions/apigroupcreate.php index 145806356..3eb3ae5fc 100644 --- a/actions/apigroupcreate.php +++ b/actions/apigroupcreate.php @@ -263,7 +263,7 @@ class ApiGroupCreateAction extends ApiAuthAction if (!$valid) { $this->clientError( - sprintf(_('Invalid alias: "%s"'), $alias), + sprintf(_('Invalid alias: "%s".'), $alias), 403, $this->format ); diff --git a/actions/apigroupismember.php b/actions/apigroupismember.php index 97f843561..f51c747df 100644 --- a/actions/apigroupismember.php +++ b/actions/apigroupismember.php @@ -92,7 +92,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction } if (empty($this->group)) { - $this->clientError(_('Group not found!'), 404, $this->format); + $this->clientError(_('Group not found.'), 404, $this->format); return false; } diff --git a/actions/apigroupjoin.php b/actions/apigroupjoin.php index 374cf83df..28df72fa9 100644 --- a/actions/apigroupjoin.php +++ b/actions/apigroupjoin.php @@ -101,7 +101,7 @@ class ApiGroupJoinAction extends ApiAuthAction } if (empty($this->group)) { - $this->clientError(_('Group not found!'), 404, $this->format); + $this->clientError(_('Group not found.'), 404, $this->format); return false; } diff --git a/actions/apigroupleave.php b/actions/apigroupleave.php index 9848ece05..f6e52b26e 100644 --- a/actions/apigroupleave.php +++ b/actions/apigroupleave.php @@ -101,7 +101,7 @@ class ApiGroupLeaveAction extends ApiAuthAction } if (empty($this->group)) { - $this->clientError(_('Group not found!'), 404, $this->format); + $this->clientError(_('Group not found.'), 404, $this->format); return false; } diff --git a/actions/apigroupmembership.php b/actions/apigroupmembership.php index 9f72b527c..c97b27fac 100644 --- a/actions/apigroupmembership.php +++ b/actions/apigroupmembership.php @@ -88,7 +88,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction parent::handle($args); if (empty($this->group)) { - $this->clientError(_('Group not found!'), 404, $this->format); + $this->clientError(_('Group not found.'), 404, $this->format); return false; } diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php index 5745a81f4..8e471689a 100644 --- a/actions/apigroupshow.php +++ b/actions/apigroupshow.php @@ -79,7 +79,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction common_redirect(common_local_url('ApiGroupShow', $args), 301); } else { $this->clientError( - _('Group not found!'), + _('Group not found.'), 404, $this->format ); diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index 1956c8586..d4ef6b550 100644 --- a/actions/apistatusesupdate.php +++ b/actions/apistatusesupdate.php @@ -199,7 +199,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction $reply_to = $this->in_reply_to_status_id; } else { $this->clientError( - _('Not found'), + _('Not found.'), $code = 404, $this->format ); diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php index da816c40a..56d1de094 100644 --- a/actions/apitimelinegroup.php +++ b/actions/apitimelinegroup.php @@ -88,7 +88,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction parent::handle($args); if (empty($this->group)) { - $this->clientError(_('Group not found!'), 404, $this->format); + $this->clientError(_('Group not found.'), 404, $this->format); return false; } diff --git a/actions/block.php b/actions/block.php index fe4ec0088..7f609c253 100644 --- a/actions/block.php +++ b/actions/block.php @@ -66,7 +66,7 @@ class BlockAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if ($cur->hasBlocked($this->profile)) { - $this->clientError(_("You already blocked that user.")); + $this->clientError(_('You already blocked that user.')); return false; } diff --git a/actions/deleteuser.php b/actions/deleteuser.php index 4e6b27395..42ef4b9f5 100644 --- a/actions/deleteuser.php +++ b/actions/deleteuser.php @@ -64,14 +64,14 @@ class DeleteuserAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::DELETEUSER)) { - $this->clientError(_("You cannot delete users.")); + $this->clientError(_('You cannot delete users.')); return false; } $this->user = User::staticGet('id', $this->profile->id); if (empty($this->user)) { - $this->clientError(_("You can only delete local users.")); + $this->clientError(_('You can only delete local users.')); return false; } diff --git a/actions/designadminpanel.php b/actions/designadminpanel.php index 30e8bde1a..41d917e3c 100644 --- a/actions/designadminpanel.php +++ b/actions/designadminpanel.php @@ -272,11 +272,11 @@ class DesignadminpanelAction extends AdminPanelAction { if (!empty($values['logo']) && !Validate::uri($values['logo'], array('allowed_schemes' => array('http', 'https')))) { - $this->clientError(_("Invalid logo URL.")); + $this->clientError(_('Invalid logo URL.')); } if (!in_array($values['theme'], Theme::listAvailable())) { - $this->clientError(sprintf(_("Theme not available: %s"), $values['theme'])); + $this->clientError(sprintf(_("Theme not available: %s."), $values['theme'])); } } diff --git a/actions/disfavor.php b/actions/disfavor.php index 6269f1bd2..3ccdd69af 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -71,7 +71,7 @@ class DisfavorAction extends Action $notice = Notice::staticGet($id); $token = $this->trimmed('token-'.$notice->id); if (!$token || $token != common_session_token()) { - $this->clientError(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $fave = new Fave(); diff --git a/actions/favor.php b/actions/favor.php index afca9768a..475912fd0 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -72,7 +72,7 @@ class FavorAction extends Action $notice = Notice::staticGet($id); $token = $this->trimmed('token-'.$notice->id); if (!$token || $token != common_session_token()) { - $this->clientError(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } if ($user->hasFave($notice)) { diff --git a/actions/grantrole.php b/actions/grantrole.php index cd6bd4d79..b8b23d02e 100644 --- a/actions/grantrole.php +++ b/actions/grantrole.php @@ -59,11 +59,11 @@ class GrantRoleAction extends ProfileFormAction $this->role = $this->arg('role'); if (!Profile_role::isValid($this->role)) { - $this->clientError(_("Invalid role.")); + $this->clientError(_('Invalid role.')); return false; } if (!Profile_role::isSettable($this->role)) { - $this->clientError(_("This role is reserved and cannot be set.")); + $this->clientError(_('This role is reserved and cannot be set.')); return false; } @@ -72,14 +72,14 @@ class GrantRoleAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::GRANTROLE)) { - $this->clientError(_("You cannot grant user roles on this site.")); + $this->clientError(_('You cannot grant user roles on this site.')); return false; } assert(!empty($this->profile)); // checked by parent if ($this->profile->hasRole($this->role)) { - $this->clientError(_("User already has this role.")); + $this->clientError(_('User already has this role.')); return false; } diff --git a/actions/invite.php b/actions/invite.php index f17c910b6..4bba8893d 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -38,7 +38,7 @@ class InviteAction extends CurrentUserDesignAction if (!common_config('invite', 'enabled')) { $this->clientError(_('Invites have been disabled.')); } else if (!common_logged_in()) { - $this->clientError(sprintf(_('You must be logged in to invite other users to use %s'), + $this->clientError(sprintf(_('You must be logged in to invite other users to use %s.'), common_config('site', 'name'))); return; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { diff --git a/actions/microsummary.php b/actions/microsummary.php index 5c761e8bb..d145dc3bc 100644 --- a/actions/microsummary.php +++ b/actions/microsummary.php @@ -66,7 +66,7 @@ class MicrosummaryAction extends Action $notice = $user->getCurrentNotice(); if (!$notice) { - $this->clientError(_('No current status'), 404); + $this->clientError(_('No current status.'), 404); } header('Content-Type: text/plain'); diff --git a/actions/oauthconnectionssettings.php b/actions/oauthconnectionssettings.php index f125f4c63..8a206d710 100644 --- a/actions/oauthconnectionssettings.php +++ b/actions/oauthconnectionssettings.php @@ -183,7 +183,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction if (!$result) { common_log_db_error($orig, 'DELETE', __FILE__); - $this->clientError(_('Unable to revoke access for app: ' . $app->id)); + $this->clientError(sprintf(_('Unable to revoke access for app: %s.'), $app->id)); return false; } @@ -195,7 +195,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction function showEmptyListMessage() { - $message = sprintf(_('You have not authorized any applications to use your account.')); + $message = _('You have not authorized any applications to use your account.'); $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); diff --git a/actions/pathsadminpanel.php b/actions/pathsadminpanel.php index 9155a7e42..7ff3c2583 100644 --- a/actions/pathsadminpanel.php +++ b/actions/pathsadminpanel.php @@ -154,19 +154,19 @@ class PathsadminpanelAction extends AdminPanelAction // Validate theme dir if (!empty($values['theme']['dir']) && !is_readable($values['theme']['dir'])) { - $this->clientError(sprintf(_("Theme directory not readable: %s"), $values['theme']['dir'])); + $this->clientError(sprintf(_("Theme directory not readable: %s."), $values['theme']['dir'])); } // Validate avatar dir if (empty($values['avatar']['dir']) || !is_writable($values['avatar']['dir'])) { - $this->clientError(sprintf(_("Avatar directory not writable: %s"), $values['avatar']['dir'])); + $this->clientError(sprintf(_("Avatar directory not writable: %s."), $values['avatar']['dir'])); } // Validate background dir if (empty($values['background']['dir']) || !is_writable($values['background']['dir'])) { - $this->clientError(sprintf(_("Background directory not writable: %s"), $values['background']['dir'])); + $this->clientError(sprintf(_("Background directory not writable: %s."), $values['background']['dir'])); } // Validate locales dir @@ -174,13 +174,13 @@ class PathsadminpanelAction extends AdminPanelAction // XXX: What else do we need to validate for lacales path here? --Z if (!empty($values['site']['locale_path']) && !is_readable($values['site']['locale_path'])) { - $this->clientError(sprintf(_("Locales directory not readable: %s"), $values['site']['locale_path'])); + $this->clientError(sprintf(_("Locales directory not readable: %s."), $values['site']['locale_path'])); } // Validate SSL setup if (mb_strlen($values['site']['sslserver']) > 255) { - $this->clientError(_("Invalid SSL server. The maximum length is 255 characters.")); + $this->clientError(_('Invalid SSL server. The maximum length is 255 characters.')); } } diff --git a/actions/peopletag.php b/actions/peopletag.php index 456cc21c4..5473bc1bd 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -65,7 +65,7 @@ class PeopletagAction extends Action $this->tag = $this->trimmed('tag'); if (!common_valid_profile_tag($this->tag)) { - $this->clientError(sprintf(_('Not a valid people tag: %s'), + $this->clientError(sprintf(_('Not a valid people tag: %s.'), $this->tag)); return; } diff --git a/actions/postnotice.php b/actions/postnotice.php index b2f6f1bb9..694c7808d 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -92,7 +92,7 @@ class PostnoticeAction extends Action { $content = common_shorten_links($_POST['omb_notice_content']); if (Notice::contentTooLong($content)) { - $this->clientError(_('Invalid notice content'), 400); + $this->clientError(_('Invalid notice content.'), 400); return false; } $license = $_POST['omb_notice_license']; diff --git a/actions/public.php b/actions/public.php index 8e9db10ca..5fc547fea 100644 --- a/actions/public.php +++ b/actions/public.php @@ -80,7 +80,7 @@ class PublicAction extends Action $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; if ($this->page > MAX_PUBLIC_PAGE) { - $this->clientError(sprintf(_("Beyond the page limit (%s)"), MAX_PUBLIC_PAGE)); + $this->clientError(sprintf(_("Beyond the page limit (%s)."), MAX_PUBLIC_PAGE)); } common_set_returnto($this->selfUrl()); diff --git a/actions/repeat.php b/actions/repeat.php index e112496bc..893cae4ff 100644 --- a/actions/repeat.php +++ b/actions/repeat.php @@ -54,21 +54,21 @@ class RepeatAction extends Action $this->user = common_current_user(); if (empty($this->user)) { - $this->clientError(_("Only logged-in users can repeat notices.")); + $this->clientError(_('Only logged-in users can repeat notices.')); return false; } $id = $this->trimmed('notice'); if (empty($id)) { - $this->clientError(_("No notice specified.")); + $this->clientError(_('No notice specified.')); return false; } $this->notice = Notice::staticGet('id', $id); if (empty($this->notice)) { - $this->clientError(_("No notice specified.")); + $this->clientError(_('No notice specified.')); return false; } @@ -80,14 +80,14 @@ class RepeatAction extends Action $token = $this->trimmed('token-'.$id); if (empty($token) || $token != common_session_token()) { - $this->clientError(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return false; } $profile = $this->user->getProfile(); if ($profile->hasRepeated($id)) { - $this->clientError(_("You already repeated that notice.")); + $this->clientError(_('You already repeated that notice.')); return false; } diff --git a/actions/revokerole.php b/actions/revokerole.php index b78c1c25a..c67b70fda 100644 --- a/actions/revokerole.php +++ b/actions/revokerole.php @@ -59,11 +59,11 @@ class RevokeRoleAction extends ProfileFormAction $this->role = $this->arg('role'); if (!Profile_role::isValid($this->role)) { - $this->clientError(_("Invalid role.")); + $this->clientError(_('Invalid role.')); return false; } if (!Profile_role::isSettable($this->role)) { - $this->clientError(_("This role is reserved and cannot be set.")); + $this->clientError(_('This role is reserved and cannot be set.')); return false; } @@ -72,7 +72,7 @@ class RevokeRoleAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::REVOKEROLE)) { - $this->clientError(_("You cannot revoke user roles on this site.")); + $this->clientError(_('You cannot revoke user roles on this site.')); return false; } diff --git a/actions/sandbox.php b/actions/sandbox.php index 5b034ff07..d1ef4c86b 100644 --- a/actions/sandbox.php +++ b/actions/sandbox.php @@ -62,14 +62,14 @@ class SandboxAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::SANDBOXUSER)) { - $this->clientError(_("You cannot sandbox users on this site.")); + $this->clientError(_('You cannot sandbox users on this site.')); return false; } assert(!empty($this->profile)); // checked by parent if ($this->profile->isSandboxed()) { - $this->clientError(_("User is already sandboxed.")); + $this->clientError(_('User is already sandboxed.')); return false; } diff --git a/actions/shownotice.php b/actions/shownotice.php index ca6b60d1f..9c5d83441 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -97,7 +97,7 @@ class ShownoticeAction extends OwnerDesignAction $this->profile = $this->notice->getProfile(); if (empty($this->profile)) { - $this->serverError(_('Notice has no profile'), 500); + $this->serverError(_('Notice has no profile.'), 500); return false; } diff --git a/actions/silence.php b/actions/silence.php index 206e5ba87..09cc480d9 100644 --- a/actions/silence.php +++ b/actions/silence.php @@ -62,14 +62,14 @@ class SilenceAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::SILENCEUSER)) { - $this->clientError(_("You cannot silence users on this site.")); + $this->clientError(_('You cannot silence users on this site.')); return false; } assert(!empty($this->profile)); // checked by parent if ($this->profile->isSilenced()) { - $this->clientError(_("User is already silenced.")); + $this->clientError(_('User is already silenced.')); return false; } diff --git a/actions/siteadminpanel.php b/actions/siteadminpanel.php index e5482987f..4238b3e85 100644 --- a/actions/siteadminpanel.php +++ b/actions/siteadminpanel.php @@ -130,7 +130,7 @@ class SiteadminpanelAction extends AdminPanelAction // Validate site name if (empty($values['site']['name'])) { - $this->clientError(_("Site name must have non-zero length.")); + $this->clientError(_('Site name must have non-zero length.')); } // Validate email @@ -168,7 +168,7 @@ class SiteadminpanelAction extends AdminPanelAction // Validate dupe limit if (!Validate::number($values['site']['dupelimit'], array('min' => 1))) { - $this->clientError(_("Dupe limit must 1 or more seconds.")); + $this->clientError(_("Dupe limit must be one or more seconds.")); } } diff --git a/actions/sitenoticeadminpanel.php b/actions/sitenoticeadminpanel.php index a68cc699c..bdcaa2355 100644 --- a/actions/sitenoticeadminpanel.php +++ b/actions/sitenoticeadminpanel.php @@ -110,7 +110,7 @@ class SitenoticeadminpanelAction extends AdminPanelAction if (mb_strlen($siteNotice) > 255) { $this->clientError( - _('Max length for the site-wide notice is 255 chars') + _('Max length for the site-wide notice is 255 chars.') ); } diff --git a/actions/snapshotadminpanel.php b/actions/snapshotadminpanel.php index a0c2315bc..df6b168dc 100644 --- a/actions/snapshotadminpanel.php +++ b/actions/snapshotadminpanel.php @@ -124,13 +124,13 @@ class SnapshotadminpanelAction extends AdminPanelAction // Validate snapshot run value if (!in_array($values['snapshot']['run'], array('web', 'cron', 'never'))) { - $this->clientError(_("Invalid snapshot run value.")); + $this->clientError(_('Invalid snapshot run value.')); } // Validate snapshot frequency value if (!Validate::number($values['snapshot']['frequency'])) { - $this->clientError(_("Snapshot frequency must be a number.")); + $this->clientError(_('Snapshot frequency must be a number.')); } // Validate report URL @@ -141,7 +141,7 @@ class SnapshotadminpanelAction extends AdminPanelAction array('allowed_schemes' => array('http', 'https') ) )) { - $this->clientError(_("Invalid snapshot report URL.")); + $this->clientError(_('Invalid snapshot report URL.')); } } } diff --git a/actions/unsandbox.php b/actions/unsandbox.php index 22f4d8e76..d50b5072e 100644 --- a/actions/unsandbox.php +++ b/actions/unsandbox.php @@ -62,14 +62,14 @@ class UnsandboxAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::SANDBOXUSER)) { - $this->clientError(_("You cannot sandbox users on this site.")); + $this->clientError(_('You cannot sandbox users on this site.')); return false; } assert(!empty($this->profile)); // checked by parent if (!$this->profile->isSandboxed()) { - $this->clientError(_("User is not sandboxed.")); + $this->clientError(_('User is not sandboxed.')); return false; } diff --git a/actions/unsilence.php b/actions/unsilence.php index 9ff1b828b..7d282c366 100644 --- a/actions/unsilence.php +++ b/actions/unsilence.php @@ -62,14 +62,14 @@ class UnsilenceAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::SILENCEUSER)) { - $this->clientError(_("You cannot silence users on this site.")); + $this->clientError(_('You cannot silence users on this site.')); return false; } assert(!empty($this->profile)); // checked by parent if (!$this->profile->isSilenced()) { - $this->clientError(_("User is not silenced.")); + $this->clientError(_('User is not silenced.')); return false; } diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 6bb10d448..57ca15d68 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -74,7 +74,7 @@ class UnsubscribeAction extends Action $other_id = $this->arg('unsubscribeto'); if (!$other_id) { - $this->clientError(_('No profile id in request.')); + $this->clientError(_('No profile ID in request.')); return; } diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 7f71c60db..e896ff96c 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -69,7 +69,7 @@ class UserauthorizationAction extends Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->serverError(_('User without matching profile')); + $this->serverError(_('User without matching profile.')); return; } diff --git a/actions/userrss.php b/actions/userrss.php index e03eb9356..cf7d18ca8 100644 --- a/actions/userrss.php +++ b/actions/userrss.php @@ -103,7 +103,7 @@ class UserrssAction extends Rss10Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->serverError(_('User without matching profile')); + $this->serverError(_('User without matching profile.')); return null; } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); -- cgit v1.2.3-54-g00ecf From 166c1edba97d065d0fd424621305fd016e644c43 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sat, 10 Apr 2010 00:58:57 +0200 Subject: Fix inconsistencies in clientError() messages * use correct punctuation * single quotes when replace was possible * wording updated when needed --- actions/apiaccountupdatedeliverydevice.php | 2 +- actions/apigroupcreate.php | 2 +- actions/apigroupismember.php | 2 +- actions/apigroupjoin.php | 2 +- actions/apigroupleave.php | 2 +- actions/apigroupmembership.php | 2 +- actions/apigroupshow.php | 2 +- actions/apistatusesupdate.php | 2 +- actions/apitimelinegroup.php | 2 +- actions/block.php | 2 +- actions/deleteuser.php | 4 ++-- actions/designadminpanel.php | 4 ++-- actions/disfavor.php | 2 +- actions/favor.php | 2 +- actions/grantrole.php | 8 ++++---- actions/invite.php | 2 +- actions/microsummary.php | 2 +- actions/oauthconnectionssettings.php | 4 ++-- actions/pathsadminpanel.php | 10 +++++----- actions/peopletag.php | 2 +- actions/postnotice.php | 2 +- actions/public.php | 2 +- actions/repeat.php | 10 +++++----- actions/revokerole.php | 6 +++--- actions/sandbox.php | 4 ++-- actions/shownotice.php | 2 +- actions/silence.php | 4 ++-- actions/siteadminpanel.php | 4 ++-- actions/sitenoticeadminpanel.php | 2 +- actions/snapshotadminpanel.php | 6 +++--- actions/unsandbox.php | 4 ++-- actions/unsilence.php | 4 ++-- actions/unsubscribe.php | 2 +- actions/userauthorization.php | 2 +- actions/userrss.php | 2 +- 35 files changed, 58 insertions(+), 58 deletions(-) (limited to 'actions/block.php') diff --git a/actions/apiaccountupdatedeliverydevice.php b/actions/apiaccountupdatedeliverydevice.php index 684906fe9..05d19c22d 100644 --- a/actions/apiaccountupdatedeliverydevice.php +++ b/actions/apiaccountupdatedeliverydevice.php @@ -103,7 +103,7 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction $this->clientError( _( 'You must specify a parameter named ' . - '\'device\' with a value of one of: sms, im, none' + '\'device\' with a value of one of: sms, im, none.' ) ); return; diff --git a/actions/apigroupcreate.php b/actions/apigroupcreate.php index 145806356..3eb3ae5fc 100644 --- a/actions/apigroupcreate.php +++ b/actions/apigroupcreate.php @@ -263,7 +263,7 @@ class ApiGroupCreateAction extends ApiAuthAction if (!$valid) { $this->clientError( - sprintf(_('Invalid alias: "%s"'), $alias), + sprintf(_('Invalid alias: "%s".'), $alias), 403, $this->format ); diff --git a/actions/apigroupismember.php b/actions/apigroupismember.php index 97f843561..f51c747df 100644 --- a/actions/apigroupismember.php +++ b/actions/apigroupismember.php @@ -92,7 +92,7 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction } if (empty($this->group)) { - $this->clientError(_('Group not found!'), 404, $this->format); + $this->clientError(_('Group not found.'), 404, $this->format); return false; } diff --git a/actions/apigroupjoin.php b/actions/apigroupjoin.php index 374cf83df..28df72fa9 100644 --- a/actions/apigroupjoin.php +++ b/actions/apigroupjoin.php @@ -101,7 +101,7 @@ class ApiGroupJoinAction extends ApiAuthAction } if (empty($this->group)) { - $this->clientError(_('Group not found!'), 404, $this->format); + $this->clientError(_('Group not found.'), 404, $this->format); return false; } diff --git a/actions/apigroupleave.php b/actions/apigroupleave.php index 9848ece05..f6e52b26e 100644 --- a/actions/apigroupleave.php +++ b/actions/apigroupleave.php @@ -101,7 +101,7 @@ class ApiGroupLeaveAction extends ApiAuthAction } if (empty($this->group)) { - $this->clientError(_('Group not found!'), 404, $this->format); + $this->clientError(_('Group not found.'), 404, $this->format); return false; } diff --git a/actions/apigroupmembership.php b/actions/apigroupmembership.php index 9f72b527c..c97b27fac 100644 --- a/actions/apigroupmembership.php +++ b/actions/apigroupmembership.php @@ -88,7 +88,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction parent::handle($args); if (empty($this->group)) { - $this->clientError(_('Group not found!'), 404, $this->format); + $this->clientError(_('Group not found.'), 404, $this->format); return false; } diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php index 5745a81f4..8e471689a 100644 --- a/actions/apigroupshow.php +++ b/actions/apigroupshow.php @@ -79,7 +79,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction common_redirect(common_local_url('ApiGroupShow', $args), 301); } else { $this->clientError( - _('Group not found!'), + _('Group not found.'), 404, $this->format ); diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index 1956c8586..d4ef6b550 100644 --- a/actions/apistatusesupdate.php +++ b/actions/apistatusesupdate.php @@ -199,7 +199,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction $reply_to = $this->in_reply_to_status_id; } else { $this->clientError( - _('Not found'), + _('Not found.'), $code = 404, $this->format ); diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php index da816c40a..56d1de094 100644 --- a/actions/apitimelinegroup.php +++ b/actions/apitimelinegroup.php @@ -88,7 +88,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction parent::handle($args); if (empty($this->group)) { - $this->clientError(_('Group not found!'), 404, $this->format); + $this->clientError(_('Group not found.'), 404, $this->format); return false; } diff --git a/actions/block.php b/actions/block.php index fe4ec0088..7f609c253 100644 --- a/actions/block.php +++ b/actions/block.php @@ -66,7 +66,7 @@ class BlockAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if ($cur->hasBlocked($this->profile)) { - $this->clientError(_("You already blocked that user.")); + $this->clientError(_('You already blocked that user.')); return false; } diff --git a/actions/deleteuser.php b/actions/deleteuser.php index 4e6b27395..42ef4b9f5 100644 --- a/actions/deleteuser.php +++ b/actions/deleteuser.php @@ -64,14 +64,14 @@ class DeleteuserAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::DELETEUSER)) { - $this->clientError(_("You cannot delete users.")); + $this->clientError(_('You cannot delete users.')); return false; } $this->user = User::staticGet('id', $this->profile->id); if (empty($this->user)) { - $this->clientError(_("You can only delete local users.")); + $this->clientError(_('You can only delete local users.')); return false; } diff --git a/actions/designadminpanel.php b/actions/designadminpanel.php index 30e8bde1a..41d917e3c 100644 --- a/actions/designadminpanel.php +++ b/actions/designadminpanel.php @@ -272,11 +272,11 @@ class DesignadminpanelAction extends AdminPanelAction { if (!empty($values['logo']) && !Validate::uri($values['logo'], array('allowed_schemes' => array('http', 'https')))) { - $this->clientError(_("Invalid logo URL.")); + $this->clientError(_('Invalid logo URL.')); } if (!in_array($values['theme'], Theme::listAvailable())) { - $this->clientError(sprintf(_("Theme not available: %s"), $values['theme'])); + $this->clientError(sprintf(_("Theme not available: %s."), $values['theme'])); } } diff --git a/actions/disfavor.php b/actions/disfavor.php index 6269f1bd2..3ccdd69af 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -71,7 +71,7 @@ class DisfavorAction extends Action $notice = Notice::staticGet($id); $token = $this->trimmed('token-'.$notice->id); if (!$token || $token != common_session_token()) { - $this->clientError(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $fave = new Fave(); diff --git a/actions/favor.php b/actions/favor.php index afca9768a..475912fd0 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -72,7 +72,7 @@ class FavorAction extends Action $notice = Notice::staticGet($id); $token = $this->trimmed('token-'.$notice->id); if (!$token || $token != common_session_token()) { - $this->clientError(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } if ($user->hasFave($notice)) { diff --git a/actions/grantrole.php b/actions/grantrole.php index cd6bd4d79..b8b23d02e 100644 --- a/actions/grantrole.php +++ b/actions/grantrole.php @@ -59,11 +59,11 @@ class GrantRoleAction extends ProfileFormAction $this->role = $this->arg('role'); if (!Profile_role::isValid($this->role)) { - $this->clientError(_("Invalid role.")); + $this->clientError(_('Invalid role.')); return false; } if (!Profile_role::isSettable($this->role)) { - $this->clientError(_("This role is reserved and cannot be set.")); + $this->clientError(_('This role is reserved and cannot be set.')); return false; } @@ -72,14 +72,14 @@ class GrantRoleAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::GRANTROLE)) { - $this->clientError(_("You cannot grant user roles on this site.")); + $this->clientError(_('You cannot grant user roles on this site.')); return false; } assert(!empty($this->profile)); // checked by parent if ($this->profile->hasRole($this->role)) { - $this->clientError(_("User already has this role.")); + $this->clientError(_('User already has this role.')); return false; } diff --git a/actions/invite.php b/actions/invite.php index 54b2de62a..5dac048b0 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -38,7 +38,7 @@ class InviteAction extends CurrentUserDesignAction if (!common_config('invite', 'enabled')) { $this->clientError(_('Invites have been disabled.')); } else if (!common_logged_in()) { - $this->clientError(sprintf(_('You must be logged in to invite other users to use %s'), + $this->clientError(sprintf(_('You must be logged in to invite other users to use %s.'), common_config('site', 'name'))); return; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { diff --git a/actions/microsummary.php b/actions/microsummary.php index 5c761e8bb..d145dc3bc 100644 --- a/actions/microsummary.php +++ b/actions/microsummary.php @@ -66,7 +66,7 @@ class MicrosummaryAction extends Action $notice = $user->getCurrentNotice(); if (!$notice) { - $this->clientError(_('No current status'), 404); + $this->clientError(_('No current status.'), 404); } header('Content-Type: text/plain'); diff --git a/actions/oauthconnectionssettings.php b/actions/oauthconnectionssettings.php index f125f4c63..8a206d710 100644 --- a/actions/oauthconnectionssettings.php +++ b/actions/oauthconnectionssettings.php @@ -183,7 +183,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction if (!$result) { common_log_db_error($orig, 'DELETE', __FILE__); - $this->clientError(_('Unable to revoke access for app: ' . $app->id)); + $this->clientError(sprintf(_('Unable to revoke access for app: %s.'), $app->id)); return false; } @@ -195,7 +195,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction function showEmptyListMessage() { - $message = sprintf(_('You have not authorized any applications to use your account.')); + $message = _('You have not authorized any applications to use your account.'); $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); diff --git a/actions/pathsadminpanel.php b/actions/pathsadminpanel.php index 9155a7e42..7ff3c2583 100644 --- a/actions/pathsadminpanel.php +++ b/actions/pathsadminpanel.php @@ -154,19 +154,19 @@ class PathsadminpanelAction extends AdminPanelAction // Validate theme dir if (!empty($values['theme']['dir']) && !is_readable($values['theme']['dir'])) { - $this->clientError(sprintf(_("Theme directory not readable: %s"), $values['theme']['dir'])); + $this->clientError(sprintf(_("Theme directory not readable: %s."), $values['theme']['dir'])); } // Validate avatar dir if (empty($values['avatar']['dir']) || !is_writable($values['avatar']['dir'])) { - $this->clientError(sprintf(_("Avatar directory not writable: %s"), $values['avatar']['dir'])); + $this->clientError(sprintf(_("Avatar directory not writable: %s."), $values['avatar']['dir'])); } // Validate background dir if (empty($values['background']['dir']) || !is_writable($values['background']['dir'])) { - $this->clientError(sprintf(_("Background directory not writable: %s"), $values['background']['dir'])); + $this->clientError(sprintf(_("Background directory not writable: %s."), $values['background']['dir'])); } // Validate locales dir @@ -174,13 +174,13 @@ class PathsadminpanelAction extends AdminPanelAction // XXX: What else do we need to validate for lacales path here? --Z if (!empty($values['site']['locale_path']) && !is_readable($values['site']['locale_path'])) { - $this->clientError(sprintf(_("Locales directory not readable: %s"), $values['site']['locale_path'])); + $this->clientError(sprintf(_("Locales directory not readable: %s."), $values['site']['locale_path'])); } // Validate SSL setup if (mb_strlen($values['site']['sslserver']) > 255) { - $this->clientError(_("Invalid SSL server. The maximum length is 255 characters.")); + $this->clientError(_('Invalid SSL server. The maximum length is 255 characters.')); } } diff --git a/actions/peopletag.php b/actions/peopletag.php index 32652f755..7287cfbf9 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -65,7 +65,7 @@ class PeopletagAction extends Action $this->tag = $this->trimmed('tag'); if (!common_valid_profile_tag($this->tag)) { - $this->clientError(sprintf(_('Not a valid people tag: %s'), + $this->clientError(sprintf(_('Not a valid people tag: %s.'), $this->tag)); return; } diff --git a/actions/postnotice.php b/actions/postnotice.php index b2f6f1bb9..694c7808d 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -92,7 +92,7 @@ class PostnoticeAction extends Action { $content = common_shorten_links($_POST['omb_notice_content']); if (Notice::contentTooLong($content)) { - $this->clientError(_('Invalid notice content'), 400); + $this->clientError(_('Invalid notice content.'), 400); return false; } $license = $_POST['omb_notice_license']; diff --git a/actions/public.php b/actions/public.php index 8e9db10ca..5fc547fea 100644 --- a/actions/public.php +++ b/actions/public.php @@ -80,7 +80,7 @@ class PublicAction extends Action $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; if ($this->page > MAX_PUBLIC_PAGE) { - $this->clientError(sprintf(_("Beyond the page limit (%s)"), MAX_PUBLIC_PAGE)); + $this->clientError(sprintf(_("Beyond the page limit (%s)."), MAX_PUBLIC_PAGE)); } common_set_returnto($this->selfUrl()); diff --git a/actions/repeat.php b/actions/repeat.php index e112496bc..893cae4ff 100644 --- a/actions/repeat.php +++ b/actions/repeat.php @@ -54,21 +54,21 @@ class RepeatAction extends Action $this->user = common_current_user(); if (empty($this->user)) { - $this->clientError(_("Only logged-in users can repeat notices.")); + $this->clientError(_('Only logged-in users can repeat notices.')); return false; } $id = $this->trimmed('notice'); if (empty($id)) { - $this->clientError(_("No notice specified.")); + $this->clientError(_('No notice specified.')); return false; } $this->notice = Notice::staticGet('id', $id); if (empty($this->notice)) { - $this->clientError(_("No notice specified.")); + $this->clientError(_('No notice specified.')); return false; } @@ -80,14 +80,14 @@ class RepeatAction extends Action $token = $this->trimmed('token-'.$id); if (empty($token) || $token != common_session_token()) { - $this->clientError(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return false; } $profile = $this->user->getProfile(); if ($profile->hasRepeated($id)) { - $this->clientError(_("You already repeated that notice.")); + $this->clientError(_('You already repeated that notice.')); return false; } diff --git a/actions/revokerole.php b/actions/revokerole.php index b78c1c25a..c67b70fda 100644 --- a/actions/revokerole.php +++ b/actions/revokerole.php @@ -59,11 +59,11 @@ class RevokeRoleAction extends ProfileFormAction $this->role = $this->arg('role'); if (!Profile_role::isValid($this->role)) { - $this->clientError(_("Invalid role.")); + $this->clientError(_('Invalid role.')); return false; } if (!Profile_role::isSettable($this->role)) { - $this->clientError(_("This role is reserved and cannot be set.")); + $this->clientError(_('This role is reserved and cannot be set.')); return false; } @@ -72,7 +72,7 @@ class RevokeRoleAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::REVOKEROLE)) { - $this->clientError(_("You cannot revoke user roles on this site.")); + $this->clientError(_('You cannot revoke user roles on this site.')); return false; } diff --git a/actions/sandbox.php b/actions/sandbox.php index 5b034ff07..d1ef4c86b 100644 --- a/actions/sandbox.php +++ b/actions/sandbox.php @@ -62,14 +62,14 @@ class SandboxAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::SANDBOXUSER)) { - $this->clientError(_("You cannot sandbox users on this site.")); + $this->clientError(_('You cannot sandbox users on this site.')); return false; } assert(!empty($this->profile)); // checked by parent if ($this->profile->isSandboxed()) { - $this->clientError(_("User is already sandboxed.")); + $this->clientError(_('User is already sandboxed.')); return false; } diff --git a/actions/shownotice.php b/actions/shownotice.php index a23027f7c..7be9618f8 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -97,7 +97,7 @@ class ShownoticeAction extends OwnerDesignAction $this->profile = $this->notice->getProfile(); if (empty($this->profile)) { - $this->serverError(_('Notice has no profile'), 500); + $this->serverError(_('Notice has no profile.'), 500); return false; } diff --git a/actions/silence.php b/actions/silence.php index 206e5ba87..09cc480d9 100644 --- a/actions/silence.php +++ b/actions/silence.php @@ -62,14 +62,14 @@ class SilenceAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::SILENCEUSER)) { - $this->clientError(_("You cannot silence users on this site.")); + $this->clientError(_('You cannot silence users on this site.')); return false; } assert(!empty($this->profile)); // checked by parent if ($this->profile->isSilenced()) { - $this->clientError(_("User is already silenced.")); + $this->clientError(_('User is already silenced.')); return false; } diff --git a/actions/siteadminpanel.php b/actions/siteadminpanel.php index e5482987f..4238b3e85 100644 --- a/actions/siteadminpanel.php +++ b/actions/siteadminpanel.php @@ -130,7 +130,7 @@ class SiteadminpanelAction extends AdminPanelAction // Validate site name if (empty($values['site']['name'])) { - $this->clientError(_("Site name must have non-zero length.")); + $this->clientError(_('Site name must have non-zero length.')); } // Validate email @@ -168,7 +168,7 @@ class SiteadminpanelAction extends AdminPanelAction // Validate dupe limit if (!Validate::number($values['site']['dupelimit'], array('min' => 1))) { - $this->clientError(_("Dupe limit must 1 or more seconds.")); + $this->clientError(_("Dupe limit must be one or more seconds.")); } } diff --git a/actions/sitenoticeadminpanel.php b/actions/sitenoticeadminpanel.php index a68cc699c..bdcaa2355 100644 --- a/actions/sitenoticeadminpanel.php +++ b/actions/sitenoticeadminpanel.php @@ -110,7 +110,7 @@ class SitenoticeadminpanelAction extends AdminPanelAction if (mb_strlen($siteNotice) > 255) { $this->clientError( - _('Max length for the site-wide notice is 255 chars') + _('Max length for the site-wide notice is 255 chars.') ); } diff --git a/actions/snapshotadminpanel.php b/actions/snapshotadminpanel.php index a0c2315bc..df6b168dc 100644 --- a/actions/snapshotadminpanel.php +++ b/actions/snapshotadminpanel.php @@ -124,13 +124,13 @@ class SnapshotadminpanelAction extends AdminPanelAction // Validate snapshot run value if (!in_array($values['snapshot']['run'], array('web', 'cron', 'never'))) { - $this->clientError(_("Invalid snapshot run value.")); + $this->clientError(_('Invalid snapshot run value.')); } // Validate snapshot frequency value if (!Validate::number($values['snapshot']['frequency'])) { - $this->clientError(_("Snapshot frequency must be a number.")); + $this->clientError(_('Snapshot frequency must be a number.')); } // Validate report URL @@ -141,7 +141,7 @@ class SnapshotadminpanelAction extends AdminPanelAction array('allowed_schemes' => array('http', 'https') ) )) { - $this->clientError(_("Invalid snapshot report URL.")); + $this->clientError(_('Invalid snapshot report URL.')); } } } diff --git a/actions/unsandbox.php b/actions/unsandbox.php index 22f4d8e76..d50b5072e 100644 --- a/actions/unsandbox.php +++ b/actions/unsandbox.php @@ -62,14 +62,14 @@ class UnsandboxAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::SANDBOXUSER)) { - $this->clientError(_("You cannot sandbox users on this site.")); + $this->clientError(_('You cannot sandbox users on this site.')); return false; } assert(!empty($this->profile)); // checked by parent if (!$this->profile->isSandboxed()) { - $this->clientError(_("User is not sandboxed.")); + $this->clientError(_('User is not sandboxed.')); return false; } diff --git a/actions/unsilence.php b/actions/unsilence.php index 9ff1b828b..7d282c366 100644 --- a/actions/unsilence.php +++ b/actions/unsilence.php @@ -62,14 +62,14 @@ class UnsilenceAction extends ProfileFormAction assert(!empty($cur)); // checked by parent if (!$cur->hasRight(Right::SILENCEUSER)) { - $this->clientError(_("You cannot silence users on this site.")); + $this->clientError(_('You cannot silence users on this site.')); return false; } assert(!empty($this->profile)); // checked by parent if (!$this->profile->isSilenced()) { - $this->clientError(_("User is not silenced.")); + $this->clientError(_('User is not silenced.')); return false; } diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 6bb10d448..57ca15d68 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -74,7 +74,7 @@ class UnsubscribeAction extends Action $other_id = $this->arg('unsubscribeto'); if (!$other_id) { - $this->clientError(_('No profile id in request.')); + $this->clientError(_('No profile ID in request.')); return; } diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 7f71c60db..e896ff96c 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -69,7 +69,7 @@ class UserauthorizationAction extends Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->serverError(_('User without matching profile')); + $this->serverError(_('User without matching profile.')); return; } diff --git a/actions/userrss.php b/actions/userrss.php index e03eb9356..cf7d18ca8 100644 --- a/actions/userrss.php +++ b/actions/userrss.php @@ -103,7 +103,7 @@ class UserrssAction extends Rss10Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->serverError(_('User without matching profile')); + $this->serverError(_('User without matching profile.')); return null; } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); -- cgit v1.2.3-54-g00ecf From 69eebc1ec83ae81ddd1c172a3948ec47661cd364 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 11 Apr 2010 21:04:07 +0200 Subject: Add translator documentation for uses of 'Yes' and 'No' in the interface. --- actions/block.php | 16 ++++++++++++++-- actions/deleteapplication.php | 10 +++++++--- actions/deletenotice.php | 16 ++++++++++++++-- actions/deleteuser.php | 16 ++++++++++++++-- actions/groupblock.php | 16 ++++++++++++++-- 5 files changed, 63 insertions(+), 11 deletions(-) (limited to 'actions/block.php') diff --git a/actions/block.php b/actions/block.php index 7f609c253..11565e20c 100644 --- a/actions/block.php +++ b/actions/block.php @@ -140,8 +140,20 @@ class BlockAction extends ProfileFormAction $this->hidden($k, $v); } } - $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user")); - $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user')); + $this->submit('form_action-no', + // TRANS: Button label on the user block form. + _m('BUTTON','No'), + 'submit form_action-primary', + 'no', + // TRANS: Submit button title for 'No' when blocking a user. + _('Do not block this user')); + $this->submit('form_action-yes', + // TRANS: Button label on the user block form. + _m('BUTTON','Yes'), + 'submit form_action-secondary', + 'yes', + // TRANS: Submit button title for 'Yes' when blocking a user. + _('Block this user')); $this->elementEnd('fieldset'); $this->elementEnd('form'); } diff --git a/actions/deleteapplication.php b/actions/deleteapplication.php index 17526e111..806de0be6 100644 --- a/actions/deleteapplication.php +++ b/actions/deleteapplication.php @@ -150,13 +150,17 @@ class DeleteapplicationAction extends Action 'This will clear all data about the application from the '. 'database, including all existing user connections.')); $this->submit('form_action-no', - _('No'), + // TRANS: Button label on the delete application form. + _m('BUTTON','No'), 'submit form_action-primary', 'no', - _("Do not delete this application")); + // TRANS: Submit button title for 'No' when deleting an application. + _('Do not delete this application')); $this->submit('form_action-yes', - _('Yes'), + // TRANS: Button label on the delete application form. + _m('BUTTON','Yes'), 'submit form_action-secondary', + // TRANS: Submit button title for 'Yes' when deleting an application. 'yes', _('Delete this application')); $this->elementEnd('fieldset'); $this->elementEnd('form'); diff --git a/actions/deletenotice.php b/actions/deletenotice.php index 69cb1ebe8..f8010a814 100644 --- a/actions/deletenotice.php +++ b/actions/deletenotice.php @@ -142,8 +142,20 @@ class DeletenoticeAction extends Action $this->hidden('token', common_session_token()); $this->hidden('notice', $this->trimmed('notice')); $this->element('p', null, _('Are you sure you want to delete this notice?')); - $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not delete this notice")); - $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Delete this notice')); + $this->submit('form_action-no', + // TRANS: Button label on the delete notice form. + _m('BUTTON','No'), + 'submit form_action-primary', + 'no', + // TRANS: Submit button title for 'No' when deleting a notice. + _("Do not delete this notice")); + $this->submit('form_action-yes', + // TRANS: Button label on the delete notice form. + _m('BUTTON','Yes'), + 'submit form_action-secondary', + 'yes', + // TRANS: Submit button title for 'Yes' when deleting a notice. + _('Delete this notice')); $this->elementEnd('fieldset'); $this->elementEnd('form'); } diff --git a/actions/deleteuser.php b/actions/deleteuser.php index 42ef4b9f5..1c1f19b0e 100644 --- a/actions/deleteuser.php +++ b/actions/deleteuser.php @@ -147,8 +147,20 @@ class DeleteuserAction extends ProfileFormAction } Event::handle('EndDeleteUserForm', array($this, $this->user)); } - $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user")); - $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Delete this user')); + $this->submit('form_action-no', + // TRANS: Button label on the delete user form. + _m('BUTTON','No'), + 'submit form_action-primary', + 'no', + // TRANS: Submit button title for 'No' when deleting a user. + _('Do not block this user')); + $this->submit('form_action-yes', + // TRANS: Button label on the delete user form. + _m('BUTTON','Yes'), + 'submit form_action-secondary', + 'yes', + // TRANS: Submit button title for 'Yes' when deleting a user. + _('Delete this user')); $this->elementEnd('fieldset'); $this->elementEnd('form'); } diff --git a/actions/groupblock.php b/actions/groupblock.php index fc95c0e66..e52db6e11 100644 --- a/actions/groupblock.php +++ b/actions/groupblock.php @@ -173,8 +173,20 @@ class GroupblockAction extends RedirectingAction $this->hidden($k, $v); } } - $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user from this group")); - $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user from this group')); + $this->submit('form_action-no', + // TRANS: Button label on the form to block a user from a group. + _m('BUTTON','No'), + 'submit form_action-primary', + 'no', + // TRANS: Submit button title for 'No' when blocking a user from a group. + _('Do not block this user from this group')); + $this->submit('form_action-yes', + // TRANS: Button label on the form to block a user from a group. + _m('BUTTON','Yes'), + 'submit form_action-secondary', + 'yes', + // TRANS: Submit button title for 'Yes' when blocking a user from a group. + _('Block this user from this group')); $this->elementEnd('fieldset'); $this->elementEnd('form'); } -- cgit v1.2.3-54-g00ecf From 68305d4b6848cec6afe887ee2a5735515060770e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 20 May 2010 12:46:36 -0700 Subject: Added block link to subscription notification emails; block action can now take a profile ID on the URL; added profile details to block page so there's an indication of who you're blocking before you pull the trigger. Fixed typo in RedirectingAction when no return-to data provided in form submission. RedirectingAction::returnToArgs() has been renamed to returnToPrevious() to avoid conflict with Action::returnToArgs() which returns arguments to be passed to other actions as return-to arguments. All callers should now be updated. More profile settings actions will now redirect through a login form if visited as a GET request, as would be expected from a bookmark, link sent in e-mail etc. --- actions/block.php | 46 ++++++++++++++++++++++++++++++++++++++-- actions/deleteuser.php | 4 ++-- actions/groupblock.php | 4 ++-- lib/mail.php | 10 +++++++-- lib/profileformaction.php | 13 ++++++++++-- lib/redirectingaction.php | 9 ++++---- lib/router.php | 5 +++++ plugins/UserFlag/clearflag.php | 2 +- plugins/UserFlag/flagprofile.php | 2 +- 9 files changed, 79 insertions(+), 16 deletions(-) (limited to 'actions/block.php') diff --git a/actions/block.php b/actions/block.php index 7f609c253..239a50868 100644 --- a/actions/block.php +++ b/actions/block.php @@ -87,13 +87,15 @@ class BlockAction extends ProfileFormAction { if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($this->arg('no')) { - $this->returnToArgs(); + $this->returnToPrevious(); } elseif ($this->arg('yes')) { $this->handlePost(); - $this->returnToArgs(); + $this->returnToPrevious(); } else { $this->showPage(); } + } else { + $this->showPage(); } } @@ -118,6 +120,12 @@ class BlockAction extends ProfileFormAction */ function areYouSureForm() { + // @fixme if we ajaxify the confirmation form, skip the preview on ajax hits + $profile = new ArrayWrapper(array($this->profile)); + $preview = new ProfileList($profile, $this); + $preview->show(); + + $id = $this->profile->id; $this->elementStart('form', array('id' => 'block-' . $id, 'method' => 'post', @@ -175,4 +183,38 @@ class BlockAction extends ProfileFormAction $this->autofocus('form_action-yes'); } + /** + * Override for form session token checks; on our first hit we're just + * requesting confirmation, which doesn't need a token. We need to be + * able to take regular GET requests from email! + * + * @throws ClientException if token is bad on POST request or if we have + * confirmation parameters which could trigger something. + */ + function checkSessionToken() + { + if ($_SERVER['REQUEST_METHOD'] == 'POST' || + $this->arg('yes') || + $this->arg('no')) { + + return parent::checkSessionToken(); + } + } + + /** + * If we reached this form without returnto arguments, return to the + * current user's subscription list. + * + * @return string URL + */ + function defaultReturnTo() + { + $user = common_current_user(); + if ($user) { + return common_local_url('subscribers', + array('nickname' => $user->nickname)); + } else { + return common_local_url('public'); + } + } } diff --git a/actions/deleteuser.php b/actions/deleteuser.php index 42ef4b9f5..c0a8b20e2 100644 --- a/actions/deleteuser.php +++ b/actions/deleteuser.php @@ -92,10 +92,10 @@ class DeleteuserAction extends ProfileFormAction { if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($this->arg('no')) { - $this->returnToArgs(); + $this->returnToPrevious(); } elseif ($this->arg('yes')) { $this->handlePost(); - $this->returnToArgs(); + $this->returnToPrevious(); } else { $this->showPage(); } diff --git a/actions/groupblock.php b/actions/groupblock.php index fc95c0e66..2e06dc324 100644 --- a/actions/groupblock.php +++ b/actions/groupblock.php @@ -117,7 +117,7 @@ class GroupblockAction extends RedirectingAction parent::handle($args); if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($this->arg('no')) { - $this->returnToArgs(); + $this->returnToPrevious(); } elseif ($this->arg('yes')) { $this->blockProfile(); } elseif ($this->arg('blockto')) { @@ -195,7 +195,7 @@ class GroupblockAction extends RedirectingAction return false; } - $this->returnToArgs(); + $this->returnToPrevious(); } /** diff --git a/lib/mail.php b/lib/mail.php index a4065e8d5..ab5742e33 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -245,6 +245,11 @@ function mail_subscribe_notify_profile($listenee, $other) $other->getBestName(), common_config('site', 'name')); + $blocklink = sprintf(_("If you believe this account is being used abusively, " . + "you can block them from your subscribers list and " . + "report as spam to site administrators at %s"), + common_local_url('block', array('profileid' => $other->id))); + // TRANS: Main body of new-subscriber notification e-mail $body = sprintf(_('%1$s is now listening to your notices on %2$s.'."\n\n". "\t".'%3$s'."\n\n". @@ -264,9 +269,10 @@ function mail_subscribe_notify_profile($listenee, $other) ($other->homepage) ? // TRANS: Profile info line in new-subscriber notification e-mail sprintf(_("Homepage: %s"), $other->homepage) . "\n" : '', - ($other->bio) ? + (($other->bio) ? // TRANS: Profile info line in new-subscriber notification e-mail - sprintf(_("Bio: %s"), $other->bio) . "\n\n" : '', + sprintf(_("Bio: %s"), $other->bio) . "\n" : '') . + "\n\n" . $blocklink . "\n", common_config('site', 'name'), common_local_url('emailsettings')); diff --git a/lib/profileformaction.php b/lib/profileformaction.php index 0ffafe5fb..51c89a922 100644 --- a/lib/profileformaction.php +++ b/lib/profileformaction.php @@ -60,7 +60,16 @@ class ProfileFormAction extends RedirectingAction $this->checkSessionToken(); if (!common_logged_in()) { - $this->clientError(_('Not logged in.')); + if ($_SERVER['REQUEST_METHOD'] == 'POST') { + $this->clientError(_('Not logged in.')); + } else { + // Redirect to login. + common_set_returnto($this->selfUrl()); + $user = common_current_user(); + if (Event::handle('RedirectToLogin', array($this, $user))) { + common_redirect(common_local_url('login'), 303); + } + } return false; } @@ -97,7 +106,7 @@ class ProfileFormAction extends RedirectingAction if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->handlePost(); - $this->returnToArgs(); + $this->returnToPrevious(); } } diff --git a/lib/redirectingaction.php b/lib/redirectingaction.php index f11585274..3a358f891 100644 --- a/lib/redirectingaction.php +++ b/lib/redirectingaction.php @@ -53,12 +53,13 @@ class RedirectingAction extends Action * * To be called only after successful processing. * - * @fixme rename this -- it obscures Action::returnToArgs() which - * returns a list of arguments, and is a bit confusing. + * Note: this was named returnToArgs() up through 0.9.2, which + * caused problems because there's an Action::returnToArgs() + * already which does something different. * * @return void */ - function returnToArgs() + function returnToPrevious() { // Now, gotta figure where we go back to $action = false; @@ -77,7 +78,7 @@ class RedirectingAction extends Action if ($action) { common_redirect(common_local_url($action, $args, $params), 303); } else { - $url = $this->defaultReturnToUrl(); + $url = $this->defaultReturnTo(); } common_redirect($url, 303); } diff --git a/lib/router.php b/lib/router.php index a9d07276f..afe44f92a 100644 --- a/lib/router.php +++ b/lib/router.php @@ -136,6 +136,11 @@ class Router $m->connect('main/'.$a, array('action' => $a)); } + // Also need a block variant accepting ID on URL for mail links + $m->connect('main/block/:profileid', + array('action' => 'block'), + array('profileid' => '[0-9]+')); + $m->connect('main/sup/:seconds', array('action' => 'sup'), array('seconds' => '[0-9]+')); diff --git a/plugins/UserFlag/clearflag.php b/plugins/UserFlag/clearflag.php index bd6732e2d..f032527ed 100644 --- a/plugins/UserFlag/clearflag.php +++ b/plugins/UserFlag/clearflag.php @@ -81,7 +81,7 @@ class ClearflagAction extends ProfileFormAction if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->handlePost(); if (!$this->boolean('ajax')) { - $this->returnToArgs(); + $this->returnToPrevious(); } } } diff --git a/plugins/UserFlag/flagprofile.php b/plugins/UserFlag/flagprofile.php index 2d0f0abb9..018c1e8ac 100644 --- a/plugins/UserFlag/flagprofile.php +++ b/plugins/UserFlag/flagprofile.php @@ -87,7 +87,7 @@ class FlagprofileAction extends ProfileFormAction if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->handlePost(); if (!$this->boolean('ajax')) { - $this->returnToArgs(); + $this->returnToPrevious(); } } } -- cgit v1.2.3-54-g00ecf