]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showstream.php
Ticket #1094 Facebook app invites page was failing if no friends had added the app yet
[quix0rs-gnu-social.git] / actions / showstream.php
index ecd952635335648028e6aeb66f7413959c149515..28bb8453f8c1111dd04a44b9fcff947273fd146b 100644 (file)
@@ -110,6 +110,8 @@ class ShowstreamAction extends Action
 
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
 
+        common_set_returnto($this->selfUrl());
+        
         return true;
     }
 
@@ -140,7 +142,12 @@ class ShowstreamAction extends Action
 
     function showPageTitle()
     {
-         $this->element('h1', NULL, $this->profile->nickname._("'s profile"));
+        $user =& common_current_user();
+        if ($user && ($user->id == $this->profile->id)) {
+            $this->element('h1', NULL, _("Your profile"));
+        } else {
+            $this->element('h1', NULL, sprintf(_('%s\'s profile'), $this->profile->nickname));
+        }
     }
 
     function showPageNoticeBlock()
@@ -170,26 +177,22 @@ class ShowstreamAction extends Action
 
     function showFeeds()
     {
-        // Feeds
         $this->element('link', array('rel' => 'alternate',
-                                     'href' => common_local_url('api',
-                                                                array('apiaction' => 'statuses',
-                                                                      'method' => 'entity_timeline.rss',
-                                                                      'argument' => $this->user->nickname)),
-                                     'type' => 'application/rss+xml',
-                                     'title' => sprintf(_('Notice feed for %s'), $this->user->nickname)));
-        $this->element('link', array('rel' => 'alternate feed',
-                                     'href' => common_local_url('api',
-                                                                array('apiaction' => 'statuses',
-                                                                      'method' => 'entity_timeline.atom',
-                                                                      'argument' => $this->user->nickname)),
-                                     'type' => 'application/atom+xml',
-                                     'title' => sprintf(_('Notice feed for %s'), $this->user->nickname)));
-        $this->element('link', array('rel' => 'alternate',
-                                     'href' => common_local_url('userrss', array('nickname' =>
-                                                                               $this->user->nickname)),
-                                     'type' => 'application/rdf+xml',
-                                     'title' => sprintf(_('Notice feed for %s'), $this->user->nickname)));
+                        'type' => 'application/rss+xml',
+                        'href' => common_local_url('userrss',
+                         array('nickname' => $this->user->nickname)),
+                               'title' => sprintf(_('Notice feed for %s (RSS)'),
+                                 $this->user->nickname)));
+
+         $this->element('link',
+             array('rel' => 'alternate',
+                   'href' => common_local_url('api',
+                     array('apiaction' => 'statuses',
+                           'method' => 'user_timeline.atom',
+                           'argument' => $this->user->nickname)),
+                           'type' => 'application/atom+xml',
+                           'title' => sprintf(_('Notice feed for %s (Atom)'),
+                             $this->user->nickname)));
     }
 
     function extraHead()
@@ -239,7 +242,7 @@ class ShowstreamAction extends Action
         $this->elementStart('dl', 'entity_depiction');
         $this->element('dt', null, _('Photo'));
         $this->elementStart('dd');
-        $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE),
+        $this->element('img', array('src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE),
                                     'class' => 'photo avatar',
                                     'width' => AVATAR_PROFILE_SIZE,
                                     'height' => AVATAR_PROFILE_SIZE,