summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-01-21 13:33:06 -0500
committerEvan Prodromou <evan@controlyourself.ca>2009-01-21 13:33:06 -0500
commit32601065372149e652cf287af02361cde4663b3e (patch)
tree0c5dea32fdd057175a5ca403db56d6723c5a7099
parent74a1d8b64a59492dccad14edc939266ed8dd4e3d (diff)
list of groups to profile page
-rw-r--r--actions/showstream.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/actions/showstream.php b/actions/showstream.php
index f9b58a82f..9734c2907 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -35,6 +35,7 @@ if (!defined('LACONICA')) {
require_once INSTALLDIR.'/lib/personalgroupnav.php';
require_once INSTALLDIR.'/lib/noticelist.php';
require_once INSTALLDIR.'/lib/profileminilist.php';
+require_once INSTALLDIR.'/lib/groupminilist.php';
require_once INSTALLDIR.'/lib/feedlist.php';
/**
@@ -385,6 +386,7 @@ class ShowstreamAction extends Action
$this->showStatistics();
$this->showSubscriptions();
$this->showSubscribers();
+ $this->showGroups();
}
function showSubscriptions()
@@ -497,6 +499,35 @@ class ShowstreamAction extends Action
$this->elementEnd('div');
}
+
+ function showGroups()
+ {
+ $groups = $this->user->getGroups(0, GROUPS_PER_MINILIST + 1);
+
+ $this->elementStart('div', array('id' => 'user_groups',
+ 'class' => 'section'));
+
+ $this->element('h2', null, _('Groups'));
+
+ if ($groups) {
+ $gml = new GroupMiniList($groups, $this->user, $this);
+ $cnt = $gml->show();
+ if ($cnt == 0) {
+ $this->element('p', null, _('(None)'));
+ }
+ }
+
+ if ($cnt > GROUPS_PER_MINILIST) {
+ $this->elementStart('p');
+ $this->element('a', array('href' => common_local_url('usergroups',
+ array('nickname' => $this->profile->nickname)),
+ 'class' => 'mores'),
+ _('All groups'));
+ $this->elementEnd('p');
+ }
+
+ $this->elementEnd('div');
+ }
}
// We don't show the author for a profile, since we already know who it is!