Fixed facebook connect nav to obey sms/twitter disabled

This commit is contained in:
Jeffery To 2009-10-09 11:25:31 +08:00
parent 2dc66035ba
commit 11e36b18cc

View File

@ -77,32 +77,34 @@ class FBCSettingsNav extends Widget
$this->action->elementStart('dd'); $this->action->elementStart('dd');
# action => array('prompt', 'title') # action => array('prompt', 'title')
$menu = $menu = array();
array('imsettings' => if (common_config('xmpp', 'enabled')) {
array(_('IM'), $menu['imsettings'] =
_('Updates by instant messenger (IM)')), array(_('IM'),
'smssettings' => _('Updates by instant messenger (IM)'));
array(_('SMS'), }
_('Updates by SMS')), if (common_config('sms', 'enabled')) {
'twittersettings' => $menu['smssettings'] =
array(_('Twitter'), array(_('SMS'),
_('Twitter integration options')), _('Updates by SMS'));
'FBConnectSettings' => }
array(_('Facebook'), if (common_config('twitter', 'enabled')) {
_('Facebook Connect settings'))); $menu['twittersettings'] =
array(_('Twitter'),
_('Twitter integration options'));
}
$menu['FBConnectSettings'] =
array(_('Facebook'),
_('Facebook Connect settings'));
$action_name = $this->action->trimmed('action'); $action_name = $this->action->trimmed('action');
$this->action->elementStart('ul', array('class' => 'nav')); $this->action->elementStart('ul', array('class' => 'nav'));
foreach ($menu as $menuaction => $menudesc) { foreach ($menu as $menuaction => $menudesc) {
if ($menuaction == 'imsettings' &&
!common_config('xmpp', 'enabled')) {
continue;
}
$this->action->menuItem(common_local_url($menuaction), $this->action->menuItem(common_local_url($menuaction),
$menudesc[0], $menudesc[0],
$menudesc[1], $menudesc[1],
$action_name === $menuaction); $action_name === $menuaction);
} }
$this->action->elementEnd('ul'); $this->action->elementEnd('ul');