X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fsubscriptions.php;h=6e9e163d332afce567aa394ff1a45b044aa15b3a;hb=515682c0cd3b7000fb02c7b79d759c347f57da09;hp=231a697230601822f3eaf3c4ff2f28fad80de05e;hpb=53fb39a1d02fe26a7393d25b199f4f445c8da328;p=quix0rs-gnu-social.git diff --git a/actions/subscriptions.php b/actions/subscriptions.php index 231a697230..6e9e163d33 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -28,9 +28,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } /** * A list of the user's subscriptions @@ -60,7 +58,7 @@ class SubscriptionsAction extends GalleryAction function showPageNotice() { - if ($this->scoped instanceof Profile && $this->scoped->id === $this->target->id) { + if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) { $this->element('p', null, // TRANS: Page notice for page with an overview of all subscriptions // TRANS: of the logged in user's own profile. @@ -156,71 +154,3 @@ class SubscriptionsAction extends GalleryAction $this->target->getNickname()))); } } - -// XXX SubscriptionsList and SubscriptionList are dangerously close - -class SubscriptionsList extends SubscriptionList -{ - function newListItem($profile) - { - return new SubscriptionsListItem($profile, $this->owner, $this->action); - } -} - -class SubscriptionsListItem extends SubscriptionListItem -{ - function showOwnerControls() - { - $sub = Subscription::pkeyGet(array('subscriber' => $this->owner->id, - 'subscribed' => $this->profile->id)); - if (!$sub) { - return; - } - - $transports = array(); - Event::handle('GetImTransports', array(&$transports)); - if (!$transports && !common_config('sms', 'enabled')) { - return; - } - - $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', $this->profile->id); - if ($transports) { - $attrs = array('name' => 'jabber', - 'type' => 'checkbox', - 'class' => 'checkbox', - 'id' => 'jabber-'.$this->profile->id); - if ($sub->jabber) { - $attrs['checked'] = 'checked'; - } - - $this->out->element('input', $attrs); - // TRANS: Checkbox label for enabling IM messages for a profile in a subscriptions list. - $this->out->element('label', array('for' => 'jabber-'.$this->profile->id), _m('LABEL','IM')); - } else { - $this->out->hidden('jabber', $sub->jabber); - } - if (common_config('sms', 'enabled')) { - $attrs = array('name' => 'sms', - 'type' => 'checkbox', - 'class' => 'checkbox', - 'id' => 'sms-'.$this->profile->id); - if ($sub->sms) { - $attrs['checked'] = 'checked'; - } - - $this->out->element('input', $attrs); - // TRANS: Checkbox label for enabling SMS messages for a profile in a subscriptions list. - $this->out->element('label', array('for' => 'sms-'.$this->profile->id), _('SMS')); - } else { - $this->out->hidden('sms', $sub->sms); - } - // TRANS: Save button for settings for a profile in a subscriptions list. - $this->out->submit('save', _m('BUTTON','Save')); - $this->out->elementEnd('form'); - } -}