diff --git a/plugins/Facebook/FacebookPlugin.php b/plugins/Facebook/FacebookPlugin.php index bcd1a7c742..fc3adcfadf 100644 --- a/plugins/Facebook/FacebookPlugin.php +++ b/plugins/Facebook/FacebookPlugin.php @@ -65,7 +65,8 @@ class FacebookPlugin extends Plugin $m->connect('facebook/app', array('action' => 'facebookhome')); $m->connect('facebook/app/index.php', array('action' => 'facebookhome')); - $m->connect('facebook/app/settings.php', array('action' => 'facebooksettings')); + $m->connect('facebook/app/settings.php', + array('action' => 'facebooksettings')); $m->connect('facebook/app/invite.php', array('action' => 'facebookinvite')); $m->connect('facebook/app/remove', array('action' => 'facebookremove')); @@ -87,6 +88,7 @@ class FacebookPlugin extends Plugin * @return boolean hook return * */ + function onAutoload($cls) { switch ($cls) { @@ -116,7 +118,15 @@ class FacebookPlugin extends Plugin } } - // Add in xmlns:fb + /** + * Override normal HTML output to force the content type to + * text/html and add in xmlns:fb + * + * @param Action $action the current action + * + * @return void + */ + function onStartShowHTML($action) { @@ -128,6 +138,7 @@ class FacebookPlugin extends Plugin // text/html even though Facebook Connect uses XHTML. This is // A bug in Facebook Connect, and this is a temporary solution // until they fix their JavaScript libs. + header('Content-Type: text/html'); $action->extraHeaders(); @@ -150,22 +161,31 @@ class FacebookPlugin extends Plugin } } - // Note: this script needs to appear in the + /** + * Add in the Facebook Connect JavaScript stuff + * + * Note: this script needs to appear in the + * + * @param Action $action the current action + * + * @return void + * + */ function onEndShowScripts($action) { if ($this->reqFbScripts($action)) { - $apikey = common_config('facebook', 'apikey'); + $apikey = common_config('facebook', 'apikey'); $plugin_path = common_path('plugins/Facebook'); - $login_url = common_local_url('FBConnectAuth'); + $login_url = common_local_url('FBConnectAuth'); $logout_url = common_local_url('logout'); // XXX: Facebook says we don't need this FB_RequireFeatures(), // but we actually do, for IE and Safari. Gar. - $js = '