]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/subscribers.php
Merge branch '0.7.x' into 0.8.x
[quix0rs-gnu-social.git] / actions / subscribers.php
index 4482de9a7c74279b000e042012fbb927a86b5dbd..66ac00fb19aa26d64da5441d07fafec8bc08f36a 100644 (file)
@@ -130,18 +130,34 @@ class SubscribersAction extends GalleryAction
     }
 }
 
-class SubscribersList extends ProfileList
+class SubscribersList extends SubscriptionList
 {
-    function showBlockForm()
+    function newListItem($profile)
     {
-        $bf = new BlockForm($this->out, $this->profile,
-                            array('action' => 'subscribers',
-                                  'nickname' => $this->owner->nickname));
-        $bf->show();
+        return new SubscribersListItem($profile, $this->owner, $this->action);
     }
+}
 
-    function isReadOnly($args)
+class SubscribersListItem extends SubscriptionListItem
+{
+    function showActions()
     {
-        return true;
+        $this->startActions();
+        $this->showSubscribeButton();
+        // Relevant code!
+        $this->showBlockForm();
+        $this->endActions();
+    }
+
+    function showBlockForm()
+    {
+        $user = common_current_user();
+
+        if (!empty($user) && $this->owner->id == $user->id) {
+            $bf = new BlockForm($this->out, $this->profile,
+                                array('action' => 'subscribers',
+                                      'nickname' => $this->owner->nickname));
+            $bf->show();
+        }
     }
 }