]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/subscriptions.php
jabberqueuehandler uses commandline stuff
[quix0rs-gnu-social.git] / actions / subscriptions.php
index 095b18ad87db49b97f1c16746d3a7366f6b0f7a4..4124abea4d2e77e82dbde71c296f0cbff526a02c 100644 (file)
@@ -137,22 +137,46 @@ class SubscriptionsAction extends GalleryAction
     }
 }
 
-class SubscriptionsList extends ProfileList
+// XXX SubscriptionsList and SubscriptionList are dangerously close
+
+class SubscriptionsList extends SubscriptionList
 {
-    function showOwnerControls($profile)
+    function newListItem($profile)
+    {
+        return new SubscriptionsListItem($profile, $this->owner, $this->action);
+    }
+}
+
+class SubscriptionsListItem extends SubscriptionListItem
+{
+    function showProfile()
+    {
+        $this->startProfile();
+        $this->showAvatar();
+        $this->showFullName();
+        $this->showLocation();
+        $this->showHomepage();
+        $this->showBio();
+        $this->showTags();
+        // Relevant portion!
+        $this->showOwnerControls();
+        $this->endProfile();
+    }
+
+    function showOwnerControls()
     {
         $sub = Subscription::pkeyGet(array('subscriber' => $this->owner->id,
-                                           'subscribed' => $profile->id));
+                                           'subscribed' => $this->profile->id));
         if (!$sub) {
             return;
         }
 
-        $this->out->elementStart('form', array('id' => 'subedit-' . $profile->id,
+        $this->out->elementStart('form', array('id' => 'subedit-' . $this->profile->id,
                                           'method' => 'post',
                                           'class' => 'form_subscription_edit',
                                           'action' => common_local_url('subedit')));
         $this->out->hidden('token', common_session_token());
-        $this->out->hidden('profile', $profile->id);
+        $this->out->hidden('profile', $this->profile->id);
         $this->out->checkbox('jabber', _('Jabber'), $sub->jabber);
         $this->out->checkbox('sms', _('SMS'), $sub->sms);
         $this->out->submit('save', _('Save'));