* 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
* @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;
*
* @return boolean true
*/
-
function prepare($argarray)
{
parent::prepare($argarray);
$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;
$this->_faves = Fave::byProfile($this->_profile->id,
$offset,
$limit);
-
+
return true;
}
*
* @return void
*/
-
function handle($argarray=null)
{
parent::handle($argarray);
$this->addFavorite();
break;
default:
+ // TRANS: Client exception thrown when using an unsupported HTTP method.
throw new ClientException(_('HTTP method not supported.'), 405);
return;
}
*
* @return void
*/
-
function showFeed()
{
header('Content-Type: application/atom+xml; charset=utf-8');
$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) {
'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'));
*
* @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);
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;
}
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;
}
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.'));
}
'notice_id' => $notice->id));
if (!empty($old)) {
+ // TRANS: Client exception thrown when trying favorite an already favorited notice.
throw new ClientException(_('Already a favorite.'));
}
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
*
* @return string etag http header
*/
-
function etag()
{
return null;
*
* @return boolean true if delete, else false
*/
-
function requiresAuth()
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
*
* @return void
*/
-
function notify($fave, $notice, $user)
{
$other = User::staticGet('id', $notice->profile_id);
* 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
* @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;
*
* @return boolean true
*/
-
function prepare($argarray)
{
parent::prepare($argarray);
$profileId = $this->trimmed('profile');
$this->_profile = Profile::staticGet('id', $profileId);
-
+
if (empty($this->_profile)) {
+ // TRANS: Client exception.
throw new ClientException(_('No such profile.'), 404);
}
$this->_memberships = Group_member::byMember($this->_profile->id,
$offset,
$limit);
-
+
return true;
}
*
* @return void
*/
-
function handle($argarray=null)
{
parent::handle($argarray);
$this->addMembership();
break;
default:
+ // TRANS: Client exception thrown when using an unsupported HTTP method.
throw new ClientException(_('HTTP method not supported.'), 405);
return;
}
*
* @return void
*/
-
function showFeed()
{
header('Content-Type: application/atom+xml; charset=utf-8');
$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) {
'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'));
*
* @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);
$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.'));
}
'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.'));
}
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.'));
}
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
*
* @return string etag http header
*/
-
function etag()
{
return null;
*
* @return boolean true if delete, else false
*/
-
function requiresAuth()
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
* 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
* @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;
*
* @return boolean true
*/
-
function prepare($argarray)
{
parent::prepare($argarray);
$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);
}
'notice_id' => $noticeId));
if (empty($this->_fave)) {
+ // TRANS: Client exception thrown when referencing a non-existing favorite.
throw new ClientException(_('No such favorite.'), 404);
}
*
* @return void
*/
-
function handle($argarray=null)
{
parent::handle($argarray);
$this->deleteFave();
break;
default:
+ // TRANS: Client exception thrown using an unsupported HTTP method.
throw new ClientException(_('HTTP method not supported.'),
405);
}
/**
* Show a single favorite, in ActivityStreams format
- *
+ *
* @return void
*/
-
function showFave()
{
$activity = $this->_fave->asActivity();
/**
* 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);
}
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
*
* @return string last modified http header
*/
-
function lastModified()
{
return max(strtotime($this->_profile->modified),
*
* @return string etag http header
*/
-
function etag()
{
$mtime = strtotime($this->_fave->modified);
*
* @return boolean true if delete, else false
*/
-
function requiresAuth()
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
* 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
* @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;
*
* @return boolean true
*/
-
function prepare($argarray)
{
parent::prepare($argarray);
$profileId = $this->trimmed('profile');
$this->_profile = Profile::staticGet('id', $profileId);
-
+
if (empty($this->_profile)) {
+ // TRANS: Client exception.
throw new ClientException(_('No such profile.'), 404);
}
$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);
}
$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);
}
*
* @return void
*/
-
function handle($argarray=null)
{
switch ($_SERVER['REQUEST_METHOD']) {
$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;
*
* @return void
*/
-
function showMembership()
{
$activity = $this->_membership->asActivity();
{
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);
}
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
*
* @return string etag http header
*/
-
function etag()
{
$ctime = strtotime($this->_membership->created);
*
* @return boolean true if delete, else false
*/
-
function requiresAuth()
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
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);
}
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);
}
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);
}
$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,
* Copyright (C) 2010, StatusNet, Inc.
*
* AtomPub subscription feed
- *
+ *
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
* Subscription feed class for AtomPub
*
* Generates a list of the user's subscriptions
- *
+ *
* @category AtomPub
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
* @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;
*
* @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);
}
*
* @return void
*/
-
function handle($argarray=null)
{
parent::handle($argarray);
$this->addSubscription();
break;
default:
+ // TRANS: Client exception thrown when using an unsupported HTTP method.
$this->clientError(_('HTTP method not supported.'), 405);
return;
}
*
* @return void
*/
-
function showFeed()
{
header('Content-Type: application/atom+xml; charset=utf-8');
$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) {
'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'));
*
* @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);
$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;
}
$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;
}
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
return $_SERVER['REQUEST_METHOD'] != 'POST';
*
* @return string last modified http header
*/
-
function lastModified()
{
return null;
*
* @return string etag http header
*/
-
function etag()
{
return null;
*
* @return boolean true if delete, else false
*/
-
function requiresAuth()
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
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;
}
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;
}
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;
}
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;
}
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');
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.
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.
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;
}
* @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;
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;
}
}
if (!$nickname) {
+ // TRANS: Client error displayed when trying to change group logo settings without having a nickname.
$this->clientError(_('No nickname.'), 404);
return false;
}
}
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;
}
$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;
}
*
* @return string Title of the page
*/
-
function title()
{
+ // TRANS: Title for group logo settings page.
return _('Group logo');
}
*
* @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());
}
*
* @return void
*/
-
function showContent()
{
if ($this->mode == 'crop') {
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;
}
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());
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,
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,
$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');
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());
$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']),
$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']),
'id' => $crop_info));
}
+ // TRANS: Button text for cropping an uploaded group logo.
$this->submit('crop', _('Crop'));
$this->elementEnd('li');
*
* @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;
} else if ($this->arg('crop')) {
$this->cropLogo();
} else {
+ // TRANS: Form validation error message when an unsupported argument is used.
$this->showForm(_('Unexpected form submission.'));
}
}
*
* @return void
*/
-
function uploadLogo()
{
try {
$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);
}
*
* @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;
}
@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.'));
}
}
*
* @see SettingsAction
*/
-
class ImsettingsAction extends ConnectSettingsAction
{
/**
*
* @return string Title of the page
*/
-
function title()
{
// TRANS: Title for instance messaging settings.
*
* @return instructions for use
*/
-
function getInstructions()
{
// TRANS: Instant messaging settings page instructions.
*
* @return void
*/
-
function showContent()
{
if (!common_config('xmpp', 'enabled')) {
}
}
$this->elementEnd('fieldset');
-
+
$this->elementStart('fieldset', array('id' => 'settings_im_preferences'));
// TRANS: Form legend for IM preferences form.
$this->element('legend', null, _('IM preferences'));
*
* @return Confirm_address address object for this user
*/
-
function getConfirmation()
{
$user = common_current_user();
*
* @return void
*/
-
function handlePost()
{
// CSRF protection
*
* @return void
*/
-
function savePreferences()
{
$jabbernotify = $this->boolean('jabbernotify');
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;
}
*
* @return void
*/
-
function addAddress()
{
$user = common_current_user();
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;
}
*
* @return void
*/
-
function cancelConfirmation()
{
$jabber = $this->arg('jabber');
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;
}
*
* @return void
*/
-
function removeAddress()
{
$user = common_current_user();
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');
*
* @return boolean whether the Jabber ID exists
*/
-
function jabberExists($jabber)
{
$user = common_current_user();
* @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
{
*
* @return string instructions
*/
-
function getInstructions()
{
return _('License for this StatusNet site');
*
* @return void
*/
-
function showForm()
{
$form = new LicenseAdminPanelForm($this);
*
* @return void
*/
-
function saveSettings()
{
static $settings = array(
*
* @return nothing
*/
-
function validate(&$values)
{
// Validate license type (shouldn't have to do it, but just in case)
*
* @return int ID of the form
*/
-
function id()
{
return 'licenseadminpanel';
*
* @return string class of the form
*/
-
function formClass()
{
return 'form_settings';
*
* @return void
*/
-
function formActions()
{
$this->out->submit(
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;
}
* @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
{
/**
*
* @return string Title of the page
*/
-
function title()
{
// TRANS: Page title for profile settings.
*
* @return instructions for use
*/
-
function getInstructions()
{
// TRANS: Usage instructions for profile settings.
*
* @return void
*/
-
function showContent()
{
$user = common_current_user();
*
* @return void
*/
-
function handlePost()
{
// CSRF protection
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
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;
}
}
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;
}
}
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;
}
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;
}
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class RemotesubscribeAction extends Action
{
var $nickname;
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;
}
common_redirect($target_url, 303);
}
}
-?>
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class RepeatAction extends Action
{
var $user = null;
}
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;
}
*
* @return void
*/
-
function handle($args)
{
$repeat = $this->notice->repeat($this->user->id, 'web');
*
* @see SettingsAction
*/
-
class SmssettingsAction extends ConnectSettingsAction
{
/**
*
* @return string Title of the page
*/
-
function title()
{
// TRANS: Title for SMS settings.
*
* @return instructions for use
*/
-
function getInstructions()
{
// XXX: For consistency of parameters in messages, this should be a
*
* @return void
*/
-
function showContent()
{
if (!common_config('sms', 'enabled')) {
*
* @todo very similar to EmailsettingsAction::getConfirmation(); refactor?
*/
-
function getConfirmation()
{
$user = common_current_user();
*
* @return void
*/
-
function handlePost()
{
// CSRF protection
*
* @return void
*/
-
function savePreferences()
{
$smsnotify = $this->boolean('smsnotify');
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;
}
*
* @return void
*/
-
function addAddress()
{
$user = common_current_user();
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;
}
*
* @return void
*/
-
function cancelConfirmation()
{
$sms = $this->trimmed('sms');
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;
}
*
* @return void
*/
-
function removeAddress()
{
$user = common_current_user();
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');
*
* @return boolean does the number exist
*/
-
function smsExists($sms)
{
$user = common_current_user();
*
* @return void
*/
-
function carrierSelect()
{
$carrier = new Sms_carrier();
*
* @return void
*/
-
function confirmCode()
{
$code = $this->trimmed('code');
*
* @return void
*/
-
function removeIncoming()
{
$user = common_current_user();
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);
*
* @see Emailsettings::newIncoming
*/
-
function newIncoming()
{
$user = common_current_user();
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);
* @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
{
/**
*
* @return string Title of the page
*/
-
function title()
{
return _('Profile design');
*
* @return instructions for use
*/
-
function getInstructions()
{
return _('Customize the way your profile looks ' .
*
* @return Design
*/
-
function getWorkingDesign()
{
$user = common_current_user();
*
* @return void
*/
-
function showContent()
{
$design = $this->getWorkingDesign();
*
* @return void
*/
-
function saveDesign()
{
foreach ($this->args as $key => $val) {
$design = $user->getDesign();
if (!empty($design)) {
-
$original = clone($design);
$design->backgroundcolor = $bgcolor->intValue();
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
*
* @return nothing
*/
-
function sethd()
{
$this->showForm(_('Enjoy your hotdog!'), true);
}
-
}