12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class NetworkpublicAction extends SitestreamAction
- {
- protected function streamPrepare()
- {
- if (!$this->scoped instanceof Profile && common_config('public', 'localonly')) {
- $this->clientError(_('Network wide public feed is not permitted without authorization'), 403);
- }
- if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
- $this->stream = new NetworkPublicNoticeStream($this->scoped);
- } else {
- $this->stream = new ThreadingNetworkPublicNoticeStream($this->scoped);
- }
- }
- function title()
- {
- if ($this->page > 1) {
-
-
- return sprintf(_('Network public timeline, page %d'), $this->page);
- } else {
-
- return _('Network public timeline');
- }
- }
- function showSections()
- {
-
-
- if (common_config('invite', 'enabled') && !common_config('site', 'closed') && common_logged_in()) {
- if (!common_config('site', 'private')) {
- $ibs = new InviteButtonSection(
- $this,
-
-
- _m('BUTTON', 'Send invite')
- );
- } else {
- $ibs = new InviteButtonSection($this);
- }
- $ibs->show();
- }
-
- }
-
- function getFeeds()
- {
- return [
- new Feed(Feed::ATOM,
- common_local_url('ApiTimelinePublic',
- array('format' => 'atom')),
-
- _('Public Timeline Feed (Atom)')
- ),
- new Feed(Feed::JSON,
- common_local_url('ApiTimelinePublic',
- array('format' => 'as')),
-
- _('Public Timeline Feed (Activity Streams JSON)')
- ),
- new Feed(Feed::RSS1, common_local_url('publicrss'),
-
- _('Public Timeline Feed (RSS 1.0)')
- ),
- new Feed(Feed::RSS2,
- common_local_url('ApiTimelinePublic',
- array('format' => 'rss')),
-
- _('Public Timeline Feed (RSS 2.0)')
- ),
- ];
- }
- }
|