]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/FBConnect/FBCLoginGroupNav.php
Extract out Facebook app stuff into a plugin
[quix0rs-gnu-social.git] / plugins / FBConnect / FBCLoginGroupNav.php
index 9aa01a0940a5f15e2cbb83c1d46b642464726136..81b2520a4c628e2830b66657878f82252cd8fe4c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
  *
  * Menu for login group of actions
  *
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * @category  Menu
- * @package   Laconica
- * @author    Evan Prodromou <evan@controlyourself.ca>
- * @author    Zach Copley <zach@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @author    Zach Copley <zach@status.net>
+ * @copyright 2009 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link      http://laconi.ca/
+ * @link      http://status.net/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -38,11 +38,11 @@ require_once INSTALLDIR . '/lib/widget.php';
  * Menu for login group of actions
  *
  * @category Output
- * @package  Laconica
- * @author   Evan Prodromou <evan@controlyourself.ca>
- * @author   Zach Copley <zach@controlyourself.ca>
+ * @package  StatusNet
+ * @author   Evan Prodromou <evan@status.net>
+ * @author   Zach Copley <zach@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link     http://laconi.ca/
+ * @link     http://status.net/
  *
  * @see      Widget
  */
@@ -71,26 +71,28 @@ class FBCLoginGroupNav extends Widget
 
     function show()
     {
-        common_debug('FBCLoginGroupNav');
-        
         $this->action->elementStart('dl', array('id' => 'site_nav_local_views'));
         $this->action->element('dt', null, _('Local views'));
         $this->action->elementStart('dd');
-        
+
         // 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'));
+            }
+        }
+
+        if (common_config('openid', 'enabled')) {
+            $menu['openidlogin'] = array(_('OpenID'),
+                                   _('Login or register with OpenID'));
         }
-        
-        $menu['openidlogin'] = array(_('OpenID'),
-                               _('Login or register with OpenID'));
-                               
+
         $menu['FBConnectLogin'] = array(_('Facebook'),
                                _('Login or register using Facebook'));
 
@@ -105,7 +107,7 @@ class FBCLoginGroupNav extends Widget
         }
 
         $this->action->elementEnd('ul');
-        
+
         $this->action->elementEnd('dd');
         $this->action->elementEnd('dl');
     }