forked from GNUsocial/gnu-social
@evan Fixed message domain for messages in plugins for recent commits.
Numbered parameters when more than one used in a message. L10n updates for consistency. i18n for non-translatable exception. Updated translator documentation. Removed superfluous whitespace.
This commit is contained in:
parent
880661de4e
commit
0a19674c9f
@ -89,6 +89,7 @@ class ApiStatusesRetweetAction extends ApiAuthAction
|
|||||||
|
|
||||||
if ($this->original->scope != Notice::SITE_SCOPE &&
|
if ($this->original->scope != Notice::SITE_SCOPE &&
|
||||||
$this->original->scope != Notice::PUBLIC_SCOPE) {
|
$this->original->scope != Notice::PUBLIC_SCOPE) {
|
||||||
|
// TRANS: Client error displayed when trying to repeat a private notice.
|
||||||
$this->clientError(_('You may not repeat a private notice.'),
|
$this->clientError(_('You may not repeat a private notice.'),
|
||||||
403,
|
403,
|
||||||
$this->format);
|
$this->format);
|
||||||
@ -100,6 +101,7 @@ class ApiStatusesRetweetAction extends ApiAuthAction
|
|||||||
// Can the profile actually see that notice?
|
// Can the profile actually see that notice?
|
||||||
|
|
||||||
if (!$this->original->inScope($profile)) {
|
if (!$this->original->inScope($profile)) {
|
||||||
|
// TRANS: Client error displayed when trying to repeat a notice the user has no access to.
|
||||||
$this->clientError(_('No access to that notice.'),
|
$this->clientError(_('No access to that notice.'),
|
||||||
403,
|
403,
|
||||||
$this->format);
|
$this->format);
|
||||||
|
@ -531,7 +531,7 @@ class RegisterAction extends Action
|
|||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
}
|
}
|
||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
// TRANS: Botton text to register a user on account registration page.
|
// TRANS: Button text to register a user on account registration page.
|
||||||
$this->submit('submit', _m('BUTTON','Register'));
|
$this->submit('submit', _m('BUTTON','Register'));
|
||||||
$this->elementEnd('fieldset');
|
$this->elementEnd('fieldset');
|
||||||
$this->elementEnd('form');
|
$this->elementEnd('form');
|
||||||
|
@ -77,6 +77,7 @@ class RepeatAction extends Action
|
|||||||
|
|
||||||
if ($this->notice->scope != Notice::SITE_SCOPE &&
|
if ($this->notice->scope != Notice::SITE_SCOPE &&
|
||||||
$this->notice->scope != Notice::PUBLIC_SCOPE) {
|
$this->notice->scope != Notice::PUBLIC_SCOPE) {
|
||||||
|
// TRANS: Client error displayed when trying to repeat a private notice.
|
||||||
$this->clientError(_('You may not repeat a private notice.'),
|
$this->clientError(_('You may not repeat a private notice.'),
|
||||||
403);
|
403);
|
||||||
}
|
}
|
||||||
@ -99,6 +100,7 @@ class RepeatAction extends Action
|
|||||||
// Can the profile actually see that notice?
|
// Can the profile actually see that notice?
|
||||||
|
|
||||||
if (!$this->notice->inScope($profile)) {
|
if (!$this->notice->inScope($profile)) {
|
||||||
|
// TRANS: Client error displayed when trying to repeat a notice the user has no access to.
|
||||||
$this->clientError(_('No access to that notice.'), 403);
|
$this->clientError(_('No access to that notice.'), 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,6 +103,7 @@ class ShownoticeAction extends OwnerDesignAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->notice->inScope($curProfile)) {
|
if (!$this->notice->inScope($curProfile)) {
|
||||||
|
// TRANS: Client exception thrown when trying a view a notice the user has no access to.
|
||||||
throw new ClientException(_('Not available.'), 403);
|
throw new ClientException(_('Not available.'), 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,6 +353,7 @@ class Notice extends Memcached_DataObject
|
|||||||
if (!empty($repeat) &&
|
if (!empty($repeat) &&
|
||||||
$repeat->scope != Notice::SITE_SCOPE &&
|
$repeat->scope != Notice::SITE_SCOPE &&
|
||||||
$repeat->scope != Notice::PUBLIC_SCOPE) {
|
$repeat->scope != Notice::PUBLIC_SCOPE) {
|
||||||
|
// TRANS: Client exception thrown when trying to repeat a private notice.
|
||||||
throw new ClientException(_('Cannot repeat a private notice.'), 403);
|
throw new ClientException(_('Cannot repeat a private notice.'), 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,7 +367,9 @@ class Notice extends Memcached_DataObject
|
|||||||
if (!empty($notice->reply_to)) {
|
if (!empty($notice->reply_to)) {
|
||||||
$reply = Notice::staticGet('id', $notice->reply_to);
|
$reply = Notice::staticGet('id', $notice->reply_to);
|
||||||
if (!$reply->inScope($profile)) {
|
if (!$reply->inScope($profile)) {
|
||||||
throw new ClientException(sprintf(_("%s has no access to notice %d"),
|
// TRANS: Client error displayed when trying to reply to a notice a the target has no access to.
|
||||||
|
// TRANS: %1$s is a user nickname, %2$d is a notice ID (number).
|
||||||
|
throw new ClientException(sprintf(_('%1$s has no access to notice %2$d.'),
|
||||||
$profile->nickname, $reply->id), 403);
|
$profile->nickname, $reply->id), 403);
|
||||||
}
|
}
|
||||||
$notice->conversation = $reply->conversation;
|
$notice->conversation = $reply->conversation;
|
||||||
@ -2063,7 +2066,6 @@ class Notice extends Memcached_DataObject
|
|||||||
*
|
*
|
||||||
* @return boolean whether the profile is in the notice's scope
|
* @return boolean whether the profile is in the notice's scope
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function inScope($profile)
|
function inScope($profile)
|
||||||
{
|
{
|
||||||
// If there's no scope, anyone (even anon) is in scope.
|
// If there's no scope, anyone (even anon) is in scope.
|
||||||
|
@ -548,6 +548,7 @@ class RepeatCommand extends Command
|
|||||||
|
|
||||||
if ($notice->scope != Notice::SITE_SCOPE &&
|
if ($notice->scope != Notice::SITE_SCOPE &&
|
||||||
$notice->scope != Notice::PUBLIC_SCOPE) {
|
$notice->scope != Notice::PUBLIC_SCOPE) {
|
||||||
|
// TRANS: Client error displayed when trying to repeat a private notice.
|
||||||
$channel->error($this->user, _('You may not repeat a private notice.'));
|
$channel->error($this->user, _('You may not repeat a private notice.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -556,6 +557,7 @@ class RepeatCommand extends Command
|
|||||||
// Can the profile actually see that notice?
|
// Can the profile actually see that notice?
|
||||||
|
|
||||||
if (!$notice->inScope($profile)) {
|
if (!$notice->inScope($profile)) {
|
||||||
|
// TRANS: Client error displayed when trying to repeat a notice the user has no access to.
|
||||||
$channel->error($this->user, _('You have no access to that notice.'));
|
$channel->error($this->user, _('You have no access to that notice.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ConversationNoticeStream extends ScopingNoticeStream
|
class ConversationNoticeStream extends ScopingNoticeStream
|
||||||
{
|
{
|
||||||
function __construct($id)
|
function __construct($id)
|
||||||
@ -64,7 +63,6 @@ class ConversationNoticeStream extends ScopingNoticeStream
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class RawConversationNoticeStream extends NoticeStream
|
class RawConversationNoticeStream extends NoticeStream
|
||||||
{
|
{
|
||||||
protected $id;
|
protected $id;
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class FaveNoticeStream extends ScopingNoticeStream
|
class FaveNoticeStream extends ScopingNoticeStream
|
||||||
{
|
{
|
||||||
function __construct($user_id, $own)
|
function __construct($user_id, $own)
|
||||||
@ -69,7 +68,6 @@ class FaveNoticeStream extends ScopingNoticeStream
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class RawFaveNoticeStream extends NoticeStream
|
class RawFaveNoticeStream extends NoticeStream
|
||||||
{
|
{
|
||||||
protected $user_id;
|
protected $user_id;
|
||||||
|
@ -51,19 +51,15 @@ if (!defined('STATUSNET')) {
|
|||||||
* @see NoticeList
|
* @see NoticeList
|
||||||
* @see ProfileNoticeListItem
|
* @see ProfileNoticeListItem
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class NoticeListItem extends Widget
|
class NoticeListItem extends Widget
|
||||||
{
|
{
|
||||||
/** The notice this item will show. */
|
/** The notice this item will show. */
|
||||||
|
|
||||||
var $notice = null;
|
var $notice = null;
|
||||||
|
|
||||||
/** The notice that was repeated. */
|
/** The notice that was repeated. */
|
||||||
|
|
||||||
var $repeat = null;
|
var $repeat = null;
|
||||||
|
|
||||||
/** The profile of the author of the notice, extracted once for convenience. */
|
/** The profile of the author of the notice, extracted once for convenience. */
|
||||||
|
|
||||||
var $profile = null;
|
var $profile = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,7 +69,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @param Notice $notice The notice we'll display
|
* @param Notice $notice The notice we'll display
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function __construct($notice, $out=null)
|
function __construct($notice, $out=null)
|
||||||
{
|
{
|
||||||
parent::__construct($out);
|
parent::__construct($out);
|
||||||
@ -99,7 +94,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function show()
|
function show()
|
||||||
{
|
{
|
||||||
if (empty($this->notice)) {
|
if (empty($this->notice)) {
|
||||||
@ -165,7 +159,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showStart()
|
function showStart()
|
||||||
{
|
{
|
||||||
if (Event::handle('StartOpenNoticeListItemElement', array($this))) {
|
if (Event::handle('StartOpenNoticeListItemElement', array($this))) {
|
||||||
@ -185,7 +178,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showFaveForm()
|
function showFaveForm()
|
||||||
{
|
{
|
||||||
if (Event::handle('StartShowFaveForm', array($this))) {
|
if (Event::handle('StartShowFaveForm', array($this))) {
|
||||||
@ -210,7 +202,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showAuthor()
|
function showAuthor()
|
||||||
{
|
{
|
||||||
$this->out->elementStart('span', 'vcard author');
|
$this->out->elementStart('span', 'vcard author');
|
||||||
@ -235,7 +226,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showAvatar()
|
function showAvatar()
|
||||||
{
|
{
|
||||||
$avatar_size = $this->avatarSize();
|
$avatar_size = $this->avatarSize();
|
||||||
@ -266,7 +256,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showNickname()
|
function showNickname()
|
||||||
{
|
{
|
||||||
$this->out->raw('<span class="nickname fn">' .
|
$this->out->raw('<span class="nickname fn">' .
|
||||||
@ -283,7 +272,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showContent()
|
function showContent()
|
||||||
{
|
{
|
||||||
// FIXME: URL, image, video, audio
|
// FIXME: URL, image, video, audio
|
||||||
@ -314,7 +302,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showNoticeLink()
|
function showNoticeLink()
|
||||||
{
|
{
|
||||||
$noticeurl = $this->notice->bestUrl();
|
$noticeurl = $this->notice->bestUrl();
|
||||||
@ -342,7 +329,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showNoticeLocation()
|
function showNoticeLocation()
|
||||||
{
|
{
|
||||||
$id = $this->notice->id;
|
$id = $this->notice->id;
|
||||||
@ -423,7 +409,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showNoticeSource()
|
function showNoticeSource()
|
||||||
{
|
{
|
||||||
$ns = $this->notice->getSource();
|
$ns = $this->notice->getSource();
|
||||||
@ -479,7 +464,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showContext()
|
function showContext()
|
||||||
{
|
{
|
||||||
if ($this->notice->hasConversation()) {
|
if ($this->notice->hasConversation()) {
|
||||||
@ -514,7 +498,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showRepeat()
|
function showRepeat()
|
||||||
{
|
{
|
||||||
if (!empty($this->repeat)) {
|
if (!empty($this->repeat)) {
|
||||||
@ -548,7 +531,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showReplyLink()
|
function showReplyLink()
|
||||||
{
|
{
|
||||||
if (common_logged_in()) {
|
if (common_logged_in()) {
|
||||||
@ -570,7 +552,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showDeleteLink()
|
function showDeleteLink()
|
||||||
{
|
{
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
@ -593,7 +574,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showRepeatForm()
|
function showRepeatForm()
|
||||||
{
|
{
|
||||||
if ($this->notice->scope == Notice::PUBLIC_SCOPE ||
|
if ($this->notice->scope == Notice::PUBLIC_SCOPE ||
|
||||||
@ -605,7 +585,9 @@ class NoticeListItem extends Widget
|
|||||||
$profile = $user->getProfile();
|
$profile = $user->getProfile();
|
||||||
if ($profile->hasRepeated($this->notice->id)) {
|
if ($profile->hasRepeated($this->notice->id)) {
|
||||||
$this->out->element('span', array('class' => 'repeated',
|
$this->out->element('span', array('class' => 'repeated',
|
||||||
'title' => _('Notice repeated')),
|
// TRANS: Title for repeat form status in notice list when a notice has been repeated.
|
||||||
|
'title' => _('Notice repeated.')),
|
||||||
|
// TRANS: Repeat form status in notice list when a notice has been repeated.
|
||||||
_('Repeated'));
|
_('Repeated'));
|
||||||
} else {
|
} else {
|
||||||
$rf = new RepeatForm($this->out, $this->notice);
|
$rf = new RepeatForm($this->out, $this->notice);
|
||||||
@ -622,7 +604,6 @@ class NoticeListItem extends Widget
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showEnd()
|
function showEnd()
|
||||||
{
|
{
|
||||||
if (Event::handle('StartCloseNoticeListItemElement', array($this))) {
|
if (Event::handle('StartCloseNoticeListItemElement', array($this))) {
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ToSelector extends Widget
|
class ToSelector extends Widget
|
||||||
{
|
{
|
||||||
protected $user;
|
protected $user;
|
||||||
@ -84,10 +83,13 @@ class ToSelector extends Widget
|
|||||||
$default = 'public:site';
|
$default = 'public:site';
|
||||||
|
|
||||||
if (!common_config('site', 'private')) {
|
if (!common_config('site', 'private')) {
|
||||||
$choices['public:everyone'] = _('Everyone');
|
// TRANS: Option in drop-down of potential addressees.
|
||||||
|
$choices['public:everyone'] = _m('SENDTO','Everyone');
|
||||||
$default = 'public:everyone';
|
$default = 'public:everyone';
|
||||||
}
|
}
|
||||||
// XXX: better name...?
|
// XXX: better name...?
|
||||||
|
// TRANS: Option in drop-down of potential addressees.
|
||||||
|
// TRANS: %s is a StatusNet sitename.
|
||||||
$choices['public:site'] = sprintf(_('My colleagues at %s'), common_config('site', 'name'));
|
$choices['public:site'] = sprintf(_('My colleagues at %s'), common_config('site', 'name'));
|
||||||
|
|
||||||
$groups = $this->user->getGroups();
|
$groups = $this->user->getGroups();
|
||||||
@ -109,13 +111,15 @@ class ToSelector extends Widget
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->out->dropdown($this->id,
|
$this->out->dropdown($this->id,
|
||||||
_('To:'),
|
// TRANS: Label for drop-down of potential addressees.
|
||||||
|
_m('LABEL','To:'),
|
||||||
$choices,
|
$choices,
|
||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
$default);
|
$default);
|
||||||
|
|
||||||
$this->out->checkbox('notice_private',
|
$this->out->checkbox('notice_private',
|
||||||
|
// TRANS: Checkbox label in widget for selecting potential addressees to mark the notice private.
|
||||||
_('Private'),
|
_('Private'),
|
||||||
$this->private);
|
$this->private);
|
||||||
}
|
}
|
||||||
@ -149,7 +153,8 @@ class ToSelector extends Widget
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ClientException('Unknown to value: ' . toArg);
|
// TRANS: Client exception thrown in widget for selecting potential addressees when an invalid fill option was received.
|
||||||
|
throw new ClientException(sprintf(_('Unknown to value: "%s".'),$toArg));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ShowbookmarkAction extends ShownoticeAction
|
class ShowbookmarkAction extends ShownoticeAction
|
||||||
{
|
{
|
||||||
protected $bookmark = null;
|
protected $bookmark = null;
|
||||||
@ -56,7 +55,6 @@ class ShowbookmarkAction extends ShownoticeAction
|
|||||||
*
|
*
|
||||||
* @return boolean true
|
* @return boolean true
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($argarray)
|
function prepare($argarray)
|
||||||
{
|
{
|
||||||
OwnerDesignAction::prepare($argarray);
|
OwnerDesignAction::prepare($argarray);
|
||||||
@ -66,14 +64,16 @@ class ShowbookmarkAction extends ShownoticeAction
|
|||||||
$this->bookmark = Bookmark::staticGet('id', $this->id);
|
$this->bookmark = Bookmark::staticGet('id', $this->id);
|
||||||
|
|
||||||
if (empty($this->bookmark)) {
|
if (empty($this->bookmark)) {
|
||||||
throw new ClientException(_('No such bookmark.'), 404);
|
// TRANS: Client exception thrown when referring to a non-existing bookmark.
|
||||||
|
throw new ClientException(_m('No such bookmark.'), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->notice = Notice::staticGet('uri', $this->bookmark->uri);
|
$this->notice = Notice::staticGet('uri', $this->bookmark->uri);
|
||||||
|
|
||||||
if (empty($this->notice)) {
|
if (empty($this->notice)) {
|
||||||
// Did we used to have it, and it got deleted?
|
// Did we used to have it, and it got deleted?
|
||||||
throw new ClientException(_('No such bookmark.'), 404);
|
// TRANS: Client exception thrown when referring to a non-existing bookmark.
|
||||||
|
throw new ClientException(_m('No such bookmark.'), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($cur)) {
|
if (!empty($cur)) {
|
||||||
@ -83,19 +83,22 @@ class ShowbookmarkAction extends ShownoticeAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->notice->inScope($curProfile)) {
|
if (!$this->notice->inScope($curProfile)) {
|
||||||
throw new ClientException(_('Not available.'), 403);
|
// TRANS: Client exception thrown when referring to a bookmark the user has no access to.
|
||||||
|
throw new ClientException(_m('Not available.'), 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::staticGet('id', $this->bookmark->profile_id);
|
$this->user = User::staticGet('id', $this->bookmark->profile_id);
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
throw new ClientException(_('No such user.'), 404);
|
// TRANS: Client exception thrown when referring to a bookmark for a non-existing user.
|
||||||
|
throw new ClientException(_m('No such user.'), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->profile = $this->user->getProfile();
|
$this->profile = $this->user->getProfile();
|
||||||
|
|
||||||
if (empty($this->profile)) {
|
if (empty($this->profile)) {
|
||||||
throw new ServerException(_('User without a profile.'));
|
// TRANS: Client exception thrown when referring to a bookmark for a non-existing profile.
|
||||||
|
throw new ServerException(_m('User without a profile.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
|
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||||
@ -110,10 +113,11 @@ class ShowbookmarkAction extends ShownoticeAction
|
|||||||
*
|
*
|
||||||
* @return string page tile
|
* @return string page tile
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
return sprintf(_('%s\'s bookmark for "%s"'),
|
// TRANS: Title for bookmark.
|
||||||
|
// TRANS: %1$s is a user nickname, %2$s is a bookmark title.
|
||||||
|
return sprintf(_('%1s$\'s bookmark for "%2$s"'),
|
||||||
$this->user->nickname,
|
$this->user->nickname,
|
||||||
$this->bookmark->title);
|
$this->bookmark->title);
|
||||||
}
|
}
|
||||||
@ -123,7 +127,6 @@ class ShowbookmarkAction extends ShownoticeAction
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showPageTitle()
|
function showPageTitle()
|
||||||
{
|
{
|
||||||
$this->elementStart('h1');
|
$this->elementStart('h1');
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ShoweventAction extends ShownoticeAction
|
class ShoweventAction extends ShownoticeAction
|
||||||
{
|
{
|
||||||
protected $id = null;
|
protected $id = null;
|
||||||
@ -57,7 +56,6 @@ class ShoweventAction extends ShownoticeAction
|
|||||||
*
|
*
|
||||||
* @return boolean true
|
* @return boolean true
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($argarray)
|
function prepare($argarray)
|
||||||
{
|
{
|
||||||
OwnerDesignAction::prepare($argarray);
|
OwnerDesignAction::prepare($argarray);
|
||||||
@ -67,14 +65,16 @@ class ShoweventAction extends ShownoticeAction
|
|||||||
$this->event = Happening::staticGet('id', $this->id);
|
$this->event = Happening::staticGet('id', $this->id);
|
||||||
|
|
||||||
if (empty($this->event)) {
|
if (empty($this->event)) {
|
||||||
throw new ClientException(_('No such event.'), 404);
|
// TRANS: Client exception thrown when referring to a non-existing event.
|
||||||
|
throw new ClientException(_m('No such event.'), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->notice = $this->event->getNotice();
|
$this->notice = $this->event->getNotice();
|
||||||
|
|
||||||
if (empty($this->notice)) {
|
if (empty($this->notice)) {
|
||||||
// Did we used to have it, and it got deleted?
|
// Did we used to have it, and it got deleted?
|
||||||
throw new ClientException(_('No such event.'), 404);
|
// TRANS: Client exception thrown when referring to a non-existing event.
|
||||||
|
throw new ClientException(_m('No such event.'), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
@ -86,19 +86,22 @@ class ShoweventAction extends ShownoticeAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->notice->inScope($curProfile)) {
|
if (!$this->notice->inScope($curProfile)) {
|
||||||
throw new ClientException(_('Not available.'), 403);
|
// TRANS: Client exception thrown when referring to an event the user has no access to.
|
||||||
|
throw new ClientException(_m('Not available.'), 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::staticGet('id', $this->event->profile_id);
|
$this->user = User::staticGet('id', $this->event->profile_id);
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
throw new ClientException(_('No such user.'), 404);
|
// TRANS: Client exception thrown when referring to a non-existing user.
|
||||||
|
throw new ClientException(_m('No such user.'), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->profile = $this->user->getProfile();
|
$this->profile = $this->user->getProfile();
|
||||||
|
|
||||||
if (empty($this->profile)) {
|
if (empty($this->profile)) {
|
||||||
throw new ServerException(_('User without a profile.'));
|
// TRANS: Server exception thrown when referring to a user without a profile.
|
||||||
|
throw new ServerException(_m('User without a profile.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
|
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||||
@ -113,7 +116,6 @@ class ShoweventAction extends ShownoticeAction
|
|||||||
*
|
*
|
||||||
* @return string page tile
|
* @return string page tile
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
return $this->event->title;
|
return $this->event->title;
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ShowrsvpAction extends ShownoticeAction
|
class ShowrsvpAction extends ShownoticeAction
|
||||||
{
|
{
|
||||||
protected $rsvp = null;
|
protected $rsvp = null;
|
||||||
@ -57,7 +56,6 @@ class ShowrsvpAction extends ShownoticeAction
|
|||||||
*
|
*
|
||||||
* @return boolean true
|
* @return boolean true
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($argarray)
|
function prepare($argarray)
|
||||||
{
|
{
|
||||||
OwnerDesignAction::prepare($argarray);
|
OwnerDesignAction::prepare($argarray);
|
||||||
@ -67,20 +65,25 @@ class ShowrsvpAction extends ShownoticeAction
|
|||||||
$this->rsvp = RSVP::staticGet('id', $this->id);
|
$this->rsvp = RSVP::staticGet('id', $this->id);
|
||||||
|
|
||||||
if (empty($this->rsvp)) {
|
if (empty($this->rsvp)) {
|
||||||
throw new ClientException(_('No such RSVP.'), 404);
|
// TRANS: Client exception thrown when referring to a non-existing RSVP.
|
||||||
|
// TRANS: RSVP stands for "Please reply".
|
||||||
|
throw new ClientException(_m('No such RSVP.'), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->event = $this->rsvp->getEvent();
|
$this->event = $this->rsvp->getEvent();
|
||||||
|
|
||||||
if (empty($this->event)) {
|
if (empty($this->event)) {
|
||||||
throw new ClientException(_('No such Event.'), 404);
|
// TRANS: Client exception thrown when referring to a non-existing event.
|
||||||
|
throw new ClientException(_m('No such Event.'), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->notice = $this->rsvp->getNotice();
|
$this->notice = $this->rsvp->getNotice();
|
||||||
|
|
||||||
if (empty($this->notice)) {
|
if (empty($this->notice)) {
|
||||||
// Did we used to have it, and it got deleted?
|
// Did we used to have it, and it got deleted?
|
||||||
throw new ClientException(_('No such RSVP.'), 404);
|
// TRANS: Client exception thrown when referring to a non-existing RSVP.
|
||||||
|
// TRANS: RSVP stands for "Please reply".
|
||||||
|
throw new ClientException(_m('No such RSVP.'), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
@ -92,19 +95,22 @@ class ShowrsvpAction extends ShownoticeAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->notice->inScope($curProfile)) {
|
if (!$this->notice->inScope($curProfile)) {
|
||||||
throw new ClientException(_('Not available.'), 403);
|
// TRANS: Client exception thrown when referring to an event the user has no access to.
|
||||||
|
throw new ClientException(_m('Not available.'), 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::staticGet('id', $this->rsvp->profile_id);
|
$this->user = User::staticGet('id', $this->rsvp->profile_id);
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
throw new ClientException(_('No such user.'), 404);
|
// TRANS: Client exception thrown when referring to a non-existing user.
|
||||||
|
throw new ClientException(_m('No such user.'), 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->profile = $this->user->getProfile();
|
$this->profile = $this->user->getProfile();
|
||||||
|
|
||||||
if (empty($this->profile)) {
|
if (empty($this->profile)) {
|
||||||
throw new ServerException(_('User without a profile.'));
|
// TRANS: Server exception thrown when referring to a user without a profile.
|
||||||
|
throw new ServerException(_m('User without a profile.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
|
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||||
@ -119,10 +125,11 @@ class ShowrsvpAction extends ShownoticeAction
|
|||||||
*
|
*
|
||||||
* @return string page tile
|
* @return string page tile
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
return sprintf(_('%s\'s RSVP for "%s"'),
|
// TRANS: Title for event.
|
||||||
|
// TRANS: %1$s is a user nickname, %2$s is an event title.
|
||||||
|
return sprintf(_('%1$s\'s RSVP for "%2$s"'),
|
||||||
$this->user->nickname,
|
$this->user->nickname,
|
||||||
$this->event->title);
|
$this->event->title);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user