summaryrefslogtreecommitdiff
path: root/actions/usergroups.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-07-12 14:21:57 -0700
committerBrion Vibber <brion@pobox.com>2010-07-12 14:21:57 -0700
commitcd29d3d646379aa9a1352035973c8e379cc7f42b (patch)
treee064c5292c546e6df8eaad9609a56150f69c62c3 /actions/usergroups.php
parentbd8506eee883ecd424fdf3d7e545c10c754df6ff (diff)
parent1b3b7f9a422f6b703ec36d43e2283f91a9835f3b (diff)
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'actions/usergroups.php')
-rw-r--r--actions/usergroups.php30
1 files changed, 18 insertions, 12 deletions
diff --git a/actions/usergroups.php b/actions/usergroups.php
index 97faabae6..6606e76cd 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()