2015-01-29 04:25:39 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if (!defined('GNUSOCIAL')) { exit(1); }
|
|
|
|
|
2015-06-04 07:50:08 +09:00
|
|
|
class NetworkpublicAction extends SitestreamAction
|
2015-01-29 04:25:39 +09:00
|
|
|
{
|
|
|
|
protected function streamPrepare()
|
|
|
|
{
|
|
|
|
if (!$this->scoped instanceof Profile && common_config('public', 'localonly')) {
|
2015-01-30 07:30:13 +09:00
|
|
|
$this->clientError(_('Network wide public feed is not permitted without authorization'), 403);
|
2015-01-29 04:25:39 +09:00
|
|
|
}
|
|
|
|
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) {
|
|
|
|
// TRANS: Title for all public timeline pages but the first.
|
|
|
|
// TRANS: %d is the page number.
|
|
|
|
return sprintf(_('Network public timeline, page %d'), $this->page);
|
|
|
|
} else {
|
|
|
|
// TRANS: Title for the first public timeline page.
|
|
|
|
return _('Network public timeline');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function extraHead()
|
|
|
|
{
|
2015-06-04 07:50:08 +09:00
|
|
|
parent::extraHead();
|
2015-01-29 04:25:39 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
function showSections()
|
|
|
|
{
|
|
|
|
// Show invite button, as long as site isn't closed, and
|
|
|
|
// we have a logged in user.
|
|
|
|
if (common_config('invite', 'enabled') && !common_config('site', 'closed') && common_logged_in()) {
|
|
|
|
if (!common_config('site', 'private')) {
|
|
|
|
$ibs = new InviteButtonSection(
|
|
|
|
$this,
|
|
|
|
// TRANS: Button text for inviting more users to the StatusNet instance.
|
|
|
|
// TRANS: Less business/enterprise-oriented language for public sites.
|
|
|
|
_m('BUTTON', 'Send invite')
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$ibs = new InviteButtonSection($this);
|
|
|
|
}
|
|
|
|
$ibs->show();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Network public tag cloud?
|
|
|
|
}
|
|
|
|
|
|
|
|
function getFeeds()
|
|
|
|
{
|
2015-01-30 06:16:30 +09:00
|
|
|
return array(new Feed(Feed::JSON,
|
|
|
|
common_local_url('ApiTimelineNetworkPublic',
|
|
|
|
array('format' => 'as')),
|
2015-02-06 20:51:04 +09:00
|
|
|
// TRANS: Link description for the _global_ network public timeline feed.
|
|
|
|
_('Network Public Timeline Feed (Activity Streams JSON)')),
|
2015-01-30 06:16:30 +09:00
|
|
|
new Feed(Feed::RSS1, common_local_url('publicrss'),
|
2015-02-06 20:51:04 +09:00
|
|
|
// TRANS: Link description for the _global_ network public timeline feed.
|
|
|
|
_('Network Public Timeline Feed (RSS 1.0)')),
|
2015-01-30 06:16:30 +09:00
|
|
|
new Feed(Feed::RSS2,
|
|
|
|
common_local_url('ApiTimelineNetworkPublic',
|
|
|
|
array('format' => 'rss')),
|
2015-02-06 20:51:04 +09:00
|
|
|
// TRANS: Link description for the _global_ network public timeline feed.
|
|
|
|
_('Network Public Timeline Feed (RSS 2.0)')),
|
2015-01-30 06:16:30 +09:00
|
|
|
new Feed(Feed::ATOM,
|
|
|
|
common_local_url('ApiTimelineNetworkPublic',
|
|
|
|
array('format' => 'atom')),
|
2015-02-06 20:51:04 +09:00
|
|
|
// TRANS: Link description for the _global_ network public timeline feed.
|
|
|
|
_('Network Public Timeline Feed (Atom)')));
|
2015-01-29 04:25:39 +09:00
|
|
|
}
|
|
|
|
}
|