only show subscribe button in profile list for local users

This commit is contained in:
Evan Prodromou 2009-07-03 10:14:02 -04:00
parent 72d0ee4e25
commit c04e3c7769

View File

@ -243,15 +243,20 @@ class ProfileListItem extends Widget
$user = common_current_user(); $user = common_current_user();
if (!empty($user) && $this->profile->id != $user->id) { if (!empty($user) && $this->profile->id != $user->id) {
$this->out->elementStart('li', 'entity_subscribe'); // Is it a local user? can't remote sub from a list
if ($user->isSubscribed($this->profile)) { // XXX: make that possible!
$usf = new UnsubscribeForm($this->out, $this->profile); $other = User::staticGet('id', $this->profile->id);
$usf->show(); if (!empty($other)) {
} else { $this->out->elementStart('li', 'entity_subscribe');
$sf = new SubscribeForm($this->out, $this->profile); if ($user->isSubscribed($this->profile)) {
$sf->show(); $usf = new UnsubscribeForm($this->out, $this->profile);
$usf->show();
} else {
$sf = new SubscribeForm($this->out, $this->profile);
$sf->show();
}
$this->out->elementEnd('li');
} }
$this->out->elementEnd('li');
} }
} }