diff options
author | Jeffery To <jeffery.to@gmail.com> | 2009-06-26 15:31:42 +0800 |
---|---|---|
committer | Jeffery To <jeffery.to@gmail.com> | 2009-06-26 15:31:42 +0800 |
commit | 6328add622641e5f5721cc34d27d4d872c86a561 (patch) | |
tree | 31be2d91646bc3deed194f7c7e8ad64c9ee17971 /actions/subscriptions.php | |
parent | 6d308f6ffe3f894c60fafaea3ceaef86d30dfe1d (diff) | |
parent | 97ee517680979bf12e82eab99ecf943712fe97c9 (diff) |
Merge branch '0.8.x' into invite-enabled
Diffstat (limited to 'actions/subscriptions.php')
-rw-r--r-- | actions/subscriptions.php | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/actions/subscriptions.php b/actions/subscriptions.php index 095b18ad8..4124abea4 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -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')); |