X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshowfavorites.php;h=865045337aa9c07e8421f4801aeaa4f584f7e718;hb=b4e649fe906a793cd5e62d6390065ea5d41c40db;hp=d1c9283f0f47bff1a6811039a891760898de3f87;hpb=61940e37ff89710628eff1a4ad6db8df16142cec;p=quix0rs-gnu-social.git diff --git a/actions/showfavorites.php b/actions/showfavorites.php index d1c9283f0f..865045337a 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -58,7 +58,7 @@ class ShowfavoritesAction extends Action * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } @@ -74,9 +74,9 @@ class ShowfavoritesAction extends Action function title() { if ($this->page == 1) { - return sprintf(_("%s favorite notices"), $this->user->nickname); + return sprintf(_("%s's favorite notices"), $this->user->nickname); } else { - return sprintf(_("%s favorite notices, page %d"), + return sprintf(_("%s's favorite notices, page %d"), $this->user->nickname, $this->page); } @@ -162,6 +162,25 @@ class ShowfavoritesAction extends Action $nav->show(); } + function showEmptyListMessage() + { + if (common_logged_in()) { + $current_user = common_current_user(); + if ($this->user->id === $current_user->id) { + $message = _('You haven\'t chosen any favorite notices yet. Click the fave button on notices you like to bookmark them for later or shed a spotlight on them.'); + } else { + $message = sprintf(_('%s hasn\'t added any notices to his favorites yet. Post something interesting they would add to their favorites :)'), $this->user->nickname); + } + } + else { + $message = sprintf(_('%s hasn\'t added any notices to his favorites yet. Why not [register an account](%%%%action.register%%%%) and then post something interesting they would add to thier favorites :)'), $this->user->nickname); + } + + $this->elementStart('div', 'guide'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); + } + /** * Show the content * @@ -183,9 +202,17 @@ class ShowfavoritesAction extends Action $nl = new NoticeList($notice, $this); $cnt = $nl->show(); + if (0 == $cnt) { + $this->showEmptyListMessage(); + } $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'showfavorites', array('nickname' => $this->user->nickname)); } + + function showPageNotice() { + $this->element('p', 'instructions', _('This is a way to share what you like.')); + } } +