summaryrefslogtreecommitdiff
path: root/actions/subscriptions.php
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2009-08-07 01:34:36 +0800
committerJeffery To <jeffery.to@gmail.com>2009-08-07 01:34:36 +0800
commitc261a645a16fc0498e338cef4144b276a481646c (patch)
tree33a32fc4748a7dff7531d9db6f9ab6525c89d528 /actions/subscriptions.php
parent93f585446ebaa4a9347b6e6f77f58ab023b5b51c (diff)
Hide subscription controls for disabled services (IM, SMS)
Diffstat (limited to 'actions/subscriptions.php')
-rw-r--r--actions/subscriptions.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/actions/subscriptions.php b/actions/subscriptions.php
index 42bdae10f..0724471ff 100644
--- a/actions/subscriptions.php
+++ b/actions/subscriptions.php
@@ -174,14 +174,26 @@ class SubscriptionsListItem extends SubscriptionListItem
return;
}
+ if (!common_config('xmpp', 'enabled') && !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);
- $this->out->checkbox('jabber', _('Jabber'), $sub->jabber);
- $this->out->checkbox('sms', _('SMS'), $sub->sms);
+ if (common_config('xmpp', 'enabled')) {
+ $this->out->checkbox('jabber', _('Jabber'), $sub->jabber);
+ } else {
+ $this->out->hidden('jabber', $sub->jabber);
+ }
+ if (common_config('sms', 'enabled')) {
+ $this->out->checkbox('sms', _('SMS'), $sub->sms);
+ } else {
+ $this->out->hidden('sms', $sub->sms);
+ }
$this->out->submit('save', _('Save'));
$this->out->elementEnd('form');
return;