{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
-
+
common_set_returnto($this->selfUrl());
-
+
return true;
}
$this->elementStart('div', 'instructions');
$this->raw($output);
$this->elementEnd('div');
+ }
- $favorite = new Fave;
-
- if ($favorite->count()) {
- return;
- }
-
+ function showEmptyList()
+ {
$message = _('Favorite notices appear on this page but no one has favorited one yet.') . ' ';
if (common_logged_in()) {
$cnt = $nl->show();
+ if ($cnt == 0) {
+ $this->showEmptyList();
+ }
+
$this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
$this->page, 'favorited');
}
$nav->show();
}
- function showPageNotice()
+ function showEmptyList()
{
- $notice = new Notice;
-
- if (!$notice) {
- $this->serverError(_('Could not retrieve public stream.'));
- return;
- }
-
- if ($notice->count()) {
- return;
- }
-
$message = _('This is the public timeline for %%site.name%% but no one has posted anything yet.') . ' ';
if (common_logged_in()) {
$cnt = $nl->show();
+ if ($cnt == 0) {
+ $this->showEmptyList();
+ }
+
$this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
$this->page, 'public');
}
$this->element('p', 'instructions',
sprintf(_('These are most popular recent tags on %s '),
common_config('site', 'name')));
+ }
- $tags = new Notice_tag;
- if ($tags->count()) {
- return;
- }
-
+ function showEmptyList()
+ {
$message = _('No one has posted a notice with a [hashtag](%%doc.tags%%) yet.') . ' ';
if (common_logged_in()) {
$this->elementEnd('dd');
$this->elementEnd('dl');
$this->elementEnd('div');
+ } else {
+ $this->showEmptyList();
}
}