123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?php
- class GroupMemberListItem extends ProfileListItem
- {
- var $group = null;
- function __construct($profile, $group, $action)
- {
- parent::__construct($profile, $action);
- $this->group = $group;
- }
- function showFullName()
- {
- parent::showFullName();
- if ($this->profile->isAdmin($this->group)) {
- $this->out->text(' ');
-
- $this->out->element('span', 'role', _m('GROUPADMIN','Admin'));
- }
- }
- function showActions()
- {
- $this->startActions();
- if (Event::handle('StartProfileListItemActionElements', array($this))) {
- $this->showSubscribeButton();
- $this->showMakeAdminForm();
- $this->showGroupBlockForm();
- Event::handle('EndProfileListItemActionElements', array($this));
- }
- $this->endActions();
- }
- function showMakeAdminForm()
- {
- $user = common_current_user();
- if (!empty($user) &&
- $user->id != $this->profile->id &&
- ($user->isAdmin($this->group) || $user->hasRight(Right::MAKEGROUPADMIN)) &&
- !$this->profile->isAdmin($this->group)) {
- $this->out->elementStart('li', 'entity_make_admin');
- $maf = new MakeAdminForm($this->out, $this->profile, $this->group,
- $this->returnToArgs());
- $maf->show();
- $this->out->elementEnd('li');
- }
- }
- function showGroupBlockForm()
- {
- $user = common_current_user();
- if (!empty($user) && $user->id != $this->profile->id && $user->isAdmin($this->group)) {
- $this->out->elementStart('li', 'entity_block');
- $bf = new GroupBlockForm($this->out, $this->profile, $this->group,
- $this->returnToArgs());
- $bf->show();
- $this->out->elementEnd('li');
- }
- }
- function linkAttributes()
- {
- $aAttrs = parent::linkAttributes();
- if (common_config('nofollow', 'members')) {
- $aAttrs['rel'] .= ' nofollow';
- }
- return $aAttrs;
- }
- function homepageAttributes()
- {
- $aAttrs = parent::linkAttributes();
- if (common_config('nofollow', 'members')) {
- $aAttrs['rel'] = 'nofollow';
- }
- return $aAttrs;
- }
-
- protected function returnToArgs()
- {
- $args = array('action' => 'groupmembers',
- 'nickname' => $this->group->nickname);
- $page = $this->out->arg('page');
- if ($page) {
- $args['param-page'] = $page;
- }
- return $args;
- }
- }
|