Added event hooks for before and after user groups content
This commit is contained in:
parent
c82efb7fd8
commit
2ce9ae004d
|
@ -778,6 +778,12 @@ StartShowSubscriptionsContent: before showing the subscriptions content
|
||||||
EndShowSubscriptionsContent: after showing the subscriptions content
|
EndShowSubscriptionsContent: after showing the subscriptions content
|
||||||
- $action: the current action
|
- $action: the current action
|
||||||
|
|
||||||
|
StartShowUserGroupsContent: before showing the user groups content
|
||||||
|
- $action: the current action
|
||||||
|
|
||||||
|
EndShowUserGroupsContent: after showing the user groups content
|
||||||
|
- $action: the current action
|
||||||
|
|
||||||
StartShowAllContent: before showing the all (you and friends) content
|
StartShowAllContent: before showing the all (you and friends) content
|
||||||
- $action: the current action
|
- $action: the current action
|
||||||
|
|
||||||
|
|
|
@ -130,22 +130,26 @@ class UsergroupsAction extends OwnerDesignAction
|
||||||
_('Search for more groups'));
|
_('Search for more groups'));
|
||||||
$this->elementEnd('p');
|
$this->elementEnd('p');
|
||||||
|
|
||||||
$offset = ($this->page-1) * GROUPS_PER_PAGE;
|
if (Event::handle('StartShowUserGroupsContent', array($this))) {
|
||||||
$limit = GROUPS_PER_PAGE + 1;
|
$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) {
|
if ($groups) {
|
||||||
$gl = new GroupList($groups, $this->user, $this);
|
$gl = new GroupList($groups, $this->user, $this);
|
||||||
$cnt = $gl->show();
|
$cnt = $gl->show();
|
||||||
if (0 == $cnt) {
|
if (0 == $cnt) {
|
||||||
$this->showEmptyListMessage();
|
$this->showEmptyListMessage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE,
|
$this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE,
|
||||||
$this->page, 'usergroups',
|
$this->page, 'usergroups',
|
||||||
array('nickname' => $this->user->nickname));
|
array('nickname' => $this->user->nickname));
|
||||||
|
|
||||||
|
Event::handle('EndShowUserGroupsContent', array($this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showEmptyListMessage()
|
function showEmptyListMessage()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user