diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-14 14:52:26 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-14 14:52:26 -0700 |
commit | c2dae24701a22cd2362ebe1a96828cd7945c6b5a (patch) | |
tree | f42f7a9961b131c3311800544ef113cb3c6e220a /actions/subscribers.php | |
parent | 9addfeacfdacf1eb8c6a90a636f468e4aeb0e9fe (diff) |
Break profilelist into a recipe
Expanded the ProfileList class so it worked more like a recipe. This
helps to get rid of a lot of special cases and simplifies the code. It
also makes it possible to do things like group block.
Diffstat (limited to 'actions/subscribers.php')
-rw-r--r-- | actions/subscribers.php | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/actions/subscribers.php b/actions/subscribers.php index 4482de9a7..66ac00fb1 100644 --- a/actions/subscribers.php +++ b/actions/subscribers.php @@ -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(); + } } } |