require_once INSTALLDIR.'/lib/publicgroupnav.php';
require_once INSTALLDIR.'/lib/noticelist.php';
+require_once INSTALLDIR.'/lib/feedlist.php';
/**
* Action for displaying the public stream
var $page = null;
+ function isReadOnly()
+ {
+ return true;
+ }
+
/**
* Read and validate arguments
*
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
+
+ common_set_returnto($this->selfUrl());
+
return true;
}
* @return void
*/
- function showFeeds()
+ function getFeeds()
{
- $this->element('link', array('rel' => 'alternate',
- 'href' => common_local_url('publicrss'),
- 'type' => 'application/rss+xml',
- 'title' => _('Public Stream Feed')));
+ return array(new Feed(Feed::RSS1, common_local_url('publicrss'),
+ _('Public Stream Feed (RSS 1.0)')),
+ new Feed(Feed::RSS2,
+ common_local_url('api',
+ array('apiaction' => 'statuses',
+ 'method' => 'public_timeline.rss')),
+ _('Public Stream Feed (RSS 2.0)')),
+ new Feed(Feed::ATOM,
+ common_local_url('api',
+ array('apiaction' => 'statuses',
+ 'method' => 'public_timeline.atom')),
+ _('Public Stream Feed (Atom)')));
}
/**
NOTICES_PER_PAGE + 1);
if (!$notice) {
- $this->server_error(_('Could not retrieve public stream.'));
+ $this->serverError(_('Could not retrieve public stream.'));
return;
}
$this->page, 'public');
}
- /**
- * Makes a list of exported feeds for this page
- *
- * @return void
- *
- * @todo I18N
- */
+ function showSections()
+ {
+ // $top = new TopPostersSection($this);
+ // $top->show();
+ $pop = new PopularNoticeSection($this);
+ $pop->show();
+ $gbp = new GroupsByPostsSection($this);
+ $gbp->show();
+ $feat = new FeaturedUsersSection($this);
+ $feat->show();
+ }
- function showExportData()
+ function showAnonymousMessage()
{
- $fl = new FeedList($this);
- $fl->show(array(0 => array('href' => common_local_url('publicrss'),
- 'type' => 'rss',
- 'version' => 'RSS 1.0',
- 'item' => 'publicrss'),
- 1 => array('href' => common_local_url('publicatom'),
- 'type' => 'atom',
- 'version' => 'Atom 1.0',
- 'item' => 'publicatom')));
+ $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
+ 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' .
+ '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ([Read more](%%doc.help%%))');
+ $this->elementStart('div', array('id' => 'anon_notice'));
+ $this->raw(common_markup_to_html($m));
+ $this->elementEnd('div');
}
}