* Copyright (C) 2011, StatusNet, Inc.
*
* Show a single group message
- *
+ *
* 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 ShowgroupmessageAction extends Action
{
var $gm;
*
* @return boolean true
*/
-
function prepare($argarray)
{
parent::prepare($argarray);
$this->user = common_current_user();
if (empty($this->user)) {
+ // TRANS: Client exception thrown when trying to view group private messages without being logged in.
throw new ClientException(_m('Only logged-in users can view private messages.'),
403);
}
$this->gm = Group_message::staticGet('id', $id);
if (empty($this->gm)) {
+ // TRANS: Client exception thrown when trying to view a non-existing group private message.
throw new ClientException(_m('No such message.'), 404);
}
$this->group = User_group::staticGet('id', $this->gm->to_group);
if (empty($this->group)) {
+ // TRANS: Server exception thrown when trying to view group private messages for a non-exsting group.
throw new ServerException(_m('Group not found.'));
}
if (!$this->user->isMember($this->group)) {
+ // TRANS: Client exception thrown when trying to view a group private message without being a group member.
throw new ClientException(_m('Cannot read message.'), 403);
}
$this->sender = Profile::staticGet('id', $this->gm->from_profile);
if (empty($this->sender)) {
+ // TRANS: Server exception thrown when trying to view a group private message without a sender.
throw new ServerException(_m('No sender found.'));
}
*
* @return void
*/
-
function handle($argarray=null)
{
$this->showPage();
/**
* Title of the page
*/
-
function title()
{
+ // TRANS: Title for private group message.
+ // TRANS: %1$s is the sender name, %2$s is the group name, %3$s is a timestamp.
return sprintf(_m('Message from %1$s to group %2$s on %3$s'),
$this->sender->nickname,
$this->group->nickname,
/**
* Show the content area.
*/
-
function showContent()
{
$this->elementStart('ul', 'notices messages');
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
return true;