]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'refs/merge-requests/1738' of git://gitorious.org/statusnet/mainline...
authorCraig Andrews <candrews@integralblue.com>
Sun, 11 Oct 2009 17:17:59 +0000 (13:17 -0400)
committerCraig Andrews <candrews@integralblue.com>
Sun, 11 Oct 2009 17:17:59 +0000 (13:17 -0400)
lib/common.php
plugins/FBConnect/FBCLoginGroupNav.php
plugins/FBConnect/FBCSettingsNav.php
plugins/FBConnect/FBConnectPlugin.php

index 88d77732f4cda50508fe33e94585048baf56454c..0b4e031845b287723eeeceb0ae3b72a5f855b2fc 100644 (file)
@@ -196,15 +196,14 @@ $config =
         array('enabled' => true),
         'sms' =>
         array('enabled' => true),
-        'twitter' =>
-        array('enabled' => true),
         'twitterbridge' =>
         array('enabled' => false),
         'integration' =>
         array('source' => 'StatusNet', # source attribute for Twitter
               'taguri' => $_server.',2009'), # base for tag URIs
        'twitter' =>
-       array('consumer_key'    => null,
+       array('enabled'         => true,
+              'consumer_key'    => null,
              'consumer_secret' => null),
         'memcached' =>
         array('enabled' => false,
index 6e12c20403cc0a9e5a52038d0b2e131672134102..81b2520a4c628e2830b66657878f82252cd8fe4c 100644 (file)
@@ -78,16 +78,20 @@ class FBCLoginGroupNav extends Widget
         // action => array('prompt', 'title')
         $menu = array();
 
-        $menu['login'] = array(_('Login'),
-                         _('Login with a username and password'));
-
-        if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
-            $menu['register'] = array(_('Register'),
-                                _('Sign up for a new account'));
+        if (!common_config('site','openidonly')) {
+            $menu['login'] = array(_('Login'),
+                             _('Login with a username and password'));
+
+            if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
+                $menu['register'] = array(_('Register'),
+                                    _('Sign up for a new account'));
+            }
         }
 
-        $menu['openidlogin'] = array(_('OpenID'),
-                               _('Login or register with OpenID'));
+        if (common_config('openid', 'enabled')) {
+            $menu['openidlogin'] = array(_('OpenID'),
+                                   _('Login or register with OpenID'));
+        }
 
         $menu['FBConnectLogin'] = array(_('Facebook'),
                                _('Login or register using Facebook'));
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');
index cb19b054610abb9f8961a3e88b6e0ba727678215..ff74aade45b9301b1934afc45392dd207fc4151a 100644 (file)
@@ -232,6 +232,14 @@ class FBConnectPlugin extends Plugin
     {
 
         $user = common_current_user();
+        $connect = 'FBConnectSettings';
+        if (common_config('xmpp', 'enabled')) {
+            $connect = 'imsettings';
+        } else if (common_config('sms', 'enabled')) {
+            $connect = 'smssettings';
+        } else if (common_config('twitter', 'enabled')) {
+            $connect = 'twittersettings';
+        }
 
         if (!empty($user)) {
 
@@ -266,13 +274,8 @@ class FBConnectPlugin extends Plugin
                 _('Home'), _('Personal profile and friends timeline'), false, 'nav_home');
             $action->menuItem(common_local_url('profilesettings'),
                 _('Account'), _('Change your email, avatar, password, profile'), false, 'nav_account');
-            if (common_config('xmpp', 'enabled')) {
-                $action->menuItem(common_local_url('imsettings'),
-                    _('Connect'), _('Connect to IM, SMS, Twitter'), false, 'nav_connect');
-            } else {
-             $action->menuItem(common_local_url('smssettings'),
-                 _('Connect'), _('Connect to SMS, Twitter'), false, 'nav_connect');
-            }
+            $action->menuItem(common_local_url($connect),
+                _('Connect'), _('Connect to services'), false, 'nav_connect');
             if (common_config('invite', 'enabled')) {
                 $action->menuItem(common_local_url('invite'),
                     _('Invite'),
@@ -300,18 +303,25 @@ class FBConnectPlugin extends Plugin
              }
          }
          else {
-             if (!common_config('site', 'closed')) {
-                 $action->menuItem(common_local_url('register'),
-                     _('Register'), _('Create an account'), false, 'nav_register');
+             if (!common_config('site', 'openidonly')) {
+                 if (!common_config('site', 'closed')) {
+                     $action->menuItem(common_local_url('register'),
+                         _('Register'), _('Create an account'), false, 'nav_register');
+                 }
+                 $action->menuItem(common_local_url('login'),
+                     _('Login'), _('Login to the site'), false, 'nav_login');
+             } else {
+                 $this->menuItem(common_local_url('openidlogin'),
+                                 _('OpenID'), _('Login with OpenID'), false, 'nav_openid');
              }
-             $action->menuItem(common_local_url('login'),
-                 _('Login'), _('Login to the site'), false, 'nav_login');
          }
 
          $action->menuItem(common_local_url('doc', array('title' => 'help')),
              _('Help'), _('Help me!'), false, 'nav_help');
-         $action->menuItem(common_local_url('peoplesearch'),
-             _('Search'), _('Search for people or text'), false, 'nav_search');
+         if ($user || !common_config('site', 'private')) {
+             $action->menuItem(common_local_url('peoplesearch'),
+                 _('Search'), _('Search for people or text'), false, 'nav_search');
+         }
 
         // We are replacing the primary nav entirely; give other
         // plugins a chance to handle it here.