123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class PublicAction extends SitestreamAction
- {
- protected function streamPrepare()
- {
- if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
- $this->stream = new PublicNoticeStream($this->scoped);
- } else {
- $this->stream = new ThreadingPublicNoticeStream($this->scoped);
- }
- }
-
- function title()
- {
- if ($this->page > 1) {
-
-
- return sprintf(_('Public timeline, page %d'), $this->page);
- } else {
-
- return _('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();
- }
- $feat = new FeaturedUsersSection($this);
- $feat->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)')
- ),
- ];
- }
- }
|