]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/peopletagsforuser.php
Added type-hint (checked!)
[quix0rs-gnu-social.git] / actions / peopletagsforuser.php
index cc281339400d1f2e033b97ea18055b7f4208e977..9dcee09f1a1b44ca9eeb1789f3ed761703c39f27 100644 (file)
@@ -38,7 +38,7 @@ class PeopletagsforuserAction extends Action
     var $page = null;
     var $tagged = null;
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return true;
     }
@@ -54,11 +54,16 @@ class PeopletagsforuserAction extends Action
         }
     }
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
-        $nickname_arg = $this->arg('nickname');
+        if (common_config('singleuser', 'enabled')) {
+            $nickname_arg = User::singleUserNickname();
+        } else {
+            $nickname_arg = $this->arg('nickname');
+        }
+
         $nickname = common_canonical_nickname($nickname_arg);
 
         // Permanent redirect on non-canonical nickname
@@ -69,15 +74,13 @@ class PeopletagsforuserAction extends Action
                 $args['page'] = $this->arg['page'];
             }
             common_redirect(common_local_url('peopletagsforuser', $args), 301);
-            return false;
         }
 
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
 
         if (!$this->user) {
             // TRANS: Client error displayed trying to perform an action related to a non-existing user.
             $this->clientError(_('No such user.'), 404);
-            return false;
         }
 
         $this->tagged = $this->user->getProfile();
@@ -85,7 +88,6 @@ class PeopletagsforuserAction extends Action
         if (!$this->tagged) {
             // TRANS: Error message displayed when referring to a user without a profile.
             $this->serverError(_('User has no profile.'));
-            return false;
         }
 
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
@@ -93,7 +95,7 @@ class PeopletagsforuserAction extends Action
         return true;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         $this->showPage();
@@ -111,7 +113,7 @@ class PeopletagsforuserAction extends Action
                     '(http://en.wikipedia.org/wiki/Micro-blogging) service ' .
                     'based on the Free Software [StatusNet](http://status.net/) tool. ' .
                     'You can easily keep track of what they ' .
-                    'are doing by subscribing to the tag\'s timeline.' ), $this->tagged->nickname);
+                    'are doing by subscribing to the list\'s timeline.' ), $this->tagged->nickname);
         $this->elementStart('div', array('id' => 'anon_notice'));
         $this->raw(common_markup_to_html($notice));
         $this->elementEnd('div');