diff options
author | Zach Copley <zach@status.net> | 2009-11-25 00:43:20 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2009-11-25 00:43:20 +0000 |
commit | f12972a50fa218835f57861583e28ae42d944e6b (patch) | |
tree | d0670bee45fed3523184a007105dc844a3167e74 /plugins/Facebook/FacebookPlugin.php | |
parent | b20b59e9eaf8db1a5a2b26b697b03abfa98d0583 (diff) |
Facebook plugin no longer takes over Login and Connect settings nav menus
Diffstat (limited to 'plugins/Facebook/FacebookPlugin.php')
-rw-r--r-- | plugins/Facebook/FacebookPlugin.php | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/plugins/Facebook/FacebookPlugin.php b/plugins/Facebook/FacebookPlugin.php index c5b9298f7..047477d9c 100644 --- a/plugins/Facebook/FacebookPlugin.php +++ b/plugins/Facebook/FacebookPlugin.php @@ -394,37 +394,43 @@ class FacebookPlugin extends Plugin return true; } - /** - * Alter the local nav menu to have a Facebook Connect login and - * settings pages + /* + * Add a login tab for Facebook Connect * - * @param Action $action the current action + * @param Action &action the current action * * @return void - * */ - function onStartShowLocalNavBlock($action) + function onEndLoginGroupNav(&$action) { - $action_name = get_class($action); - $login_actions = array('LoginAction', 'RegisterAction', - 'OpenidloginAction', 'FBConnectLoginAction'); + $action_name = $action->trimmed('action'); - if (in_array($action_name, $login_actions)) { - $nav = new FBCLoginGroupNav($action); - $nav->show(); - return false; - } + $action->menuItem(common_local_url('FBConnectLogin'), + _('Facebook'), + _('Login or register using Facebook'), + 'FBConnectLogin' === $action_name); - $connect_actions = array('SmssettingsAction', 'ImsettingsAction', - 'TwittersettingsAction', 'FBConnectSettingsAction'); + return true; + } - if (in_array($action_name, $connect_actions)) { - $nav = new FBCSettingsNav($action); - $nav->show(); - return false; - } + /* + * Add a tab for managing Facebook Connect settings + * + * @param Action &action the current action + * + * @return void + */ + + function onEndConnectSettingsNav(&$action) + { + $action_name = $action->trimmed('action'); + + $action->menuItem(common_local_url('FBConnectSettings'), + _('Facebook'), + _('Facebook Connect Settings'), + $action_name === 'FBConnectSettings'); return true; } |