X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FGroupPrivateMessage%2Fshowgroupmessage.php;h=a0ec4198c43376d30c58409bddd572679efdd711;hb=6d5b6d98b5f68d784fee736518eaaae7a26a51f6;hp=828b6765488591f37108381b42ecbb7f8ff30317;hpb=14456cbbb2b8f9266eb5ca13acff77e6b6699ac2;p=quix0rs-gnu-social.git diff --git a/plugins/GroupPrivateMessage/showgroupmessage.php b/plugins/GroupPrivateMessage/showgroupmessage.php index 828b676548..a0ec4198c4 100644 --- a/plugins/GroupPrivateMessage/showgroupmessage.php +++ b/plugins/GroupPrivateMessage/showgroupmessage.php @@ -4,7 +4,7 @@ * 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 @@ -44,7 +44,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class ShowgroupmessageAction extends Action { var $gm; @@ -59,7 +58,6 @@ class ShowgroupmessageAction extends Action * * @return boolean true */ - function prepare($argarray) { parent::prepare($argarray); @@ -67,6 +65,7 @@ class ShowgroupmessageAction extends Action $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); } @@ -76,22 +75,26 @@ class ShowgroupmessageAction extends Action $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.')); } @@ -105,7 +108,6 @@ class ShowgroupmessageAction extends Action * * @return void */ - function handle($argarray=null) { $this->showPage(); @@ -114,9 +116,10 @@ class ShowgroupmessageAction extends Action /** * 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, @@ -126,7 +129,6 @@ class ShowgroupmessageAction extends Action /** * Show the content area. */ - function showContent() { $this->elementStart('ul', 'notices messages'); @@ -144,7 +146,6 @@ class ShowgroupmessageAction extends Action * * @return boolean is read only action? */ - function isReadOnly($args) { return true;