X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fgroupqueue.php;h=c50eff36f83c5bc9279bacdc5d3095db15000ec0;hb=cd3cff451f2ac12ebe1b98c6ab643a0e4e931599;hp=687fa0b9732a20616639478e6372c20f2d78970d;hpb=942887ca8ce29f2cbb487d884a328d7fbbba2566;p=quix0rs-gnu-social.git diff --git a/actions/groupqueue.php b/actions/groupqueue.php index 687fa0b973..c50eff36f8 100644 --- a/actions/groupqueue.php +++ b/actions/groupqueue.php @@ -43,7 +43,7 @@ require_once INSTALLDIR.'/lib/publicgroupnav.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -class GroupqueueAction extends GroupDesignAction +class GroupqueueAction extends GroupAction { var $page = null; @@ -52,8 +52,8 @@ class GroupqueueAction extends GroupDesignAction return true; } - // fixme most of this belongs in a base class, sounds common to most group actions? - function prepare($args) + // @todo FIXME: most of this belongs in a base class, sounds common to most group actions? + protected function prepare(array $args=array()) { parent::prepare($args); $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; @@ -69,35 +69,31 @@ class GroupqueueAction extends GroupDesignAction $args['page'] = $this->page; } common_redirect(common_local_url('groupqueue', $args), 301); - return false; } if (!$nickname) { // TRANS: Client error displayed when trying to view group members without providing a group nickname. $this->clientError(_('No nickname.'), 404); - return false; } - $local = Local_group::staticGet('nickname', $nickname); + $local = Local_group::getKV('nickname', $nickname); if (!$local) { // TRANS: Client error displayed when trying to view group members for a non-existing group. $this->clientError(_('No such group.'), 404); - return false; } - $this->group = User_group::staticGet('id', $local->group_id); + $this->group = User_group::getKV('id', $local->group_id); if (!$this->group) { // TRANS: Client error displayed when trying to view group members for an object that is not a group. $this->clientError(_('No such group.'), 404); - return false; } $cur = common_current_user(); if (!$cur || !$cur->isAdmin($this->group)) { + // TRANS: Client error displayed when trying to approve group applicants without being a group administrator. $this->clientError(_('Only the group admin may approve users.')); - return false; } return true; } @@ -105,12 +101,12 @@ class GroupqueueAction extends GroupDesignAction function title() { if ($this->page == 1) { - // TRANS: Title of the page showing pending group members still awaiting approval to join the group. + // TRANS: Title of the first page showing pending group members still awaiting approval to join the group. // TRANS: %s is the name of the group. return sprintf(_('%s group members awaiting approval'), $this->group->nickname); } else { - // TRANS: Title of the page showing pending group members still awaiting approval to join the group. + // TRANS: Title of all but the first page showing pending group members still awaiting approval to join the group. // TRANS: %1$s is the name of the group, %2$d is the page number of the members list. return sprintf(_('%1$s group members awaiting approval, page %2$d'), $this->group->nickname, @@ -118,9 +114,9 @@ class GroupqueueAction extends GroupDesignAction } } - function handle($args) + protected function handle() { - parent::handle($args); + parent::handle(); $this->showPage(); } @@ -131,12 +127,6 @@ class GroupqueueAction extends GroupDesignAction _('A list of users awaiting approval to join this group.')); } - function showObjectNav() - { - $nav = new GroupNav($this, $this->group); - $nav->show(); - } - function showContent() { $offset = ($this->page-1) * PROFILES_PER_PAGE; @@ -155,11 +145,12 @@ class GroupqueueAction extends GroupDesignAction $members->free(); $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE, - $this->page, 'groupmembers', + $this->page, 'groupqueue', array('nickname' => $this->group->nickname)); } } +// @todo FIXME: documentation missing. class GroupQueueList extends GroupMemberList { function newListItem($profile) @@ -168,32 +159,24 @@ class GroupQueueList extends GroupMemberList } } +// @todo FIXME: documentation missing. class GroupQueueListItem extends GroupMemberListItem { function showActions() { $this->startActions(); if (Event::handle('StartProfileListItemActionElements', array($this))) { - $this->showApproveButton(); - $this->showCancelButton(); + $this->showApproveButtons(); Event::handle('EndProfileListItemActionElements', array($this)); } $this->endActions(); } - function showApproveButton() + function showApproveButtons() { - $this->out->elementStart('li', 'entity_join'); + $this->out->elementStart('li', 'entity_approval'); $form = new ApproveGroupForm($this->out, $this->group, $this->profile); $form->show(); $this->out->elementEnd('li'); } - - function showCancelButton() - { - $this->out->elementStart('li', 'entity_leave'); - $bf = new CancelGroupForm($this->out, $this->group, $this->profile); - $bf->show(); - $this->out->elementEnd('li'); - } }