X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fusergroups.php;h=6606e76cdb907c641bf8594dbf4fb34c66111e17;hb=1fdc72f5956f00c736f7761aead4abd8da192eda;hp=97faabae65ad9cd7f02ab1c5cc0cba3d04a21fa1;hpb=5e1a9ad04d4e10ee44881a26ea72c9a80f748188;p=quix0rs-gnu-social.git diff --git a/actions/usergroups.php b/actions/usergroups.php index 97faabae65..6606e76cdb 100644 --- a/actions/usergroups.php +++ b/actions/usergroups.php @@ -59,8 +59,10 @@ class UsergroupsAction extends OwnerDesignAction function title() { if ($this->page == 1) { + // TRANS: Message is used as a page title. %s is a nick name. return sprintf(_('%s groups'), $this->user->nickname); } else { + // TRANS: Message is used as a page title. %1$s is a nick name, %2$d is a page number. return sprintf(_('%1$s groups, page %2$d'), $this->user->nickname, $this->page); @@ -130,22 +132,26 @@ class UsergroupsAction extends OwnerDesignAction _('Search for more groups')); $this->elementEnd('p'); - $offset = ($this->page-1) * GROUPS_PER_PAGE; - $limit = GROUPS_PER_PAGE + 1; + if (Event::handle('StartShowUserGroupsContent', array($this))) { + $offset = ($this->page-1) * GROUPS_PER_PAGE; + $limit = GROUPS_PER_PAGE + 1; - $groups = $this->user->getGroups($offset, $limit); + $groups = $this->user->getGroups($offset, $limit); - if ($groups) { - $gl = new GroupList($groups, $this->user, $this); - $cnt = $gl->show(); - if (0 == $cnt) { - $this->showEmptyListMessage(); + if ($groups) { + $gl = new GroupList($groups, $this->user, $this); + $cnt = $gl->show(); + if (0 == $cnt) { + $this->showEmptyListMessage(); + } } - } - $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE, - $this->page, 'usergroups', - array('nickname' => $this->user->nickname)); + $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE, + $this->page, 'usergroups', + array('nickname' => $this->user->nickname)); + + Event::handle('EndShowUserGroupsContent', array($this)); + } } function showEmptyListMessage()