- $this->elementStart('p', array('id' => 'new_group'));
- $this->element('a', array('href' => common_local_url('newgroup'),
- 'class' => 'more'),
- _('Create a new group'));
- $this->elementEnd('p');
-
- $this->elementStart('p', array('id' => 'group_search'));
- $this->element('a', array('href' => common_local_url('groupsearch'),
- 'class' => 'more'),
- _('Search for more groups'));
- $this->elementEnd('p');
-
- $offset = ($this->page-1) * GROUPS_PER_PAGE;
- $limit = GROUPS_PER_PAGE + 1;
-
- $groups = $this->user->getGroups($offset, $limit);
-
- if ($groups) {
- $gl = new GroupList($groups, $this->user, $this);
- $cnt = $gl->show();
- if (0 == $cnt) {
- $this->showEmptyListMessage();
+ if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) {
+ $notice =
+ // TRANS: Page notice of user's groups page.
+ // TRANS: %%%%action.groupsearch%%%% and %%%%action.newgroup%%%% are URLs. Do not change them.
+ // TRANS: This message contains Markdown links in the form [link text](link).
+ sprintf(_('Groups let you find and talk with ' .
+ 'people of similar interests. ' .
+ 'You can [search for groups](%%%%action.groups%%%%) in your instance or ' .
+ '[create a new group](%%%%action.newgroup%%%%). ' .
+ 'You can also follow groups ' .
+ 'from other GNU social instances: click on the remote button below ' .
+ 'and copy the group\'s link. ' .
+ 'You can find a list of GNU social groups [here](http://skilledtests.com/wiki/List_of_federated_GNU_social_groups)' .
+ ''));
+ $this->elementStart('div', 'instructions');
+ $this->raw(common_markup_to_html($notice));
+ $this->elementEnd('div');
+ }
+
+ if (Event::handle('StartShowUserGroupsContent', array($this))) {
+ $offset = ($this->page-1) * GROUPS_PER_PAGE;
+ $limit = GROUPS_PER_PAGE + 1;
+
+ $groups = $this->getTarget()->getGroups($offset, $limit);
+
+ if ($groups instanceof User_group) {
+ $gl = new GroupList($groups, $this->getTarget(), $this);
+ $cnt = $gl->show();
+ if (0 == $cnt) {
+ $this->showEmptyListMessage();
+ } else {
+ $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE,
+ $this->page, 'usergroups',
+ array('nickname' => $this->getTarget()->getNickname()));
+ }