X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FGroupPrivateMessage%2Fgroupinbox.php;h=84952d0b062cf116e73deb6fe815055de8ba13e0;hb=b6cfcfbcaa0459b39c5d581c103bfa031b2e02cd;hp=e1c4fc996dee8f8e086b7cf34cafc2df484b6a9d;hpb=36b331d469b6dcd1101783f21265f7be624bc58f;p=quix0rs-gnu-social.git diff --git a/plugins/GroupPrivateMessage/groupinbox.php b/plugins/GroupPrivateMessage/groupinbox.php index e1c4fc996d..84952d0b06 100644 --- a/plugins/GroupPrivateMessage/groupinbox.php +++ b/plugins/GroupPrivateMessage/groupinbox.php @@ -4,7 +4,7 @@ * Copyright (C) 2011, StatusNet, Inc. * * List of private messages to this group - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -44,8 +44,7 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - -class GroupinboxAction extends GroupDesignAction +class GroupinboxAction extends GroupAction { var $gm; @@ -63,6 +62,7 @@ class GroupinboxAction extends GroupDesignAction $cur = common_current_user(); if (empty($cur)) { + // TRANS: Client exception thrown when trying to view group inbox while not logged in. throw new ClientException(_m('Only for logged-in users.'), 403); } @@ -76,19 +76,22 @@ class GroupinboxAction extends GroupDesignAction return false; } - $localGroup = Local_group::staticGet('nickname', $nickname); + $localGroup = Local_group::getKV('nickname', $nickname); if (empty($localGroup)) { + // TRANS: Client exception thrown when trying to view group inbox for non-existing group. throw new ClientException(_m('No such group.'), 404); } - $this->group = User_group::staticGet('id', $localGroup->group_id); + $this->group = User_group::getKV('id', $localGroup->group_id); if (empty($this->group)) { + // TRANS: Client exception thrown when trying to view group inbox for non-existing group. throw new ClientException(_m('No such group.'), 404); } if (!$cur->isMember($this->group)) { + // TRANS: Client exception thrown when trying to view group inbox while not a member. throw new ClientException(_m('Only for members.'), 403); } @@ -97,8 +100,8 @@ class GroupinboxAction extends GroupDesignAction if (!$this->page) { $this->page = 1; } - - $this->gm = Group_message::forGroup($this->group, + + $this->gm = Group_message::forGroup($this->group, ($this->page - 1) * MESSAGES_PER_PAGE, MESSAGES_PER_PAGE + 1); return true; @@ -122,6 +125,7 @@ class GroupinboxAction extends GroupDesignAction $cnt = $gml->show(); if ($cnt == 0) { + // TRANS: Text of group inbox if no private messages were sent to it. $this->element('p', 'guide', _m('This group has not received any private messages.')); } $this->pagination($this->page > 1, @@ -167,6 +171,7 @@ class GroupinboxAction extends GroupDesignAction $base = $this->group->getFancyName(); if ($this->page == 1) { + // TRANS: Title of inbox for group %s. return sprintf(_m('%s group inbox'), $base); } else { // TRANS: Page title for any but first group page. @@ -184,7 +189,6 @@ class GroupinboxAction extends GroupDesignAction * * @return void */ - function showPageNotice() { $instr = $this->getInstructions();