/** * Constructor * * @param Group $group the group for the feed * @param User $cur the current authenticated user, if any * @param boolean $indent flag to turn indenting on or off * * @return void */ function __construct($group, $cur = null, $indent = true) { parent::__construct($cur, $indent); $this->group = $group; // TRANS: Title in atom group notice feed. %s is a group name. $title = sprintf(_("%s timeline"), $group->nickname); $this->setTitle($title); $sitename = common_config('site', 'name'); $subtitle = sprintf(_('Updates from %1$s on %2$s!'), $group->nickname, $sitename); $this->setSubtitle($subtitle); $avatar = $group->homepage_logo; $logo = $avatar ? $avatar : User_group::defaultLogo(AVATAR_PROFILE_SIZE); $this->setLogo($logo); $this->setUpdated('now'); $self = common_local_url('ApiTimelineGroup', array('id' => $group->id, 'format' => 'atom')); $this->setId($self); $this->setSelfLink($self); // For groups, we generate an author _AND_ an <activity:subject> // Versions of StatusNet under 0.9.7 treat <author> as a person // XXX: remove this workaround in future versions $ao = ActivityObject::fromGroup($group); $this->addAuthorRaw($ao->asString('author')); $depMsg = 'Deprecation warning: activity:subject is present ' . 'only for backward compatibility. It will be ' . 'removed in the next version of StatusNet.'; $this->addAuthorRaw("<!--{$depMsg}-->\n" . $ao->asString('activity:subject')); $this->addLink($group->homeUrl()); }
function showGroup() { $this->out->elementStart('li', array('class' => 'profile h-card', 'id' => 'group-' . $this->group->id)); $user = common_current_user(); $this->out->elementStart('div', 'entity_profile'); $logo = $this->group->stream_logo ?: User_group::defaultLogo(AVATAR_STREAM_SIZE); $this->out->elementStart('a', array('href' => $this->group->homeUrl(), 'class' => 'u-url p-nickname', 'rel' => 'contact group')); $this->out->element('img', array('src' => $logo, 'class' => 'avatar u-photo', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => $this->group->getBestName())); $this->out->text($this->group->getNickname()); $this->out->elementEnd('a'); if ($this->group->fullname) { $this->out->text(' '); $this->out->elementStart('span', 'p-name'); $this->out->raw($this->highlight($this->group->fullname)); $this->out->elementEnd('span'); } if ($this->group->location) { $this->out->text(' '); $this->out->elementStart('span', 'label'); $this->out->raw($this->highlight($this->group->location)); $this->out->elementEnd('span'); } if ($this->group->homepage) { $this->out->text(' '); $this->out->elementStart('a', array('href' => $this->group->homepage, 'class' => 'u-url')); $this->out->raw($this->highlight($this->group->homepage)); $this->out->elementEnd('a'); } if ($this->group->description) { $this->out->elementStart('p', 'note'); $this->out->raw($this->highlight($this->group->description)); $this->out->elementEnd('p'); } // If we're on a list with an owner (subscriptions or subscribers)... if (!empty($user) && !empty($this->owner) && $user->id == $this->owner->id) { $this->showOwnerControls(); } $this->out->elementEnd('div'); if ($user) { $this->out->elementStart('div', 'entity_actions'); $this->out->elementStart('ul'); $this->out->elementStart('li', 'entity_subscribe'); // XXX: special-case for user looking at own // subscriptions page if ($user->isMember($this->group)) { $lf = new LeaveForm($this->out, $this->group); $lf->show(); } else { if (!Group_block::isBlocked($this->group, $user->getProfile())) { $jf = new JoinForm($this->out, $this->group); $jf->show(); } } $this->out->elementEnd('li'); $this->out->elementEnd('ul'); $this->out->elementEnd('div'); } $this->out->elementEnd('li'); }
function showGroup() { $this->out->elementStart('li', 'h-card'); $this->out->elementStart('a', array('title' => $this->group->getBestName(), 'href' => $this->group->homeUrl(), 'rel' => 'contact group', 'class' => 'p-name u-url org')); $logo = $this->group->mini_logo ? $this->group->mini_logo : User_group::defaultLogo(AVATAR_MINI_SIZE); $this->out->element('img', array('src' => $logo, 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar photo', 'alt' => $this->group->getBestName())); $this->out->elementEnd('a'); $this->out->elementEnd('li'); }
function showGroup() { $this->out->elementStart('li', 'vcard'); $this->out->elementStart('a', array('title' => $this->group->fullname ? $this->group->fullname : $this->group->nickname, 'href' => $this->group->homeUrl(), 'rel' => 'contact group', 'class' => 'url')); $logo = $this->group->mini_logo ? $this->group->mini_logo : User_group::defaultLogo(AVATAR_MINI_SIZE); $this->out->element('img', array('src' => $logo, 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar photo', 'alt' => $this->group->fullname ? $this->group->fullname : $this->group->nickname)); $this->out->element('span', 'fn org nickname', $this->group->nickname); $this->out->elementEnd('a'); $this->out->elementEnd('li'); }
static function fromFilename($filename, $size) { $alink = new AvatarLink(); $alink->url = $filename; $alink->height = $size; $alink->width = $size; if (!empty($filename)) { $alink->type = self::mediatype($filename); } else { $alink->url = User_group::defaultLogo($size); $alink->type = 'image/png'; } return $alink; }
function showGroup($group) { $this->out->elementStart('tr'); $this->out->elementStart('td'); $this->out->elementStart('a', array('title' => $group->getBestName(), 'href' => $group->homeUrl(), 'rel' => 'contact group', 'class' => 'h-card org nickname')); $logo = $group->stream_logo ?: User_group::defaultLogo(AVATAR_STREAM_SIZE); $this->out->element('img', array('src' => $logo, 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar u-photo', 'alt' => $group->getBestName())); $this->out->text($group->nickname); $this->out->elementEnd('a'); $this->out->elementEnd('td'); if ($group->value) { $this->out->element('td', 'value', $group->value); } $this->out->elementEnd('tr'); }
function showGroup($group) { $this->out->elementStart('tr'); $this->out->elementStart('td'); $this->out->elementStart('span', 'vcard'); $this->out->elementStart('a', array('title' => $group->fullname ? $group->fullname : $group->nickname, 'href' => $group->homeUrl(), 'rel' => 'contact group', 'class' => 'url')); $logo = $group->stream_logo ? $group->stream_logo : User_group::defaultLogo(AVATAR_STREAM_SIZE); $this->out->element('img', array('src' => $logo, 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar photo', 'alt' => $group->fullname ? $group->fullname : $group->nickname)); $this->out->element('span', 'fn org nickname', $group->nickname); $this->out->elementEnd('a'); $this->out->elementEnd('span'); $this->out->elementEnd('td'); if ($group->value) { $this->out->element('td', 'value', $group->value); } $this->out->elementEnd('tr'); }
/** * Constructor * * @param Group $group the group for the feed * @param boolean $indent flag to turn indenting on or off * * @return void */ function __construct($group, $indent = true) { parent::__construct($indent); $this->group = $group; $title = sprintf(_("%s timeline"), $group->nickname); $this->setTitle($title); $sitename = common_config('site', 'name'); $subtitle = sprintf(_('Updates from %1$s on %2$s!'), $group->nickname, $sitename); $this->setSubtitle($subtitle); $avatar = $group->homepage_logo; $logo = $avatar ? $avatar : User_group::defaultLogo(AVATAR_PROFILE_SIZE); $this->setLogo($logo); $this->setUpdated('now'); $self = common_local_url('ApiTimelineGroup', array('id' => $group->id, 'format' => 'atom')); $this->setId($self); $this->setSelfLink($self); $this->addAuthorRaw($group->asAtomAuthor()); $this->setActivitySubject($group->asActivitySubject()); $this->addLink($group->homeUrl()); }
/** * Constructor * * @param Group $group the group for the feed * @param User $cur the current authenticated user, if any * @param boolean $indent flag to turn indenting on or off * * @return void */ function __construct($group, $cur = null, $indent = true) { parent::__construct($cur, $indent); $this->group = $group; // TRANS: Title in atom group notice feed. %s is a group name. $title = sprintf(_("%s timeline"), $group->nickname); $this->setTitle($title); $sitename = common_config('site', 'name'); $subtitle = sprintf(_('Updates from %1$s on %2$s!'), $group->nickname, $sitename); $this->setSubtitle($subtitle); $avatar = $group->homepage_logo; $logo = $avatar ? $avatar : User_group::defaultLogo(AVATAR_PROFILE_SIZE); $this->setLogo($logo); $this->setUpdated('now'); $self = common_local_url('ApiTimelineGroup', array('id' => $group->id, 'format' => 'atom')); $this->setId($self); $this->setSelfLink($self); $ao = ActivityObject::fromGroup($group); $this->addAuthorRaw($ao->asString('author')); $this->addLink($group->homeUrl()); }
function getAvatar() { return empty($this->homepage_logo) ? User_group::defaultLogo(AVATAR_PROFILE_SIZE) : $this->homepage_logo; }
protected function handle() { parent::handle(); $results = array(); foreach ($this->profiles as $profile) { $avatarUrl = $profile->avatarUrl(AVATAR_MINI_SIZE); $results[] = array('value' => '@' . $profile->nickname, 'nickname' => $profile->nickname, 'label' => $profile->getFancyName(), 'avatar' => $avatarUrl, 'type' => 'user'); } foreach ($this->groups as $group) { // sigh.... encapsulate this upstream! if ($group->mini_logo) { $avatarUrl = $group->mini_logo; } else { $avatarUrl = User_group::defaultLogo(AVATAR_MINI_SIZE); } $results[] = array('value' => '!' . $group->nickname, 'nickname' => $group->nickname, 'label' => $group->getFancyName(), 'avatar' => $avatarUrl, 'type' => 'group'); } print json_encode($results); }
function handle($args) { parent::handle($args); $results = array(); foreach ($this->users as $user) { $profile = $user->getProfile(); $avatar = $profile->getAvatar(AVATAR_MINI_SIZE); // sigh.... encapsulate this upstream! if ($avatar) { $avatar = $avatar->displayUrl(); } else { $avatar = Avatar::defaultImage(AVATAR_MINI_SIZE); } $results[] = array('nickname' => $user->nickname, 'fullname' => $profile->fullname, 'avatar' => $avatar, 'type' => 'user'); } foreach ($this->groups as $group) { // sigh.... encapsulate this upstream! if ($group->mini_logo) { $avatar = $group->mini_logo; } else { $avatar = User_group::defaultLogo(AVATAR_MINI_SIZE); } $results[] = array('nickname' => $group->nickname, 'fullname' => $group->fullname, 'avatar' => $avatar, 'type' => 'group'); } foreach ($results as $result) { print json_encode($result) . "\n"; } }
function showAvatar() { $logo = $this->profile->stream_logo ? $this->profile->stream_logo : User_group::defaultLogo(AVATAR_STREAM_SIZE); $this->out->elementStart('a', array('href' => $this->profile->homeUrl(), 'class' => 'url entry-title', 'rel' => 'contact group')); $this->out->element('img', array('src' => $logo, 'class' => 'photo avatar', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => $this->profile->fullname ? $this->profile->fullname : $this->profile->nickname)); $this->out->text(' '); $hasFN = $this->profile->fullname ? 'nickname' : 'fn org nickname'; $this->out->elementStart('span', $hasFN); $this->out->raw($this->highlight($this->profile->nickname)); $this->out->elementEnd('span'); $this->out->elementEnd('a'); }
protected function handle() { parent::handle(); $results = array(); foreach ($this->profiles as $profile) { $avatarUrl = $profile->avatarUrl(AVATAR_MINI_SIZE); $acct = $profile->getAcctUri(); $identifier = explode(':', $profile->getAcctUri(), 2)[1]; $results[] = array('value' => '@' . $identifier, 'nickname' => $profile->getNickname(), 'acct_uri' => $acct, 'label' => "{$identifier} (" . $profile->getFullname() . ")", 'avatar' => $avatarUrl, 'type' => 'user'); } foreach ($this->groups as $group) { $profile = $group->getProfile(); // sigh.... encapsulate this upstream! if ($group->mini_logo) { $avatarUrl = $group->mini_logo; } else { $avatarUrl = User_group::defaultLogo(AVATAR_MINI_SIZE); } $acct = $profile->getAcctUri(); $identifier = explode(':', $profile->getAcctUri(), 2)[1]; $results[] = array('value' => '!' . $group->getNickname(), 'nickname' => $group->getNickname(), 'acct_uri' => $acct, 'label' => "{$identifier} (" . $group->getFullname() . ")", 'avatar' => $avatarUrl, 'type' => 'group'); } print json_encode($results); }
function showAvatar(Profile $profile, $size = null) { $logo = $profile->getGroup()->stream_logo ?: User_group::defaultLogo($size ?: $this->avatarSize()); $this->out->element('img', array('src' => $logo, 'class' => 'avatar u-photo', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => $profile->getBestName())); }
function avatar() { return $this->group->homepage_logo ? $this->group->homepage_logo : User_group::defaultLogo(AVATAR_PROFILE_SIZE); }
protected function showAvatar(Profile $profile, $size = null) { $avatar_url = $profile->getGroup()->homepage_logo ?: User_group::defaultLogo($size ?: $this->avatarSize()); $this->out->element('img', array('src' => $avatar_url, 'class' => 'avatar u-photo', 'width' => $this->avatarSize(), 'height' => $this->avatarSize(), 'alt' => $profile->getBestName())); }
function showGroup() { $this->out->elementStart('li', array('class' => 'profile', 'id' => 'group-' . $this->group->id)); $user = common_current_user(); $this->out->elementStart('div', 'entity_profile vcard'); $logo = $this->group->stream_logo ? $this->group->stream_logo : User_group::defaultLogo(AVATAR_STREAM_SIZE); $this->out->elementStart('a', array('href' => $this->group->homeUrl(), 'class' => 'url', 'rel' => 'group')); $this->out->element('img', array('src' => $logo, 'class' => 'photo avatar', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => $this->group->fullname ? $this->group->fullname : $this->group->nickname)); $hasFN = $this->group->fullname ? 'nickname url uid' : 'fn org nickname url uid'; $this->out->elementStart('span', $hasFN); $this->out->raw($this->highlight($this->group->nickname)); $this->out->elementEnd('span'); $this->out->elementEnd('a'); if ($this->group->fullname) { $this->out->elementStart('dl', 'entity_fn'); $this->out->element('dt', null, 'Full name'); $this->out->elementStart('dd'); $this->out->elementStart('span', 'fn org'); $this->out->raw($this->highlight($this->group->fullname)); $this->out->elementEnd('span'); $this->out->elementEnd('dd'); $this->out->elementEnd('dl'); } if ($this->group->location) { $this->out->elementStart('dl', 'entity_location'); $this->out->element('dt', null, _('Location')); $this->out->elementStart('dd', 'label'); $this->out->raw($this->highlight($this->group->location)); $this->out->elementEnd('dd'); $this->out->elementEnd('dl'); } if ($this->group->homepage) { $this->out->elementStart('dl', 'entity_url'); $this->out->element('dt', null, _('URL')); $this->out->elementStart('dd'); $this->out->elementStart('a', array('href' => $this->group->homepage, 'class' => 'url')); $this->out->raw($this->highlight($this->group->homepage)); $this->out->elementEnd('a'); $this->out->elementEnd('dd'); $this->out->elementEnd('dl'); } if ($this->group->description) { $this->out->elementStart('dl', 'entity_note'); $this->out->element('dt', null, _('Note')); $this->out->elementStart('dd', 'note'); $this->out->raw($this->highlight($this->group->description)); $this->out->elementEnd('dd'); $this->out->elementEnd('dl'); } # If we're on a list with an owner (subscriptions or subscribers)... if (!empty($user) && !empty($this->owner) && $user->id == $this->owner->id) { $this->showOwnerControls(); } $this->out->elementEnd('div'); if ($user) { $this->out->elementStart('div', 'entity_actions'); $this->out->elementStart('ul'); $this->out->elementStart('li', 'entity_subscribe'); # XXX: special-case for user looking at own # subscriptions page if ($user->isMember($this->group)) { $lf = new LeaveForm($this->out, $this->group); $lf->show(); } else { $jf = new JoinForm($this->out, $this->group); $jf->show(); } $this->out->elementEnd('li'); $this->out->elementEnd('ul'); $this->out->elementEnd('div'); } $this->out->elementEnd('li'); }
/** * Show the group profile * * Information about the group * * @return void */ function showGroupProfile() { $this->elementStart('div', 'entity_profile vcard author'); $this->element('h2', null, _('Group profile')); $this->elementStart('dl', 'entity_depiction'); $this->element('dt', null, _('Avatar')); $this->elementStart('dd'); $logo = $this->group->homepage_logo ? $this->group->homepage_logo : User_group::defaultLogo(AVATAR_PROFILE_SIZE); $this->element('img', array('src' => $logo, 'class' => 'photo avatar', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $this->group->nickname)); $this->elementEnd('dd'); $this->elementEnd('dl'); $this->elementStart('dl', 'entity_nickname'); $this->element('dt', null, _('Nickname')); $this->elementStart('dd'); $hasFN = $this->group->fullname ? 'nickname url uid' : 'fn org nickname url uid'; $this->element('a', array('href' => $this->group->homeUrl(), 'rel' => 'me', 'class' => $hasFN), $this->group->nickname); $this->elementEnd('dd'); $this->elementEnd('dl'); if ($this->group->fullname) { $this->elementStart('dl', 'entity_fn'); $this->element('dt', null, _('Full name')); $this->elementStart('dd'); $this->element('span', 'fn org', $this->group->fullname); $this->elementEnd('dd'); $this->elementEnd('dl'); } if ($this->group->location) { $this->elementStart('dl', 'entity_location'); $this->element('dt', null, _('Location')); $this->element('dd', 'label', $this->group->location); $this->elementEnd('dl'); } if ($this->group->homepage) { $this->elementStart('dl', 'entity_url'); $this->element('dt', null, _('URL')); $this->elementStart('dd'); $this->element('a', array('href' => $this->group->homepage, 'rel' => 'me', 'class' => 'url'), $this->group->homepage); $this->elementEnd('dd'); $this->elementEnd('dl'); } if ($this->group->description) { $this->elementStart('dl', 'entity_note'); $this->element('dt', null, _('Note')); $this->element('dd', 'note', $this->group->description); $this->elementEnd('dl'); } $this->elementEnd('div'); $this->elementStart('div', 'entity_actions'); $this->element('h2', null, _('Group actions')); $this->elementStart('ul'); $this->elementStart('li', 'entity_subscribe'); $cur = common_current_user(); if ($cur) { if ($cur->isMember($this->group)) { $lf = new LeaveForm($this, $this->group); $lf->show(); } else { $jf = new JoinForm($this, $this->group); $jf->show(); } } $this->elementEnd('li'); $this->elementEnd('ul'); $this->elementEnd('div'); }
/** * Show the group profile * * Information about the group * * @return void */ function showGroupProfile() { $this->elementStart('div', array('id' => 'i', 'class' => 'entity_profile vcard author')); if (Event::handle('StartGroupProfileElements', array($this, $this->group))) { // TRANS: Group profile header (h2). Text hidden by default. $this->element('h2', null, _('Group profile')); $this->elementStart('dl', 'entity_depiction'); // TRANS: Label for group avatar (dt). Text hidden by default. $this->element('dt', null, _('Avatar')); $this->elementStart('dd'); $logo = $this->group->homepage_logo ? $this->group->homepage_logo : User_group::defaultLogo(AVATAR_PROFILE_SIZE); $this->element('img', array('src' => $logo, 'class' => 'photo avatar', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $this->group->nickname)); $this->elementEnd('dd'); $this->elementEnd('dl'); $this->elementStart('dl', 'entity_nickname'); // TRANS: Label for group nickname (dt). Text hidden by default. $this->element('dt', null, _('Nickname')); $this->elementStart('dd'); $hasFN = $this->group->fullname ? 'nickname url uid' : 'fn org nickname url uid'; $this->element('a', array('href' => $this->group->homeUrl(), 'rel' => 'me', 'class' => $hasFN), $this->group->nickname); $this->elementEnd('dd'); $this->elementEnd('dl'); if ($this->group->fullname) { $this->elementStart('dl', 'entity_fn'); // TRANS: Label for full group name (dt). Text hidden by default. $this->element('dt', null, _('Full name')); $this->elementStart('dd'); $this->element('span', 'fn org', $this->group->fullname); $this->elementEnd('dd'); $this->elementEnd('dl'); } if ($this->group->location) { $this->elementStart('dl', 'entity_location'); // TRANS: Label for group location (dt). Text hidden by default. $this->element('dt', null, _('Location')); $this->element('dd', 'label', $this->group->location); $this->elementEnd('dl'); } if ($this->group->homepage) { $this->elementStart('dl', 'entity_url'); // TRANS: Label for group URL (dt). Text hidden by default. $this->element('dt', null, _('URL')); $this->elementStart('dd'); $this->element('a', array('href' => $this->group->homepage, 'rel' => 'me', 'class' => 'url'), $this->group->homepage); $this->elementEnd('dd'); $this->elementEnd('dl'); } if ($this->group->description) { $this->elementStart('dl', 'entity_note'); // TRANS: Label for group description or group note (dt). Text hidden by default. $this->element('dt', null, _('Note')); $this->element('dd', 'note', $this->group->description); $this->elementEnd('dl'); } if (common_config('group', 'maxaliases') > 0) { $aliases = $this->group->getAliases(); if (!empty($aliases)) { $this->elementStart('dl', 'entity_aliases'); // TRANS: Label for group aliases (dt). Text hidden by default. $this->element('dt', null, _('Aliases')); $this->element('dd', 'aliases', implode(' ', $aliases)); $this->elementEnd('dl'); } } Event::handle('EndGroupProfileElements', array($this, $this->group)); } $this->elementEnd('div'); }
/** * Show the group profile * * Information about the group * * @return void */ function showGroupProfile() { $this->elementStart('div', array('id' => 'i', 'class' => 'entity_profile vcard author')); $this->element('h2', null, _('Group profile')); $this->elementStart('dl', 'entity_depiction'); $this->element('dt', null, _('Avatar')); $this->elementStart('dd'); $logo = $this->group->homepage_logo ? $this->group->homepage_logo : User_group::defaultLogo(AVATAR_PROFILE_SIZE); $this->element('img', array('src' => $logo, 'class' => 'photo avatar', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $this->group->nickname)); $this->elementEnd('dd'); $this->elementEnd('dl'); $this->elementStart('dl', 'entity_nickname'); $this->element('dt', null, _('Nickname')); $this->elementStart('dd'); $hasFN = $this->group->fullname ? 'nickname url uid' : 'fn org nickname url uid'; $this->element('a', array('href' => $this->group->homeUrl(), 'rel' => 'me', 'class' => $hasFN), $this->group->nickname); $this->elementEnd('dd'); $this->elementEnd('dl'); if ($this->group->fullname) { $this->elementStart('dl', 'entity_fn'); $this->element('dt', null, _('Full name')); $this->elementStart('dd'); $this->element('span', 'fn org', $this->group->fullname); $this->elementEnd('dd'); $this->elementEnd('dl'); } if ($this->group->location) { $this->elementStart('dl', 'entity_location'); $this->element('dt', null, _('Location')); $this->element('dd', 'label', $this->group->location); $this->elementEnd('dl'); } if ($this->group->homepage) { $this->elementStart('dl', 'entity_url'); $this->element('dt', null, _('URL')); $this->elementStart('dd'); $this->element('a', array('href' => $this->group->homepage, 'rel' => 'me', 'class' => 'url'), $this->group->homepage); $this->elementEnd('dd'); $this->elementEnd('dl'); } if ($this->group->description) { $this->elementStart('dl', 'entity_note'); $this->element('dt', null, _('Note')); $this->element('dd', 'note', $this->group->description); $this->elementEnd('dl'); } if (common_config('group', 'maxaliases') > 0) { $aliases = $this->group->getAliases(); if (!empty($aliases)) { $this->elementStart('dl', 'entity_aliases'); $this->element('dt', null, _('Aliases')); $this->element('dd', 'aliases', implode(' ', $aliases)); $this->elementEnd('dl'); } } $this->elementEnd('div'); $cur = common_current_user(); $this->elementStart('div', 'entity_actions'); $this->element('h2', null, _('Group actions')); $this->elementStart('ul'); $this->elementStart('li', 'entity_subscribe'); if (Event::handle('StartGroupSubscribe', array($this, $this->group))) { if ($cur) { if ($cur->isMember($this->group)) { $lf = new LeaveForm($this, $this->group); $lf->show(); } else { if (!Group_block::isBlocked($this->group, $cur->getProfile())) { $jf = new JoinForm($this, $this->group); $jf->show(); } } } Event::handle('EndGroupSubscribe', array($this, $this->group)); } $this->elementEnd('li'); if ($cur && $cur->hasRight(Right::DELETEGROUP)) { $this->elementStart('li', 'entity_delete'); $df = new DeleteGroupForm($this, $this->group); $df->show(); $this->elementEnd('li'); } $this->elementEnd('ul'); $this->elementEnd('div'); }