2 // @todo FIXME: add documentation.
4 class GroupMemberListItem extends ProfileListItem
8 function __construct($profile, $group, $action)
10 parent::__construct($profile, $action);
12 $this->group = $group;
15 function showFullName()
17 parent::showFullName();
18 if ($this->profile->isAdmin($this->group)) {
19 $this->out->text(' '); // for separating the classes.
20 // TRANS: Indicator in group members list that this user is a group administrator.
21 $this->out->element('span', 'role', _m('GROUPADMIN','Admin'));
25 function showActions()
27 $this->startActions();
28 if (Event::handle('StartProfileListItemActionElements', array($this))) {
29 $this->showSubscribeButton();
30 $this->showMakeAdminForm();
31 $this->showGroupBlockForm();
32 Event::handle('EndProfileListItemActionElements', array($this));
37 function showMakeAdminForm()
39 $user = common_current_user();
42 $user->id != $this->profile->id &&
43 ($user->isAdmin($this->group) || $user->hasRight(Right::MAKEGROUPADMIN)) &&
44 !$this->profile->isAdmin($this->group)) {
45 $this->out->elementStart('li', 'entity_make_admin');
46 $maf = new MakeAdminForm($this->out, $this->profile, $this->group,
47 $this->returnToArgs());
49 $this->out->elementEnd('li');
54 function showGroupBlockForm()
56 $user = common_current_user();
58 if (!empty($user) && $user->id != $this->profile->id && $user->isAdmin($this->group)) {
59 $this->out->elementStart('li', 'entity_block');
60 $bf = new GroupBlockForm($this->out, $this->profile, $this->group,
61 $this->returnToArgs());
63 $this->out->elementEnd('li');
67 function linkAttributes()
69 $aAttrs = parent::linkAttributes();
71 if (common_config('nofollow', 'members')) {
72 $aAttrs['rel'] .= ' nofollow';
78 function homepageAttributes()
80 $aAttrs = parent::linkAttributes();
82 if (common_config('nofollow', 'members')) {
83 $aAttrs['rel'] = 'nofollow';
90 * Fetch necessary return-to arguments for the profile forms
91 * to return to this list when they're done.
95 protected function returnToArgs()
97 $args = array('action' => 'groupmembers',
98 'nickname' => $this->group->nickname);
99 $page = $this->out->arg('page');
101 $args['param-page'] = $page;