]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - actions/networkpublic.php
4bba2f7f477854f5c254917097d9e3a33de73949
[quix0rs-gnu-social.git] / actions / networkpublic.php
1 <?php
2
3 if (!defined('GNUSOCIAL')) { exit(1); }
4
5 class NetworkpublicAction extends PublicAction
6 {
7     protected function streamPrepare()
8     {
9         if (!$this->scoped instanceof Profile && common_config('public', 'localonly')) {
10             $this->serverError(_('Network wide public feed is not permitted without authorization'), 403);
11         }
12         if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
13             $this->stream = new NetworkPublicNoticeStream($this->scoped);
14         } else {
15             $this->stream = new ThreadingNetworkPublicNoticeStream($this->scoped);
16         }
17     }
18
19     function title()
20     {
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);
25         } else {
26             // TRANS: Title for the first public timeline page.
27             return _('Network public timeline');
28         }
29     }
30
31     function extraHead()
32     {
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();
36     }
37
38     function showSections()
39     {
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(
45                     $this,
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')
49                 );
50             } else {
51                 $ibs = new InviteButtonSection($this);
52             }
53             $ibs->show();
54         }
55
56         // Network public tag cloud?
57     }
58
59     /**
60      * FIXME: Network public feed! Get a template from PublicAction
61      */
62     function getFeeds()
63     {
64         return array();
65     }
66 }