Fix for disappearing 'connect' menu if xmpp and sms are disabled.

All 'connect' menu panels used to be optional, so Action tried to
figure out what the first item on the 'connect' menu should be.
This is no longer necessary because we have the non-optional OAuth
client connections panel now, which is not optional and can't be
turned off.
This commit is contained in:
Zach Copley 2010-03-03 10:19:14 -08:00
parent f3cea24304
commit 61ada4558d
3 changed files with 3 additions and 31 deletions

View File

@ -420,13 +420,6 @@ class Action extends HTMLOutputter // lawsuit
function showPrimaryNav() function showPrimaryNav()
{ {
$user = common_current_user(); $user = common_current_user();
$connect = '';
if (common_config('xmpp', 'enabled')) {
$connect = 'imsettings';
} else if (common_config('sms', 'enabled')) {
$connect = 'smssettings';
}
$this->elementStart('dl', array('id' => 'site_nav_global_primary')); $this->elementStart('dl', array('id' => 'site_nav_global_primary'));
$this->element('dt', null, _('Primary site navigation')); $this->element('dt', null, _('Primary site navigation'));
$this->elementStart('dd'); $this->elementStart('dd');
@ -437,10 +430,8 @@ class Action extends HTMLOutputter // lawsuit
_('Home'), _('Personal profile and friends timeline'), false, 'nav_home'); _('Home'), _('Personal profile and friends timeline'), false, 'nav_home');
$this->menuItem(common_local_url('profilesettings'), $this->menuItem(common_local_url('profilesettings'),
_('Account'), _('Change your email, avatar, password, profile'), false, 'nav_account'); _('Account'), _('Change your email, avatar, password, profile'), false, 'nav_account');
if ($connect) { $this->menuItem(common_local_url('oauthconnectionssettings'),
$this->menuItem(common_local_url($connect), _('Connect'), _('Connect to services'), false, 'nav_connect');
_('Connect'), _('Connect to services'), false, 'nav_connect');
}
if ($user->hasRight(Right::CONFIGURESITE)) { if ($user->hasRight(Right::CONFIGURESITE)) {
$this->menuItem(common_local_url('siteadminpanel'), $this->menuItem(common_local_url('siteadminpanel'),
_('Admin'), _('Change site configuration'), false, 'nav_admin'); _('Admin'), _('Change site configuration'), false, 'nav_admin');

View File

@ -436,16 +436,7 @@ class FacebookPlugin extends Plugin
function onStartPrimaryNav($action) function onStartPrimaryNav($action)
{ {
if (self::hasKeys()) { if (self::hasKeys()) {
$user = common_current_user(); $user = common_current_user();
$connect = 'FBConnectSettings';
if (common_config('xmpp', 'enabled')) {
$connect = 'imsettings';
} else if (common_config('sms', 'enabled')) {
$connect = 'smssettings';
}
if (!empty($user)) { if (!empty($user)) {
$fbuid = $this->loggedIn(); $fbuid = $this->loggedIn();
@ -472,7 +463,6 @@ class FacebookPlugin extends Plugin
'src' => $iconurl)); 'src' => $iconurl));
$action->elementEnd('li'); $action->elementEnd('li');
} }
} }
} }

View File

@ -307,23 +307,14 @@ class MobileProfilePlugin extends WAP20Plugin
function _showPrimaryNav($action) function _showPrimaryNav($action)
{ {
$user = common_current_user(); $user = common_current_user();
$connect = '';
if (common_config('xmpp', 'enabled')) {
$connect = 'imsettings';
} else if (common_config('sms', 'enabled')) {
$connect = 'smssettings';
}
$action->elementStart('ul', array('id' => 'site_nav_global_primary')); $action->elementStart('ul', array('id' => 'site_nav_global_primary'));
if ($user) { if ($user) {
$action->menuItem(common_local_url('all', array('nickname' => $user->nickname)), $action->menuItem(common_local_url('all', array('nickname' => $user->nickname)),
_('Home')); _('Home'));
$action->menuItem(common_local_url('profilesettings'), $action->menuItem(common_local_url('profilesettings'),
_('Account')); _('Account'));
if ($connect) { $action->menuItem(common_local_url('oauthconnectionssettings'),
$action->menuItem(common_local_url($connect),
_('Connect')); _('Connect'));
}
if ($user->hasRight(Right::CONFIGURESITE)) { if ($user->hasRight(Right::CONFIGURESITE)) {
$action->menuItem(common_local_url('siteadminpanel'), $action->menuItem(common_local_url('siteadminpanel'),
_('Admin'), _('Change site configuration'), false, 'nav_admin'); _('Admin'), _('Change site configuration'), false, 'nav_admin');