summaryrefslogtreecommitdiff
path: root/lib/connectsettingsaction.php
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2009-08-07 01:18:17 +0800
committerJeffery To <jeffery.to@gmail.com>2009-08-07 01:18:17 +0800
commit93f585446ebaa4a9347b6e6f77f58ab023b5b51c (patch)
tree78579bf89c17cc946539568426f650ea70af6500 /lib/connectsettingsaction.php
parentc8c2d9d7c93f40e7ac81c6211f8ba4c3f6ae91d9 (diff)
Added configuration options to enable/disable SMS and Twitter integration.
This disables the IM, SMS and Twitter settings pages and queue handlers depending on the config options.
Diffstat (limited to 'lib/connectsettingsaction.php')
-rw-r--r--lib/connectsettingsaction.php30
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/connectsettingsaction.php b/lib/connectsettingsaction.php
index 30629680e..02c468a35 100644
--- a/lib/connectsettingsaction.php
+++ b/lib/connectsettingsaction.php
@@ -99,25 +99,27 @@ class ConnectSettingsNav extends Widget
function show()
{
# action => array('prompt', 'title')
- $menu =
- array('imsettings' =>
- array(_('IM'),
- _('Updates by instant messenger (IM)')),
- 'smssettings' =>
- array(_('SMS'),
- _('Updates by SMS')),
- 'twittersettings' =>
- array(_('Twitter'),
- _('Twitter integration options')));
+ $menu = array();
+ if (common_config('xmpp', 'enabled')) {
+ $menu['imsettings'] =
+ array(_('IM'),
+ _('Updates by instant messenger (IM)'));
+ }
+ if (common_config('sms', 'enabled')) {
+ $menu['smssettings'] =
+ array(_('SMS'),
+ _('Updates by SMS'));
+ }
+ if (common_config('twitter', 'enabled')) {
+ $menu['twittersettings'] =
+ array(_('Twitter'),
+ _('Twitter integration options'));
+ }
$action_name = $this->action->trimmed('action');
$this->action->elementStart('ul', array('class' => 'nav'));
foreach ($menu as $menuaction => $menudesc) {
- if ($menuaction == 'imsettings' &&
- !common_config('xmpp', 'enabled')) {
- continue;
- }
$this->action->menuItem(common_local_url($menuaction),
$menudesc[0],
$menudesc[1],