X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FFBConnect%2FFBConnectPlugin.php;h=0dacf90122dcfa8653337a98324f1d73d2aee7f3;hb=78e5a5980a21c04cfdacb993ca3c37bf65d21783;hp=593b49b4ed4810ec391387d0e78ffa909c60cbc6;hpb=df86aa721455fde537608d5faeaaf92075afb738;p=quix0rs-gnu-social.git diff --git a/plugins/FBConnect/FBConnectPlugin.php b/plugins/FBConnect/FBConnectPlugin.php index 593b49b4ed..0dacf90122 100644 --- a/plugins/FBConnect/FBConnectPlugin.php +++ b/plugins/FBConnect/FBConnectPlugin.php @@ -102,7 +102,7 @@ class FBConnectPlugin extends Plugin // Note: this script needs to appear in the - function onStartShowHeader($action) + function onEndShowScripts($action) { if ($this->reqFbScripts($action)) { @@ -115,26 +115,48 @@ class FBConnectPlugin extends Plugin // XXX: Facebook says we don't need this FB_RequireFeatures(), // but we actually do, for IE and Safari. Gar. - $html = sprintf('', $apikey, - $login_url, $logout_url); - - $action->raw($html); + $js = ''; + + $js = sprintf($js, $apikey, $login_url, $logout_url); + + // Compress the bugger down a bit + $js = str_replace(' ', '', $js); + + $action->raw(" $js"); // leading two spaces to make it line up } } @@ -150,7 +172,6 @@ class FBConnectPlugin extends Plugin function onEndShowStatusNetStyles($action) { - if ($this->reqFbScripts($action)) { $action->cssLink('plugins/FBConnect/FBConnectPlugin.css'); } @@ -232,6 +253,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)) { @@ -261,59 +290,9 @@ class FBConnectPlugin extends Plugin $action->elementEnd('li'); } + } - $action->menuItem(common_local_url('all', array('nickname' => $user->nickname)), - _('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'); - } - if (common_config('invite', 'enabled')) { - $action->menuItem(common_local_url('invite'), - _('Invite'), - sprintf(_('Invite friends and colleagues to join you on %s'), - common_config('site', 'name')), - false, 'nav_invitecontact'); - } - - // Need to override the Logout link to make it do FB stuff - if (!empty($fbuid)) { - - $logout_url = common_local_url('logout'); - $title = _('Logout from the site'); - $text = _('Logout'); - - $html = sprintf('', - $title, $logout_url, $text); - - $action->raw($html); - - } else { - $action->menuItem(common_local_url('logout'), - _('Logout'), _('Logout from the site'), false, 'nav_logout'); - } - } - else { - 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'); - } - - $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'); - - return false; + return true; } function onStartShowLocalNavBlock($action) @@ -342,7 +321,7 @@ class FBConnectPlugin extends Plugin } function onStartLogout($action) -{ + { $action->logout(); $fbuid = $this->loggedIn();