From 91ee2ea3b16e77d54bd9f20541a9958a4824a090 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Thu, 20 Jan 2011 20:00:45 +0100 Subject: [PATCH] Translator comments added L10n updates Remove superfluous whitespace Number parameters in message when two or more are used ClientException and ServerException should end with a period --- actions/atompubfavoritefeed.php | 46 ++++++++++++++--------------- actions/atompubmembershipfeed.php | 44 ++++++++++++++------------- actions/atompubshowfavorite.php | 22 ++++++-------- actions/atompubshowmembership.php | 20 ++++++------- actions/atompubshowsubscription.php | 8 ++--- actions/atompubsubscriptionfeed.php | 45 ++++++++++++++-------------- actions/confirmaddress.php | 2 +- actions/emailsettings.php | 12 ++++---- actions/groupdesignsettings.php | 2 +- actions/grouplogo.php | 29 +++++++++++++----- actions/imsettings.php | 21 ++++--------- actions/licenseadminpanel.php | 8 ----- actions/othersettings.php | 2 +- actions/profilesettings.php | 15 ++++------ actions/remotesubscribe.php | 6 ++-- actions/repeat.php | 4 +-- actions/smssettings.php | 27 ++++------------- actions/userdesignsettings.php | 13 +------- 18 files changed, 142 insertions(+), 184 deletions(-) diff --git a/actions/atompubfavoritefeed.php b/actions/atompubfavoritefeed.php index 478a01b7c6..d35bd9f53e 100644 --- a/actions/atompubfavoritefeed.php +++ b/actions/atompubfavoritefeed.php @@ -4,7 +4,7 @@ * Copyright (C) 2010, StatusNet, Inc. * * Feed of ActivityStreams 'favorite' actions - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class AtompubfavoritefeedAction extends ApiAuthAction { private $_profile = null; @@ -59,7 +58,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction * * @return boolean true */ - function prepare($argarray) { parent::prepare($argarray); @@ -67,7 +65,8 @@ class AtompubfavoritefeedAction extends ApiAuthAction $this->_profile = Profile::staticGet('id', $this->trimmed('profile')); if (empty($this->_profile)) { - throw new ClientException(_('No such profile'), 404); + // TRANS: Client exception thrown when requesting a favorite feed for a non-existing profile. + throw new ClientException(_('No such profile.'), 404); } $offset = ($this->page-1) * $this->count; @@ -76,7 +75,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction $this->_faves = Fave::byProfile($this->_profile->id, $offset, $limit); - + return true; } @@ -87,7 +86,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction * * @return void */ - function handle($argarray=null) { parent::handle($argarray); @@ -101,6 +99,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction $this->addFavorite(); break; default: + // TRANS: Client exception thrown when using an unsupported HTTP method. throw new ClientException(_('HTTP method not supported.'), 405); return; } @@ -113,7 +112,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction * * @return void */ - function showFeed() { header('Content-Type: application/atom+xml; charset=utf-8'); @@ -139,21 +137,25 @@ class AtompubfavoritefeedAction extends ApiAuthAction $feed->addAuthor($this->_profile->getBestName(), $this->_profile->getURI()); + // TRANS: Title for Atom favorites feed. + // TRANS: %s is a user nickname. $feed->setTitle(sprintf(_("%s favorites"), $this->_profile->getBestName())); - $feed->setSubtitle(sprintf(_("Notices %s has favorited to on %s"), + // TRANS: Subtitle for Atom favorites feed. + // TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename. + $feed->setSubtitle(sprintf(_("Notices %1$s has favorited on %2$s"), $this->_profile->getBestName(), common_config('site', 'name'))); $feed->addLink(common_local_url('showfavorites', - array('nickname' => + array('nickname' => $this->_profile->nickname))); $feed->addLink($url, array('rel' => 'self', 'type' => 'application/atom+xml')); - + // If there's more... if ($this->page > 1) { @@ -162,9 +164,9 @@ class AtompubfavoritefeedAction extends ApiAuthAction 'type' => 'application/atom+xml')); $feed->addLink(common_local_url('AtomPubFavoriteFeed', - array('profile' => + array('profile' => $this->_profile->id), - array('page' => + array('page' => $this->page - 1)), array('rel' => 'prev', 'type' => 'application/atom+xml')); @@ -205,17 +207,17 @@ class AtompubfavoritefeedAction extends ApiAuthAction * * @return void */ - function addFavorite() { // XXX: Refactor this; all the same for atompub if (empty($this->auth_user) || $this->auth_user->id != $this->_profile->id) { - throw new ClientException(_("Can't add someone else's". - " subscription"), 403); + // TRANS: Client exception thrown when trying to set a favorite for another user. + throw new ClientException(_("Cannot add someone else's". + " subscription."), 403); } - + $xml = file_get_contents('php://input'); $dom = DOMDocument::loadXML($xml); @@ -234,9 +236,8 @@ class AtompubfavoritefeedAction extends ApiAuthAction if (Event::handle('StartAtomPubNewActivity', array(&$activity))) { if ($activity->verb != ActivityVerb::FAVORITE) { - // TRANS: Client error displayed when not using the POST verb. - // TRANS: Do not translate POST. - throw new ClientException(_('Can only handle Favorite activities.')); + // TRANS: Client exception thrown when trying use an incorrect activity verb for the Atom pub method. + throw new ClientException(_('Can only handle favorite activities.')); return; } @@ -245,6 +246,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction if (!in_array($note->type, array(ActivityObject::NOTE, ActivityObject::BLOGENTRY, ActivityObject::STATUS))) { + // TRANS: Client exception thrown when trying favorite an object that is not a notice. throw new ClientException(_('Can only fave notices.')); return; } @@ -253,6 +255,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction if (empty($notice)) { // XXX: import from listed URL or something + // TRANS: Client exception thrown when trying favorite a notice without content. throw new ClientException(_('Unknown note.')); } @@ -260,6 +263,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction 'notice_id' => $notice->id)); if (!empty($old)) { + // TRANS: Client exception thrown when trying favorite an already favorited notice. throw new ClientException(_('Already a favorite.')); } @@ -296,7 +300,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction * * @return boolean is read only action? */ - function isReadOnly($args) { if ($_SERVER['REQUEST_METHOD'] == 'GET' || @@ -328,7 +331,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction * * @return string etag http header */ - function etag() { return null; @@ -339,7 +341,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction * * @return boolean true if delete, else false */ - function requiresAuth() { if ($_SERVER['REQUEST_METHOD'] == 'GET' || @@ -359,7 +360,6 @@ class AtompubfavoritefeedAction extends ApiAuthAction * * @return void */ - function notify($fave, $notice, $user) { $other = User::staticGet('id', $notice->profile_id); diff --git a/actions/atompubmembershipfeed.php b/actions/atompubmembershipfeed.php index 3002576c15..8e3db3f3de 100644 --- a/actions/atompubmembershipfeed.php +++ b/actions/atompubmembershipfeed.php @@ -4,7 +4,7 @@ * Copyright (C) 2010, StatusNet, Inc. * * Feed of group memberships for a user, in ActivityStreams format - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class AtompubmembershipfeedAction extends ApiAuthAction { private $_profile = null; @@ -59,7 +58,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction * * @return boolean true */ - function prepare($argarray) { parent::prepare($argarray); @@ -67,8 +65,9 @@ class AtompubmembershipfeedAction extends ApiAuthAction $profileId = $this->trimmed('profile'); $this->_profile = Profile::staticGet('id', $profileId); - + if (empty($this->_profile)) { + // TRANS: Client exception. throw new ClientException(_('No such profile.'), 404); } @@ -78,7 +77,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction $this->_memberships = Group_member::byMember($this->_profile->id, $offset, $limit); - + return true; } @@ -89,7 +88,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction * * @return void */ - function handle($argarray=null) { parent::handle($argarray); @@ -103,6 +101,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction $this->addMembership(); break; default: + // TRANS: Client exception thrown when using an unsupported HTTP method. throw new ClientException(_('HTTP method not supported.'), 405); return; } @@ -115,7 +114,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction * * @return void */ - function showFeed() { header('Content-Type: application/atom+xml; charset=utf-8'); @@ -141,21 +139,25 @@ class AtompubmembershipfeedAction extends ApiAuthAction $feed->addAuthor($this->_profile->getBestName(), $this->_profile->getURI()); + // TRANS: Title for group membership feed. + // TRANS: %s is a username. $feed->setTitle(sprintf(_("%s group memberships"), $this->_profile->getBestName())); - $feed->setSubtitle(sprintf(_("Groups %s is a member of on %s"), + // TRANS: Subtitle for group membership feed. + // TRANS: %1$s is a username, %2$s is the StatusNet sitename. + $feed->setSubtitle(sprintf(_("Groups %1$s is a member of on %2$s"), $this->_profile->getBestName(), common_config('site', 'name'))); $feed->addLink(common_local_url('usergroups', - array('nickname' => + array('nickname' => $this->_profile->nickname))); $feed->addLink($url, array('rel' => 'self', 'type' => 'application/atom+xml')); - + // If there's more... if ($this->page > 1) { @@ -164,9 +166,9 @@ class AtompubmembershipfeedAction extends ApiAuthAction 'type' => 'application/atom+xml')); $feed->addLink(common_local_url('AtomPubMembershipFeed', - array('profile' => + array('profile' => $this->_profile->id), - array('page' => + array('page' => $this->page - 1)), array('rel' => 'prev', 'type' => 'application/atom+xml')); @@ -207,17 +209,17 @@ class AtompubmembershipfeedAction extends ApiAuthAction * * @return void */ - function addMembership() { // XXX: Refactor this; all the same for atompub if (empty($this->auth_user) || $this->auth_user->id != $this->_profile->id) { - throw new ClientException(_("Can't add someone else's". + // TRANS: Client exception thrown when trying subscribe someone else to a group. + throw new ClientException(_("Cannot add someone else's". " membership"), 403); } - + $xml = file_get_contents('php://input'); $dom = DOMDocument::loadXML($xml); @@ -234,25 +236,26 @@ class AtompubmembershipfeedAction extends ApiAuthAction $membership = null; if (Event::handle('StartAtomPubNewActivity', array(&$activity))) { - if ($activity->verb != ActivityVerb::JOIN) { // TRANS: Client error displayed when not using the POST verb. // TRANS: Do not translate POST. - throw new ClientException(_('Can only handle Join activities.')); + throw new ClientException(_('Can only handle join activities.')); return; } $groupObj = $activity->objects[0]; if ($groupObj->type != ActivityObject::GROUP) { + // TRANS: Client exception thrown when trying favorite an object that is not a notice. throw new ClientException(_('Can only fave notices.')); return; } $group = User_group::staticGet('uri', $groupObj->id); - + if (empty($group)) { // XXX: import from listed URL or something + // TRANS: Client exception thrown when trying to subscribe to a non-existing group. throw new ClientException(_('Unknown group.')); } @@ -260,6 +263,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction 'group_id' => $group->id)); if (!empty($old)) { + // TRANS: Client exception thrown when trying to subscribe to an already subscribed group. throw new ClientException(_('Already a member.')); } @@ -267,6 +271,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction if (Group_block::isBlocked($group, $profile)) { // XXX: import from listed URL or something + // TRANS: Client exception thrown when trying to subscribe to group while blocked from that group. throw new ClientException(_('Blocked by admin.')); } @@ -299,7 +304,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction * * @return boolean is read only action? */ - function isReadOnly($args) { if ($_SERVER['REQUEST_METHOD'] == 'GET' || @@ -331,7 +335,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction * * @return string etag http header */ - function etag() { return null; @@ -342,7 +345,6 @@ class AtompubmembershipfeedAction extends ApiAuthAction * * @return boolean true if delete, else false */ - function requiresAuth() { if ($_SERVER['REQUEST_METHOD'] == 'GET' || diff --git a/actions/atompubshowfavorite.php b/actions/atompubshowfavorite.php index 5fe680bb7b..328f35d8f9 100644 --- a/actions/atompubshowfavorite.php +++ b/actions/atompubshowfavorite.php @@ -4,7 +4,7 @@ * Copyright (C) 2010, StatusNet, Inc. * * Show a single favorite in Atom Activity Streams format - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -48,7 +48,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class AtompubshowfavoriteAction extends ApiAuthAction { private $_profile = null; @@ -62,7 +61,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction * * @return boolean true */ - function prepare($argarray) { parent::prepare($argarray); @@ -73,12 +71,14 @@ class AtompubshowfavoriteAction extends ApiAuthAction $this->_profile = Profile::staticGet('id', $profileId); if (empty($this->_profile)) { + // TRANS: Client exception. throw new ClientException(_('No such profile.'), 404); } $this->_notice = Notice::staticGet('id', $noticeId); if (empty($this->_notice)) { + // TRANS: Client exception thrown when referencing a non-existing notice. throw new ClientException(_('No such notice.'), 404); } @@ -86,6 +86,7 @@ class AtompubshowfavoriteAction extends ApiAuthAction 'notice_id' => $noticeId)); if (empty($this->_fave)) { + // TRANS: Client exception thrown when referencing a non-existing favorite. throw new ClientException(_('No such favorite.'), 404); } @@ -99,7 +100,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction * * @return void */ - function handle($argarray=null) { parent::handle($argarray); @@ -113,6 +113,7 @@ class AtompubshowfavoriteAction extends ApiAuthAction $this->deleteFave(); break; default: + // TRANS: Client exception thrown using an unsupported HTTP method. throw new ClientException(_('HTTP method not supported.'), 405); } @@ -121,10 +122,9 @@ class AtompubshowfavoriteAction extends ApiAuthAction /** * Show a single favorite, in ActivityStreams format - * + * * @return void */ - function showFave() { $activity = $this->_fave->asActivity(); @@ -140,15 +140,15 @@ class AtompubshowfavoriteAction extends ApiAuthAction /** * Delete the favorite - * + * * @return void */ - function deleteFave() { if (empty($this->auth_user) || $this->auth_user->id != $this->_profile->id) { - throw new ClientException(_("Can't delete someone else's". + // TRANS: Client exception thrown when trying to remove a favorite notice of another user. + throw new ClientException(_("Cannot delete someone else's". " favorite"), 403); } @@ -166,7 +166,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction * * @return boolean is read only action? */ - function isReadOnly($args) { if ($_SERVER['REQUEST_METHOD'] == 'GET' || @@ -184,7 +183,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction * * @return string last modified http header */ - function lastModified() { return max(strtotime($this->_profile->modified), @@ -199,7 +197,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction * * @return string etag http header */ - function etag() { $mtime = strtotime($this->_fave->modified); @@ -215,7 +212,6 @@ class AtompubshowfavoriteAction extends ApiAuthAction * * @return boolean true if delete, else false */ - function requiresAuth() { if ($_SERVER['REQUEST_METHOD'] == 'GET' || diff --git a/actions/atompubshowmembership.php b/actions/atompubshowmembership.php index 6d848a2290..4454c7fd7a 100644 --- a/actions/atompubshowmembership.php +++ b/actions/atompubshowmembership.php @@ -4,7 +4,7 @@ * Copyright (C) 2010, StatusNet, Inc. * * Show a single membership as an Activity Streams entry - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class AtompubshowmembershipAction extends ApiAuthAction { private $_profile = null; @@ -60,7 +59,6 @@ class AtompubshowmembershipAction extends ApiAuthAction * * @return boolean true */ - function prepare($argarray) { parent::prepare($argarray); @@ -68,8 +66,9 @@ class AtompubshowmembershipAction extends ApiAuthAction $profileId = $this->trimmed('profile'); $this->_profile = Profile::staticGet('id', $profileId); - + if (empty($this->_profile)) { + // TRANS: Client exception. throw new ClientException(_('No such profile.'), 404); } @@ -78,6 +77,7 @@ class AtompubshowmembershipAction extends ApiAuthAction $this->_group = User_group::staticGet('id', $groupId); if (empty($this->_group)) { + // TRANS: Client exception thrown when referencing a non-existing group. throw new ClientException(_('No such group'), 404); } @@ -87,6 +87,7 @@ class AtompubshowmembershipAction extends ApiAuthAction $this->_membership = Group_member::pkeyGet($kv); if (empty($this->_membership)) { + // TRANS: Client exception thrown when trying to show membership of a non-subscribed group throw new ClientException(_('Not a member'), 404); } @@ -100,7 +101,6 @@ class AtompubshowmembershipAction extends ApiAuthAction * * @return void */ - function handle($argarray=null) { switch ($_SERVER['REQUEST_METHOD']) { @@ -112,7 +112,8 @@ class AtompubshowmembershipAction extends ApiAuthAction $this->deleteMembership(); break; default: - throw new ClientException(_('Method not supported'), 405); + // TRANS: Client exception thrown when using an unsupported HTTP method. + throw new ClientException(_('HTTP method not supported'), 405); break; } return; @@ -123,7 +124,6 @@ class AtompubshowmembershipAction extends ApiAuthAction * * @return void */ - function showMembership() { $activity = $this->_membership->asActivity(); @@ -147,7 +147,8 @@ class AtompubshowmembershipAction extends ApiAuthAction { if (empty($this->auth_user) || $this->auth_user->id != $this->_profile->id) { - throw new ClientException(_("Can't delete someone else's". + // TRANS: Client exception thrown when deleting someone else's membership. + throw new ClientException(_("Cannot delete someone else's". " membership"), 403); } @@ -168,7 +169,6 @@ class AtompubshowmembershipAction extends ApiAuthAction * * @return boolean is read only action? */ - function isReadOnly($args) { if ($_SERVER['REQUEST_METHOD'] == 'GET' || @@ -203,7 +203,6 @@ class AtompubshowmembershipAction extends ApiAuthAction * * @return string etag http header */ - function etag() { $ctime = strtotime($this->_membership->created); @@ -222,7 +221,6 @@ class AtompubshowmembershipAction extends ApiAuthAction * * @return boolean true if delete, else false */ - function requiresAuth() { if ($_SERVER['REQUEST_METHOD'] == 'GET' || diff --git a/actions/atompubshowsubscription.php b/actions/atompubshowsubscription.php index 6274f8f922..aeff0cbf2a 100644 --- a/actions/atompubshowsubscription.php +++ b/actions/atompubshowsubscription.php @@ -69,7 +69,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction if (empty($this->_subscriber)) { // TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID. // TRANS: %d is the non-existing profile ID number. - throw new ClientException(sprintf(_('No such profile id: %d'), + throw new ClientException(sprintf(_('No such profile id: %d.'), $subscriberId), 404); } @@ -80,7 +80,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction if (empty($this->_subscribed)) { // TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID. // TRANS: %d is the non-existing profile ID number. - throw new ClientException(sprintf(_('No such profile id: %d'), + throw new ClientException(sprintf(_('No such profile id: %d.'), $subscribedId), 404); } @@ -91,7 +91,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction if (empty($this->_subscription)) { // TRANS: Client exception thrown when trying to display a subscription for a non-subscribed profile ID. // TRANS: %1$d is the non-existing subscriber ID number, $2$d is the ID of the profile that was not subscribed to. - $msg = sprintf(_('Profile %1$d not subscribed to profile %2$d'), + $msg = sprintf(_('Profile %1$d not subscribed to profile %2$d.'), $subscriberId, $subscribedId); throw new ClientException($msg, 404); } @@ -155,7 +155,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction $this->auth_user->id != $this->_subscriber->id) { // TRANS: Client exception thrown when trying to delete a subscription of another user. throw new ClientException(_("Cannot delete someone else's ". - "subscription"), 403); + "subscription."), 403); } Subscription::cancel($this->_subscriber, diff --git a/actions/atompubsubscriptionfeed.php b/actions/atompubsubscriptionfeed.php index 15ae79f6a6..0893c4b045 100644 --- a/actions/atompubsubscriptionfeed.php +++ b/actions/atompubsubscriptionfeed.php @@ -4,7 +4,7 @@ * Copyright (C) 2010, StatusNet, Inc. * * AtomPub subscription feed - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -40,7 +40,7 @@ require_once INSTALLDIR . '/lib/apiauth.php'; * Subscription feed class for AtomPub * * Generates a list of the user's subscriptions - * + * * @category AtomPub * @package StatusNet * @author Evan Prodromou @@ -48,7 +48,6 @@ require_once INSTALLDIR . '/lib/apiauth.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class AtompubsubscriptionfeedAction extends ApiAuthAction { private $_profile = null; @@ -61,17 +60,18 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction * * @return boolean true */ - function prepare($argarray) { parent::prepare($argarray); - + $subscriber = $this->trimmed('subscriber'); $this->_profile = Profile::staticGet('id', $subscriber); if (empty($this->_profile)) { - throw new ClientException(sprintf(_('No such profile id: %d'), + // TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID. + // TRANS: %d is the non-existing profile ID number. + throw new ClientException(sprintf(_('No such profile id: %d.'), $subscriber), 404); } @@ -93,7 +93,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction * * @return void */ - function handle($argarray=null) { parent::handle($argarray); @@ -106,6 +105,7 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction $this->addSubscription(); break; default: + // TRANS: Client exception thrown when using an unsupported HTTP method. $this->clientError(_('HTTP method not supported.'), 405); return; } @@ -118,7 +118,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction * * @return void */ - function showFeed() { header('Content-Type: application/atom+xml; charset=utf-8'); @@ -144,21 +143,25 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction $feed->addAuthor($this->_profile->getBestName(), $this->_profile->getURI()); + // TRANS: Title for Atom subscription feed. + // TRANS: %s is a user nickname. $feed->setTitle(sprintf(_("%s subscriptions"), $this->_profile->getBestName())); - $feed->setSubtitle(sprintf(_("People %s has subscribed to on %s"), + // TRANS: Subtitle for Atom subscription feed. + // TRANS: %1$s is a user nickname, %s$s is the StatusNet sitename. + $feed->setSubtitle(sprintf(_("People %1$s has subscribed to on %2$s"), $this->_profile->getBestName(), common_config('site', 'name'))); $feed->addLink(common_local_url('subscriptions', - array('nickname' => + array('nickname' => $this->_profile->nickname))); $feed->addLink($url, array('rel' => 'self', 'type' => 'application/atom+xml')); - + // If there's more... if ($this->page > 1) { @@ -167,9 +170,9 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction 'type' => 'application/atom+xml')); $feed->addLink(common_local_url('AtomPubSubscriptionFeed', - array('subscriber' => + array('subscriber' => $this->_profile->id), - array('page' => + array('page' => $this->page - 1)), array('rel' => 'prev', 'type' => 'application/atom+xml')); @@ -214,15 +217,15 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction * * @return void */ - function addSubscription() { if (empty($this->auth_user) || $this->auth_user->id != $this->_profile->id) { - throw new ClientException(_("Can't add someone else's". - " subscription"), 403); + // TRANS: Client exception thrown when trying to subscribe another user. + throw new ClientException(_("Cannot add someone else's". + " subscription."), 403); } - + $xml = file_get_contents('php://input'); $dom = DOMDocument::loadXML($xml); @@ -250,6 +253,7 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction $person = $activity->objects[0]; if ($person->type != ActivityObject::PERSON) { + // TRANS: Client exception thrown when subscribing to an object that is not a person. $this->clientError(_('Can only follow people.')); return; } @@ -259,7 +263,8 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction $profile = Profile::fromURI($person->id); if (empty($profile)) { - $this->clientError(sprintf(_('Unknown profile %s'), $person->id)); + // TRANS: Client exception thrown when subscribing to a non-existing profile. + $this->clientError(sprintf(_('Unknown profile %s.'), $person->id)); return; } @@ -290,7 +295,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction * * @return boolean is read only action? */ - function isReadOnly($args) { return $_SERVER['REQUEST_METHOD'] != 'POST'; @@ -301,7 +305,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction * * @return string last modified http header */ - function lastModified() { return null; @@ -312,7 +315,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction * * @return string etag http header */ - function etag() { return null; @@ -323,7 +325,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction * * @return boolean true if delete, else false */ - function requiresAuth() { if ($_SERVER['REQUEST_METHOD'] == 'POST') { diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index 5617c53392..238e70551c 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -115,7 +115,7 @@ class ConfirmaddressAction extends Action if (!$result) { common_log_db_error($cur, 'UPDATE', __FILE__); // TRANS: Server error displayed when a user update to the database fails in the contact address confirmation action. - $this->serverError(_('Couldn\'t update user.')); + $this->serverError(_('Could not update user.')); return; } diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 4a7dc1b871..cc513c2b40 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -356,7 +356,7 @@ class EmailsettingsAction extends AccountSettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error updating e-mail preferences. - $this->serverError(_('Couldn\'t update user.')); + $this->serverError(_('Could not update user.')); return; } @@ -423,7 +423,7 @@ class EmailsettingsAction extends AccountSettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); // TRANS: Server error thrown on database error adding e-mail confirmation code. - $this->serverError(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Could not insert confirmation code.')); return; } @@ -465,7 +465,7 @@ class EmailsettingsAction extends AccountSettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); // TRANS: Server error thrown on database error canceling e-mail address confirmation. - $this->serverError(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Could not delete email confirmation.')); return; } @@ -505,7 +505,7 @@ class EmailsettingsAction extends AccountSettingsAction if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error removing a registered e-mail address. - $this->serverError(_('Couldn\'t update user.')); + $this->serverError(_('Could not update user.')); return; } $user->query('COMMIT'); @@ -537,7 +537,7 @@ class EmailsettingsAction extends AccountSettingsAction if (!$user->updateKeys($orig)) { common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error removing incoming e-mail address. - $this->serverError(_("Couldn't update user record.")); + $this->serverError(_("Could not update user record.")); } // TRANS: Message given after successfully removing an incoming e-mail address. @@ -562,7 +562,7 @@ class EmailsettingsAction extends AccountSettingsAction if (!$user->updateKeys($orig)) { common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error adding incoming e-mail address. - $this->serverError(_("Couldn't update user record.")); + $this->serverError(_("Could not update user record.")); } // TRANS: Message given after successfully adding an incoming e-mail address. diff --git a/actions/groupdesignsettings.php b/actions/groupdesignsettings.php index 526226a285..6fd4da2c8e 100644 --- a/actions/groupdesignsettings.php +++ b/actions/groupdesignsettings.php @@ -263,7 +263,7 @@ class GroupDesignSettingsAction extends DesignSettingsAction if ($result === false) { common_log_db_error($design, 'UPDATE', __FILE__); - $this->showForm(_('Couldn\'t update your design.')); + $this->showForm(_('Could not update your design.')); return; } diff --git a/actions/grouplogo.php b/actions/grouplogo.php index f414a23cc3..7b7c01b23b 100644 --- a/actions/grouplogo.php +++ b/actions/grouplogo.php @@ -49,7 +49,6 @@ define('MAX_ORIGINAL', 480); * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class GrouplogoAction extends GroupDesignAction { var $mode = null; @@ -67,6 +66,7 @@ class GrouplogoAction extends GroupDesignAction parent::prepare($args); if (!common_logged_in()) { + // TRANS: Client error displayed when trying to create a group while not logged in. $this->clientError(_('You must be logged in to create a group.')); return false; } @@ -83,6 +83,7 @@ class GrouplogoAction extends GroupDesignAction } if (!$nickname) { + // TRANS: Client error displayed when trying to change group logo settings without having a nickname. $this->clientError(_('No nickname.'), 404); return false; } @@ -99,6 +100,7 @@ class GrouplogoAction extends GroupDesignAction } if (!$this->group) { + // TRANS: Client error displayed when trying to update logo settings for a non-existing group. $this->clientError(_('No such group.'), 404); return false; } @@ -106,6 +108,7 @@ class GrouplogoAction extends GroupDesignAction $cur = common_current_user(); if (!$cur->isAdmin($this->group)) { + // TRANS: Client error displayed when trying to change group logo settings while not being a group admin. $this->clientError(_('You must be an admin to edit the group.'), 403); return false; } @@ -136,9 +139,9 @@ class GrouplogoAction extends GroupDesignAction * * @return string Title of the page */ - function title() { + // TRANS: Title for group logo settings page. return _('Group logo'); } @@ -147,9 +150,10 @@ class GrouplogoAction extends GroupDesignAction * * @return instructions for use */ - function getInstructions() { + // TRANS: Instructions for group logo page. + // TRANS: %s is the maximum file size for that site. return sprintf(_('You can upload a logo image for your group. The maximum file size is %s.'), ImageFile::maxFileSize()); } @@ -160,7 +164,6 @@ class GrouplogoAction extends GroupDesignAction * * @return void */ - function showContent() { if ($this->mode == 'crop') { @@ -178,6 +181,7 @@ class GrouplogoAction extends GroupDesignAction if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); + // TRANS: Server error displayed coming across a request from a user without a profile. $this->serverError(_('User without matching profile.')); return; } @@ -192,6 +196,7 @@ class GrouplogoAction extends GroupDesignAction common_local_url('grouplogo', array('nickname' => $this->group->nickname)))); $this->elementStart('fieldset'); + // TRANS: Group logo form legend. $this->element('legend', null, _('Group logo')); $this->hidden('token', common_session_token()); @@ -199,6 +204,7 @@ class GrouplogoAction extends GroupDesignAction if ($original) { $this->elementStart('li', array('id' => 'avatar_original', 'class' => 'avatar_view')); + // TRANS: Uploaded original file in group logo form. $this->element('h2', null, _("Original")); $this->elementStart('div', array('id'=>'avatar_original_view')); $this->element('img', array('src' => $this->group->original_logo, @@ -210,6 +216,7 @@ class GrouplogoAction extends GroupDesignAction if ($this->group->homepage_logo) { $this->elementStart('li', array('id' => 'avatar_preview', 'class' => 'avatar_view')); + // TRANS: Header for preview of to be displayed group logo. $this->element('h2', null, _("Preview")); $this->elementStart('div', array('id'=>'avatar_preview_view')); $this->element('img', array('src' => $this->group->homepage_logo, @@ -233,6 +240,7 @@ class GrouplogoAction extends GroupDesignAction $this->elementStart('ul', 'form_actions'); $this->elementStart('li'); + // TRANS: Submit button for uploading a group logo. $this->submit('upload', _('Upload')); $this->elementEnd('li'); $this->elementEnd('ul'); @@ -251,6 +259,7 @@ class GrouplogoAction extends GroupDesignAction common_local_url('grouplogo', array('nickname' => $this->group->nickname)))); $this->elementStart('fieldset'); + // TRANS: Legend for group logo settings fieldset. $this->element('legend', null, _('Avatar settings')); $this->hidden('token', common_session_token()); @@ -259,6 +268,7 @@ class GrouplogoAction extends GroupDesignAction $this->elementStart('li', array('id' => 'avatar_original', 'class' => 'avatar_view')); + // TRANS: Header for originally uploaded file before a crop on the group logo page. $this->element('h2', null, _("Original")); $this->elementStart('div', array('id'=>'avatar_original_view')); $this->element('img', array('src' => Avatar::url($this->filedata['filename']), @@ -271,6 +281,7 @@ class GrouplogoAction extends GroupDesignAction $this->elementStart('li', array('id' => 'avatar_preview', 'class' => 'avatar_view')); + // TRANS: Header for the cropped group logo on the group logo page. $this->element('h2', null, _("Preview")); $this->elementStart('div', array('id'=>'avatar_preview_view')); $this->element('img', array('src' => Avatar::url($this->filedata['filename']), @@ -286,6 +297,7 @@ class GrouplogoAction extends GroupDesignAction 'id' => $crop_info)); } + // TRANS: Button text for cropping an uploaded group logo. $this->submit('crop', _('Crop')); $this->elementEnd('li'); @@ -302,13 +314,13 @@ class GrouplogoAction extends GroupDesignAction * * @return void */ - function handlePost() { // CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { + // TRANS: Form validation error message. $this->show_form(_('There was a problem with your session token. '. 'Try again, please.')); return; @@ -319,6 +331,7 @@ class GrouplogoAction extends GroupDesignAction } else if ($this->arg('crop')) { $this->cropLogo(); } else { + // TRANS: Form validation error message when an unsupported argument is used. $this->showForm(_('Unexpected form submission.')); } } @@ -331,7 +344,6 @@ class GrouplogoAction extends GroupDesignAction * * @return void */ - function uploadLogo() { try { @@ -362,6 +374,7 @@ class GrouplogoAction extends GroupDesignAction $this->mode = 'crop'; + // TRANS: Form instructions on the group logo page. $this->showForm(_('Pick a square area of the image to be the logo.'), true); } @@ -371,12 +384,12 @@ class GrouplogoAction extends GroupDesignAction * * @return void */ - function cropLogo() { $filedata = $_SESSION['FILEDATA']; if (!$filedata) { + // TRANS: Server error displayed trying to crop an uploaded group logo that is no longer present. $this->serverError(_('Lost our file data.')); return; } @@ -396,8 +409,10 @@ class GrouplogoAction extends GroupDesignAction @unlink($filedata['filepath']); unset($_SESSION['FILEDATA']); $this->mode = 'upload'; + // TRANS: Form success message after updating a group logo. $this->showForm(_('Logo updated.'), true); } else { + // TRANS: Form failure message after failing to update a group logo. $this->showForm(_('Failed updating logo.')); } } diff --git a/actions/imsettings.php b/actions/imsettings.php index 29cbeb82e3..dc72290345 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -45,7 +45,6 @@ require_once INSTALLDIR.'/lib/jabber.php'; * * @see SettingsAction */ - class ImsettingsAction extends ConnectSettingsAction { /** @@ -53,7 +52,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return string Title of the page */ - function title() { // TRANS: Title for instance messaging settings. @@ -65,7 +63,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return instructions for use */ - function getInstructions() { // TRANS: Instant messaging settings page instructions. @@ -85,7 +82,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function showContent() { if (!common_config('xmpp', 'enabled')) { @@ -152,7 +148,7 @@ class ImsettingsAction extends ConnectSettingsAction } } $this->elementEnd('fieldset'); - + $this->elementStart('fieldset', array('id' => 'settings_im_preferences')); // TRANS: Form legend for IM preferences form. $this->element('legend', null, _('IM preferences')); @@ -194,7 +190,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return Confirm_address address object for this user */ - function getConfirmation() { $user = common_current_user(); @@ -221,7 +216,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function handlePost() { // CSRF protection @@ -254,7 +248,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function savePreferences() { $jabbernotify = $this->boolean('jabbernotify'); @@ -280,7 +273,7 @@ class ImsettingsAction extends ConnectSettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error updating IM preferences. - $this->serverError(_('Couldn\'t update user.')); + $this->serverError(_('Could not update user.')); return; } @@ -298,7 +291,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function addAddress() { $user = common_current_user(); @@ -348,7 +340,7 @@ class ImsettingsAction extends ConnectSettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); // TRANS: Server error thrown on database error adding IM confirmation code. - $this->serverError(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Could not insert confirmation code.')); return; } @@ -374,7 +366,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function cancelConfirmation() { $jabber = $this->arg('jabber'); @@ -397,7 +388,7 @@ class ImsettingsAction extends ConnectSettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); // TRANS: Server error thrown on database error canceling IM address confirmation. - $this->serverError(_('Couldn\'t delete IM confirmation.')); + $this->serverError(_('Could not delete IM confirmation.')); return; } @@ -412,7 +403,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return void */ - function removeAddress() { $user = common_current_user(); @@ -439,7 +429,7 @@ class ImsettingsAction extends ConnectSettingsAction if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error removing a registered IM address. - $this->serverError(_('Couldn\'t update user.')); + $this->serverError(_('Could not update user.')); return; } $user->query('COMMIT'); @@ -459,7 +449,6 @@ class ImsettingsAction extends ConnectSettingsAction * * @return boolean whether the Jabber ID exists */ - function jabberExists($jabber) { $user = common_current_user(); diff --git a/actions/licenseadminpanel.php b/actions/licenseadminpanel.php index 95ac48cc8f..4adeb5c3c6 100644 --- a/actions/licenseadminpanel.php +++ b/actions/licenseadminpanel.php @@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class LicenseadminpanelAction extends AdminPanelAction { @@ -61,7 +60,6 @@ class LicenseadminpanelAction extends AdminPanelAction * * @return string instructions */ - function getInstructions() { return _('License for this StatusNet site'); @@ -72,7 +70,6 @@ class LicenseadminpanelAction extends AdminPanelAction * * @return void */ - function showForm() { $form = new LicenseAdminPanelForm($this); @@ -85,7 +82,6 @@ class LicenseadminpanelAction extends AdminPanelAction * * @return void */ - function saveSettings() { static $settings = array( @@ -128,7 +124,6 @@ class LicenseadminpanelAction extends AdminPanelAction * * @return nothing */ - function validate(&$values) { // Validate license type (shouldn't have to do it, but just in case) @@ -197,7 +192,6 @@ class LicenseAdminPanelForm extends AdminForm * * @return int ID of the form */ - function id() { return 'licenseadminpanel'; @@ -208,7 +202,6 @@ class LicenseAdminPanelForm extends AdminForm * * @return string class of the form */ - function formClass() { return 'form_settings'; @@ -312,7 +305,6 @@ class LicenseAdminPanelForm extends AdminForm * * @return void */ - function formActions() { $this->out->submit( diff --git a/actions/othersettings.php b/actions/othersettings.php index 13460a4bfb..ef2c9f32b0 100644 --- a/actions/othersettings.php +++ b/actions/othersettings.php @@ -181,7 +181,7 @@ class OthersettingsAction extends AccountSettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error displayed when "Other" settings in user profile could not be updated on the server. - $this->serverError(_('Couldn\'t update user.')); + $this->serverError(_('Could not update user.')); return; } diff --git a/actions/profilesettings.php b/actions/profilesettings.php index 19fbdbd293..523c9df4cb 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/accountsettingsaction.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class ProfilesettingsAction extends AccountSettingsAction { /** @@ -54,7 +53,6 @@ class ProfilesettingsAction extends AccountSettingsAction * * @return string Title of the page */ - function title() { // TRANS: Page title for profile settings. @@ -66,7 +64,6 @@ class ProfilesettingsAction extends AccountSettingsAction * * @return instructions for use */ - function getInstructions() { // TRANS: Usage instructions for profile settings. @@ -87,7 +84,6 @@ class ProfilesettingsAction extends AccountSettingsAction * * @return void */ - function showContent() { $user = common_current_user(); @@ -212,7 +208,6 @@ class ProfilesettingsAction extends AccountSettingsAction * * @return void */ - function handlePost() { // CSRF protection @@ -323,7 +318,7 @@ class ProfilesettingsAction extends AccountSettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown when user profile settings could not be updated. - $this->serverError(_('Couldn\'t update user.')); + $this->serverError(_('Could not update user.')); return; } else { // Re-initialize language environment if it changed @@ -348,7 +343,7 @@ class ProfilesettingsAction extends AccountSettingsAction common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown when user profile settings could not be updated to // TRANS: automatically subscribe to any subscriber. - $this->serverError(_('Couldn\'t update user for autosubscribe.')); + $this->serverError(_('Could not update user for autosubscribe.')); return; } } @@ -406,7 +401,7 @@ class ProfilesettingsAction extends AccountSettingsAction if ($result === false) { common_log_db_error($prefs, ($exists) ? 'UPDATE' : 'INSERT', __FILE__); // TRANS: Server error thrown when user profile location preference settings could not be updated. - $this->serverError(_('Couldn\'t save location prefs.')); + $this->serverError(_('Could not save location prefs.')); return; } } @@ -419,7 +414,7 @@ class ProfilesettingsAction extends AccountSettingsAction if ($result === false) { common_log_db_error($profile, 'UPDATE', __FILE__); // TRANS: Server error thrown when user profile settings could not be saved. - $this->serverError(_('Couldn\'t save profile.')); + $this->serverError(_('Could not save profile.')); return; } @@ -428,7 +423,7 @@ class ProfilesettingsAction extends AccountSettingsAction if (!$result) { // TRANS: Server error thrown when user profile settings tags could not be saved. - $this->serverError(_('Couldn\'t save tags.')); + $this->serverError(_('Could not save tags.')); return; } diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index 9fc235e743..63ba618c41 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -44,7 +44,6 @@ require_once INSTALLDIR.'/extlib/libomb/profile.php'; * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://status.net/ */ - class RemotesubscribeAction extends Action { var $nickname; @@ -173,14 +172,14 @@ class RemotesubscribeAction extends Action if ($service->getServiceURI(OAUTH_ENDPOINT_REQUEST) == common_local_url('requesttoken') || User::staticGet('uri', $service->getRemoteUserURI())) { - $this->showForm(_('That’s a local profile! Login to subscribe.')); + $this->showForm(_('That is a local profile! Login to subscribe.')); return; } try { $service->requestToken(); } catch (OMB_RemoteServiceException $e) { - $this->showForm(_('Couldn’t get a request token.')); + $this->showForm(_('Could not get a request token.')); return; } @@ -204,4 +203,3 @@ class RemotesubscribeAction extends Action common_redirect($target_url, 303); } } -?> diff --git a/actions/repeat.php b/actions/repeat.php index 893cae4ffd..60b238f3a7 100644 --- a/actions/repeat.php +++ b/actions/repeat.php @@ -41,7 +41,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://status.net/ */ - class RepeatAction extends Action { var $user = null; @@ -73,7 +72,7 @@ class RepeatAction extends Action } if ($this->user->id == $this->notice->profile_id) { - $this->clientError(_("You can't repeat your own notice.")); + $this->clientError(_("You cannot repeat your own notice.")); return false; } @@ -101,7 +100,6 @@ class RepeatAction extends Action * * @return void */ - function handle($args) { $repeat = $this->notice->repeat($this->user->id, 'web'); diff --git a/actions/smssettings.php b/actions/smssettings.php index 6af1872a0e..e672b6d8af 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -44,7 +44,6 @@ require_once INSTALLDIR.'/lib/connectsettingsaction.php'; * * @see SettingsAction */ - class SmssettingsAction extends ConnectSettingsAction { /** @@ -52,7 +51,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return string Title of the page */ - function title() { // TRANS: Title for SMS settings. @@ -64,7 +62,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return instructions for use */ - function getInstructions() { // XXX: For consistency of parameters in messages, this should be a @@ -88,7 +85,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return void */ - function showContent() { if (!common_config('sms', 'enabled')) { @@ -219,7 +215,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @todo very similar to EmailsettingsAction::getConfirmation(); refactor? */ - function getConfirmation() { $user = common_current_user(); @@ -246,7 +241,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return void */ - function handlePost() { // CSRF protection @@ -285,7 +279,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return void */ - function savePreferences() { $smsnotify = $this->boolean('smsnotify'); @@ -305,7 +298,7 @@ class SmssettingsAction extends ConnectSettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error updating SMS preferences. - $this->serverError(_('Couldn\'t update user.')); + $this->serverError(_('Could not update user.')); return; } @@ -323,7 +316,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return void */ - function addAddress() { $user = common_current_user(); @@ -370,7 +362,7 @@ class SmssettingsAction extends ConnectSettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); // TRANS: Server error thrown on database error adding SMS confirmation code. - $this->serverError(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Could not insert confirmation code.')); return; } @@ -395,7 +387,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return void */ - function cancelConfirmation() { $sms = $this->trimmed('sms'); @@ -419,7 +410,7 @@ class SmssettingsAction extends ConnectSettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); // TRANS: Server error thrown on database error canceling SMS phone number confirmation. - $this->serverError(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Could not delete email confirmation.')); return; } @@ -432,7 +423,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return void */ - function removeAddress() { $user = common_current_user(); @@ -461,7 +451,7 @@ class SmssettingsAction extends ConnectSettingsAction if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); // TRANS: Server error thrown on database error removing a registered SMS phone number. - $this->serverError(_('Couldn\'t update user.')); + $this->serverError(_('Could not update user.')); return; } $user->query('COMMIT'); @@ -479,7 +469,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return boolean does the number exist */ - function smsExists($sms) { $user = common_current_user(); @@ -498,7 +487,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return void */ - function carrierSelect() { $carrier = new Sms_carrier(); @@ -538,7 +526,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return void */ - function confirmCode() { $code = $this->trimmed('code'); @@ -559,7 +546,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @return void */ - function removeIncoming() { $user = common_current_user(); @@ -575,7 +561,7 @@ class SmssettingsAction extends ConnectSettingsAction if (!$user->updateKeys($orig)) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->serverError(_("Couldn't update user record.")); + $this->serverError(_("Could not update user record.")); } $this->showForm(_('Incoming email address removed.'), true); @@ -588,7 +574,6 @@ class SmssettingsAction extends ConnectSettingsAction * * @see Emailsettings::newIncoming */ - function newIncoming() { $user = common_current_user(); @@ -599,7 +584,7 @@ class SmssettingsAction extends ConnectSettingsAction if (!$user->updateKeys($orig)) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->serverError(_("Couldn't update user record.")); + $this->serverError(_("Could not update user record.")); } $this->showForm(_('New incoming email address added.'), true); diff --git a/actions/userdesignsettings.php b/actions/userdesignsettings.php index 1cf8780006..b82dea8dd6 100644 --- a/actions/userdesignsettings.php +++ b/actions/userdesignsettings.php @@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/designsettings.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class UserDesignSettingsAction extends DesignSettingsAction { /** @@ -70,7 +69,6 @@ class UserDesignSettingsAction extends DesignSettingsAction * * @return string Title of the page */ - function title() { return _('Profile design'); @@ -81,7 +79,6 @@ class UserDesignSettingsAction extends DesignSettingsAction * * @return instructions for use */ - function getInstructions() { return _('Customize the way your profile looks ' . @@ -93,7 +90,6 @@ class UserDesignSettingsAction extends DesignSettingsAction * * @return Design */ - function getWorkingDesign() { $user = common_current_user(); @@ -108,7 +104,6 @@ class UserDesignSettingsAction extends DesignSettingsAction * * @return void */ - function showContent() { $design = $this->getWorkingDesign(); @@ -125,7 +120,6 @@ class UserDesignSettingsAction extends DesignSettingsAction * * @return void */ - function saveDesign() { foreach ($this->args as $key => $val) { @@ -168,7 +162,6 @@ class UserDesignSettingsAction extends DesignSettingsAction $design = $user->getDesign(); if (!empty($design)) { - $original = clone($design); $design->backgroundcolor = $bgcolor->intValue(); @@ -183,13 +176,11 @@ class UserDesignSettingsAction extends DesignSettingsAction if ($result === false) { common_log_db_error($design, 'UPDATE', __FILE__); - $this->showForm(_('Couldn\'t update your design.')); + $this->showForm(_('Could not update your design.')); return; } - // update design } else { - $user->query('BEGIN'); // save new design @@ -236,7 +227,6 @@ class UserDesignSettingsAction extends DesignSettingsAction * * @return nothing */ - function sethd() { @@ -281,5 +271,4 @@ class UserDesignSettingsAction extends DesignSettingsAction $this->showForm(_('Enjoy your hotdog!'), true); } - }