]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fixed facebook connect nav to obey sms/twitter disabled
authorJeffery To <jeffery.to@gmail.com>
Fri, 9 Oct 2009 03:25:31 +0000 (11:25 +0800)
committerJeffery To <jeffery.to@gmail.com>
Fri, 9 Oct 2009 03:25:31 +0000 (11:25 +0800)
plugins/FBConnect/FBCSettingsNav.php

index 29724d6bdfa6e2227ec28b9fe468d493e148c658..ed02371e2531a12e5ea80602390451f7b3f17a5b 100644 (file)
@@ -77,32 +77,34 @@ class FBCSettingsNav extends Widget
         $this->action->elementStart('dd');
 
         # 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')),
-                'FBConnectSettings' =>
-                array(_('Facebook'),
-                      _('Facebook Connect settings')));
+        $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'));
+        }
+        $menu['FBConnectSettings'] =
+          array(_('Facebook'),
+                _('Facebook Connect settings'));
 
         $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],
-                                   $action_name === $menuaction);
+                                    $menudesc[0],
+                                    $menudesc[1],
+                                    $action_name === $menuaction);
         }
 
         $this->action->elementEnd('ul');