1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- 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);
-
- $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);
-
- $this->out->element('label', array('for' => 'sms-'.$this->profile->id), _('SMS'));
- } else {
- $this->out->hidden('sms', $sub->sms);
- }
-
- $this->out->submit('save', _m('BUTTON','Save'));
- $this->out->elementEnd('form');
- }
- }
|