diff options
author | Sarven Capadisli <csarven@controlyourself.ca> | 2009-04-08 22:55:13 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@controlyourself.ca> | 2009-04-08 22:55:13 +0000 |
commit | e5657ca4bbd8a43bf2dd44c2554e807a45224bd7 (patch) | |
tree | 3ad9a722f787e277ab571d40522cd5289da738dc /actions/all.php | |
parent | e632f3be6f48c187b8049f35756b25ae80be2f0b (diff) | |
parent | 070cd3533c3474dc065c6681befb92dac51f4bf7 (diff) |
Merge branch '0.7.x' into 0.8.x
Diffstat (limited to 'actions/all.php')
-rw-r--r-- | actions/all.php | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/actions/all.php b/actions/all.php index 8e67ec0f3..f5bbfe2e3 100644 --- a/actions/all.php +++ b/actions/all.php @@ -23,31 +23,13 @@ require_once INSTALLDIR.'/lib/personalgroupnav.php'; require_once INSTALLDIR.'/lib/noticelist.php'; require_once INSTALLDIR.'/lib/feedlist.php'; -class AllAction extends Action +class AllAction extends ProfileAction { - var $user = null; - var $page = null; - function isReadOnly() { return true; } - function prepare($args) - { - parent::prepare($args); - $nickname = common_canonical_nickname($this->arg('nickname')); - $this->user = User::staticGet('nickname', $nickname); - $this->page = $this->trimmed('page'); - if (!$this->page) { - $this->page = 1; - } - - common_set_returnto($this->selfUrl()); - - return true; - } - function handle($args) { parent::handle($args); @@ -93,6 +75,27 @@ class AllAction extends Action $nav->show(); } + function showEmptyListMessage() + { + $message = sprintf(_('This is the timeline for %s and friends but no one has posted anything yet.'), $this->user->nickname) . ' '; + + if (common_logged_in()) { + $current_user = common_current_user(); + if ($this->user->id === $current_user->id) { + $message .= _('Try subscribing to more people, [join a group](%%action.groups) or post something yourself.'); + } else { + $message .= sprintf(_('You can try to [nudge %s](../%s) from his profile or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname); + } + } + else { + $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname); + } + + $this->elementStart('div', 'guide'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); + } + function showContent() { $notice = $this->user->noticesWithFriends(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); @@ -101,6 +104,10 @@ class AllAction extends Action $cnt = $nl->show(); + if (0 == $cnt) { + $this->showEmptyListMessage(); + } + $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'all', array('nickname' => $this->user->nickname)); } |