3 class GroupMemberListItem extends ProfileListItem
7 function __construct($profile, $group, $action)
9 parent::__construct($profile, $action);
11 $this->group = $group;
14 function showFullName()
16 parent::showFullName();
17 if ($this->profile->isAdmin($this->group)) {
18 $this->out->text(' '); // for separating the classes.
19 // TRANS: Indicator in group members list that this user is a group administrator.
20 $this->out->element('span', 'role', _('Admin'));
24 function showActions()
26 $this->startActions();
27 if (Event::handle('StartProfileListItemActionElements', array($this))) {
28 $this->showSubscribeButton();
29 $this->showMakeAdminForm();
30 $this->showGroupBlockForm();
31 Event::handle('EndProfileListItemActionElements', array($this));
36 function showMakeAdminForm()
38 $user = common_current_user();
41 $user->id != $this->profile->id &&
42 ($user->isAdmin($this->group) || $user->hasRight(Right::MAKEGROUPADMIN)) &&
43 !$this->profile->isAdmin($this->group)) {
44 $this->out->elementStart('li', 'entity_make_admin');
45 $maf = new MakeAdminForm($this->out, $this->profile, $this->group,
46 $this->returnToArgs());
48 $this->out->elementEnd('li');
53 function showGroupBlockForm()
55 $user = common_current_user();
57 if (!empty($user) && $user->id != $this->profile->id && $user->isAdmin($this->group)) {
58 $this->out->elementStart('li', 'entity_block');
59 $bf = new GroupBlockForm($this->out, $this->profile, $this->group,
60 $this->returnToArgs());
62 $this->out->elementEnd('li');
66 function linkAttributes()
68 $aAttrs = parent::linkAttributes();
70 if (common_config('nofollow', 'members')) {
71 $aAttrs['rel'] .= ' nofollow';
77 function homepageAttributes()
79 $aAttrs = parent::linkAttributes();
81 if (common_config('nofollow', 'members')) {
82 $aAttrs['rel'] = 'nofollow';
89 * Fetch necessary return-to arguments for the profile forms
90 * to return to this list when they're done.
94 protected function returnToArgs()
96 $args = array('action' => 'groupmembers',
97 'nickname' => $this->group->nickname);
98 $page = $this->out->arg('page');
100 $args['param-page'] = $page;