3 if (!defined('GNUSOCIAL')) { exit(1); }
5 class NetworkpublicAction extends PublicAction
7 protected function streamPrepare()
9 if (!$this->scoped instanceof Profile && common_config('public', 'localonly')) {
10 $this->clientError(_('Network wide public feed is not permitted without authorization'), 403);
12 if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
13 $this->stream = new NetworkPublicNoticeStream($this->scoped);
15 $this->stream = new ThreadingNetworkPublicNoticeStream($this->scoped);
21 if ($this->page > 1) {
22 // TRANS: Title for all public timeline pages but the first.
23 // TRANS: %d is the page number.
24 return sprintf(_('Network public timeline, page %d'), $this->page);
26 // TRANS: Title for the first public timeline page.
27 return _('Network public timeline');
33 // the PublicAction has some XRDS stuff that might be unique to the non-network public feed
34 // FIXME: Solve this with a call that doesn't rely on parent:: and is unique for each class.
35 ManagedAction::extraHead();
38 function showSections()
40 // Show invite button, as long as site isn't closed, and
41 // we have a logged in user.
42 if (common_config('invite', 'enabled') && !common_config('site', 'closed') && common_logged_in()) {
43 if (!common_config('site', 'private')) {
44 $ibs = new InviteButtonSection(
46 // TRANS: Button text for inviting more users to the StatusNet instance.
47 // TRANS: Less business/enterprise-oriented language for public sites.
48 _m('BUTTON', 'Send invite')
51 $ibs = new InviteButtonSection($this);
56 // Network public tag cloud?
61 return array(new Feed(Feed::JSON,
62 common_local_url('ApiTimelineNetworkPublic',
63 array('format' => 'as')),
64 // TRANS: Link description for the _global_ network public timeline feed.
65 _('Network Public Timeline Feed (Activity Streams JSON)')),
66 new Feed(Feed::RSS1, common_local_url('publicrss'),
67 // TRANS: Link description for the _global_ network public timeline feed.
68 _('Network Public Timeline Feed (RSS 1.0)')),
70 common_local_url('ApiTimelineNetworkPublic',
71 array('format' => 'rss')),
72 // TRANS: Link description for the _global_ network public timeline feed.
73 _('Network Public Timeline Feed (RSS 2.0)')),
75 common_local_url('ApiTimelineNetworkPublic',
76 array('format' => 'atom')),
77 // TRANS: Link description for the _global_ network public timeline feed.
78 _('Network Public Timeline Feed (Atom)')));