X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpublic.php;h=961606908db126c3977a35d4eac1ddc2ca2eeb49;hb=8439477201cd59a6c0dba84ddf48eb86a6154199;hp=9b22e0a2ceefe1ff991453cc4e37abab12b6a559;hpb=7b02d9d2e14153afd989f7373f3453b9bec3c2a0;p=quix0rs-gnu-social.git diff --git a/actions/public.php b/actions/public.php index 9b22e0a2ce..961606908d 100644 --- a/actions/public.php +++ b/actions/public.php @@ -56,6 +56,18 @@ class PublicAction extends Action var $page = null; + /** + * Number of notices being shown on this page. + */ + // Does this need to be here? Should it be? + // If it does, this property needs to be + // added to other actions as well, like $page. + // I'm trying to find a way to capture the + // output of the $cnt variable from this + // action's showContent() method but need + // to do so earlier, I think...? + var $count = null; + function isReadOnly() { return true; @@ -135,6 +147,17 @@ class PublicAction extends Action _('Public Stream Feed (Atom)'))); } + /** + * Output document relationship links + * + * @return void + */ + function showRelationshipLinks() + { + $this->sequenceRelationships($this->page > 1, $this->count > NOTICES_PER_PAGE, // FIXME + $this->page, 'public'); + } + /** * Extra head elements * @@ -166,6 +189,22 @@ class PublicAction extends Action $nav->show(); } + function showEmptyList() + { + $message = _('This is the public timeline for %%site.name%% but no one has posted anything yet.') . ' '; + + if (common_logged_in()) { + $message .= _('Be the first to post!'); + } + else { + $message .= _('Why not [register an account](%%action.register%%) and be the first to post!'); + } + + $this->elementStart('div', 'guide'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); + } + /** * Fill the content area * @@ -189,6 +228,10 @@ class PublicAction extends Action $cnt = $nl->show(); + if ($cnt == 0) { + $this->showEmptyList(); + } + $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'public'); }