summaryrefslogtreecommitdiff
path: root/actions/shownotice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-07-02 08:21:54 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-07-02 08:21:54 -0400
commitaea546c12234e9b24abba8da5d172a99e8b93ac2 (patch)
tree9c7b9e7dde34a2a5aeb2baea480ab4d974765cc4 /actions/shownotice.php
parentb4de1d4636d6b4e9dab4a680ab2975c9e8b303ba (diff)
notice should show user design
Diffstat (limited to 'actions/shownotice.php')
-rw-r--r--actions/shownotice.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/actions/shownotice.php b/actions/shownotice.php
index 0d89af5ac..1ec38a76b 100644
--- a/actions/shownotice.php
+++ b/actions/shownotice.php
@@ -45,7 +45,7 @@ require_once INSTALLDIR.'/lib/feedlist.php';
* @link http://laconi.ca/
*/
-class ShownoticeAction extends Action
+class ShownoticeAction extends OwnerDesignAction
{
/**
* Notice object to show
@@ -83,18 +83,25 @@ class ShownoticeAction extends Action
$this->notice = Notice::staticGet($id);
- if (!$this->notice) {
+ if (empty($this->notice)) {
$this->clientError(_('No such notice.'), 404);
return false;
}
$this->profile = $this->notice->getProfile();
- if (!$this->profile) {
+ if (empty($this->profile)) {
$this->serverError(_('Notice has no profile'), 500);
return false;
}
+ $this->user = User::staticGet('id', $this->profile->id);
+
+ if (empty($this->user)) {
+ $this->serverError(_('Not a local notice'), 500);
+ return false;
+ }
+
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
return true;
@@ -158,8 +165,14 @@ class ShownoticeAction extends Action
function title()
{
+ if (!empty($this->profile->fullname)) {
+ $base = $this->profile->fullname . ' (' . $this->user->nickname . ') ';
+ } else {
+ $base = $this->user->nickname;
+ }
+
return sprintf(_('%1$s\'s status on %2$s'),
- $this->profile->nickname,
+ $base,
common_exact_date($this->notice->created));
}