123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class ShowgroupAction extends GroupAction
- {
-
- var $page = null;
- var $notice = null;
-
- function isReadOnly($args)
- {
- return true;
- }
-
- function title()
- {
- $base = $this->group->getFancyName();
- if ($this->page == 1) {
-
- return sprintf(_('%s group'), $base);
- } else {
-
-
- return sprintf(_('%1$s group, page %2$d'),
- $base,
- $this->page);
- }
- }
- public function getStream()
- {
- if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
- $stream = new GroupNoticeStream($this->group, $this->scoped);
- } else {
- $stream = new ThreadingGroupNoticeStream($this->group, $this->scoped);
- }
- return $stream;
- }
-
- function getFeeds()
- {
- $url =
- common_local_url('grouprss',
- array('nickname' => $this->group->nickname));
- return array(new Feed(Feed::JSON,
- common_local_url('ApiTimelineGroup',
- array('format' => 'as',
- 'id' => $this->group->id)),
-
- sprintf(_('Notice feed for %s group (Activity Streams JSON)'),
- $this->group->nickname)),
- new Feed(Feed::RSS1,
- common_local_url('grouprss',
- array('nickname' => $this->group->nickname)),
-
- sprintf(_('Notice feed for %s group (RSS 1.0)'),
- $this->group->nickname)),
- new Feed(Feed::RSS2,
- common_local_url('ApiTimelineGroup',
- array('format' => 'rss',
- 'id' => $this->group->id)),
-
- sprintf(_('Notice feed for %s group (RSS 2.0)'),
- $this->group->nickname)),
- new Feed(Feed::ATOM,
- common_local_url('ApiTimelineGroup',
- array('format' => 'atom',
- 'id' => $this->group->id)),
-
- sprintf(_('Notice feed for %s group (Atom)'),
- $this->group->nickname)),
- new Feed(Feed::FOAF,
- common_local_url('foafgroup',
- array('nickname' => $this->group->nickname)),
-
- sprintf(_('FOAF for %s group'),
- $this->group->nickname)));
- }
- function showAnonymousMessage()
- {
- if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
-
-
-
-
- $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
- 'based on the Free Software [StatusNet](http://status.net/) tool. Its members share ' .
- 'short messages about their life and interests. '.
- '[Join now](%%%%action.register%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'),
- $this->group->getBestName());
- } else {
-
-
-
- $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
- 'based on the Free Software [StatusNet](http://status.net/) tool. Its members share ' .
- 'short messages about their life and interests.'),
- $this->group->getBestName());
- }
- $this->elementStart('div', array('id' => 'anon_notice'));
- $this->raw(common_markup_to_html($m));
- $this->elementEnd('div');
- }
- function extraHead()
- {
- if ($this->page != 1) {
- $this->element('link', array('rel' => 'canonical',
- 'href' => $this->group->homeUrl()));
- }
- }
- }
|