3 * StatusNet, the distributed open-source microblogging tool
9 * LICENCE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * @author Evan Prodromou <evan@status.net>
25 * @author Sarven Capadisli <csarven@status.net>
26 * @copyright 2008-2011 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://status.net/
31 if (!defined('GNUSOCIAL')) { exit(1); }
38 * @author Evan Prodromou <evan@status.net>
39 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
40 * @link http://status.net/
42 class ShowgroupAction extends GroupAction
44 /** page we're viewing. */
49 * Is this page read-only?
51 * @return boolean true
53 function isReadOnly($args)
61 * @return string page title, with page number
65 $base = $this->group->getFancyName();
67 if ($this->page == 1) {
68 // TRANS: Page title for first group page. %s is a group name.
69 return sprintf(_('%s group'), $base);
71 // TRANS: Page title for any but first group page.
72 // TRANS: %1$s is a group name, $2$s is a page number.
73 return sprintf(_('%1$s group, page %2$d'),
79 public function getStream()
81 if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
82 $stream = new GroupNoticeStream($this->group, $this->scoped);
84 $stream = new ThreadingGroupNoticeStream($this->group, $this->scoped);
91 * Get a list of the feeds for this page
98 common_local_url('grouprss',
99 array('nickname' => $this->group->nickname));
101 return array(new Feed(Feed::JSON,
102 common_local_url('ApiTimelineGroup',
103 array('format' => 'as',
104 'id' => $this->group->id)),
105 // TRANS: Tooltip for feed link. %s is a group nickname.
106 sprintf(_('Notice feed for %s group (Activity Streams JSON)'),
107 $this->group->nickname)),
109 common_local_url('grouprss',
110 array('nickname' => $this->group->nickname)),
111 // TRANS: Tooltip for feed link. %s is a group nickname.
112 sprintf(_('Notice feed for %s group (RSS 1.0)'),
113 $this->group->nickname)),
115 common_local_url('ApiTimelineGroup',
116 array('format' => 'rss',
117 'id' => $this->group->id)),
118 // TRANS: Tooltip for feed link. %s is a group nickname.
119 sprintf(_('Notice feed for %s group (RSS 2.0)'),
120 $this->group->nickname)),
122 common_local_url('ApiTimelineGroup',
123 array('format' => 'atom',
124 'id' => $this->group->id)),
125 // TRANS: Tooltip for feed link. %s is a group nickname.
126 sprintf(_('Notice feed for %s group (Atom)'),
127 $this->group->nickname)),
129 common_local_url('foafgroup',
130 array('nickname' => $this->group->nickname)),
131 // TRANS: Tooltip for feed link. %s is a group nickname.
132 sprintf(_('FOAF for %s group'),
133 $this->group->nickname)));
136 function showAnonymousMessage()
138 if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
139 // TRANS: Notice on group pages for anonymous users for StatusNet sites that accept new registrations.
140 // TRANS: %s is the group name, %%%%site.name%%%% is the site name,
141 // TRANS: %%%%action.register%%%% is the URL for registration, %%%%doc.help%%%% is a URL to help.
142 // TRANS: This message contains Markdown links. Ensure they are formatted correctly: [Description](link).
143 $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
144 'based on the Free Software [StatusNet](http://status.net/) tool. Its members share ' .
145 'short messages about their life and interests. '.
146 '[Join now](%%%%action.register%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'),
147 $this->group->getBestName());
149 // TRANS: Notice on group pages for anonymous users for StatusNet sites that accept no new registrations.
150 // TRANS: %s is the group name, %%%%site.name%%%% is the site name,
151 // TRANS: This message contains Markdown links. Ensure they are formatted correctly: [Description](link).
152 $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
153 'based on the Free Software [StatusNet](http://status.net/) tool. Its members share ' .
154 'short messages about their life and interests.'),
155 $this->group->getBestName());
157 $this->elementStart('div', array('id' => 'anon_notice'));
158 $this->raw(common_markup_to_html($m));
159 $this->elementEnd('div');
164 if ($this->page != 1) {
165 $this->element('link', array('rel' => 'canonical',
166 'href' => $this->group->homeUrl()));