]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/tagcloudsection.php
Cannot use NoticeListemItem as type-hint as NoticeListItemAdapter exists.
[quix0rs-gnu-social.git] / lib / tagcloudsection.php
index ca72a27e521b38f161eedfffbca8759e23f34317..9f7320f2de41d750c96da518299e5ab843e4efac 100644 (file)
@@ -50,8 +50,9 @@ class TagCloudSection extends Section
     function showContent()
     {
         $tags = $this->getTags();
+        //* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . '] tags[]=' . gettype($tags));
 
-        if (!$tags instanceof Notice_tag) {
+        if (!$tags) {
             // TRANS: Content displayed in a tag cloud section if there are no tags.
             $this->out->element('p', null, _m('NOTAGS','None'));
             return false;
@@ -63,6 +64,7 @@ class TagCloudSection extends Section
         $sum = 0;
 
         while ($tags->fetch() && ++$cnt <= TAGS_PER_SECTION) {
+            // Check scope of tag to current profile (including guests)
             if ($tags->isCurrentProfileInScope()) {
                 $tw[$tags->tag] = $tags->weight;
                 $sum += $tags->weight;
@@ -117,11 +119,10 @@ class TagCloudSection extends Section
 
     function tagUrl($tag)
     {
-        if ('showstream' === $this->out->trimmed('action')) {
-            return common_local_url('showstream', array('nickname' => $this->out->profile->nickname, 'tag' => $tag));
-        } else {
-            return common_local_url('tag', array('tag' => $tag));
+        if ($this->out instanceof ShowstreamAction) {
+            return common_local_url('showstream', array('nickname' => $this->out->getTarget()->getNickname(), 'tag' => $tag));
         }
+        return common_local_url('tag', array('tag' => $tag));
     }
 
     function divId()