]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/profilelist.php
Merge branch '0.8.x' of git@gitorious.org:laconica/mainline into 0.8.x
[quix0rs-gnu-social.git] / lib / profilelist.php
index e2faf10af48ed16d1fcd5fb08726c90628b6a2fa..774538a4b611de3a892c77c313b14ba2bb4a3088 100644 (file)
@@ -61,9 +61,25 @@ class ProfileList extends Widget
     }
 
     function show()
+    {
+        $this->startList();
+        $cnt = $this->showProfiles();
+        $this->endList();
+        return $cnt;
+    }
+
+    function startList()
     {
         $this->out->elementStart('ul', 'profiles');
+    }
+
+    function endList()
+    {
+        $this->out->elementEnd('ul');
+    }
 
+    function showProfiles()
+    {
         $cnt = 0;
 
         while ($this->profile->fetch()) {
@@ -75,8 +91,6 @@ class ProfileList extends Widget
             $pli->show();
         }
 
-        $this->out->elementEnd('ul');
-
         return $cnt;
     }
 
@@ -234,8 +248,13 @@ class ProfileListItem extends Widget
                 $usf = new UnsubscribeForm($this->out, $this->profile);
                 $usf->show();
             } else {
-                $sf = new SubscribeForm($this->out, $this->profile);
-                $sf->show();
+                // Is it a local user? can't remote sub from a list
+                // XXX: make that possible!
+                $other = User::staticGet('id', $this->profile->id);
+                if (!empty($other)) {
+                    $sf = new SubscribeForm($this->out, $this->profile);
+                    $sf->show();
+                }
             }
             $this->out->elementEnd('li');
         }