From 6a2185a26b6d9e7b41fb0da1043000d677714141 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 21 Oct 2009 22:02:10 +0000 Subject: [PATCH] Make paths and class loading work right --- plugins/Facebook/FacebookPlugin.php | 39 +++++++++++++---------- plugins/Facebook/facebookqueuehandler.php | 5 ++- plugins/Facebook/facebooksettings.php | 2 +- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/plugins/Facebook/FacebookPlugin.php b/plugins/Facebook/FacebookPlugin.php index cf6781cfaf..bcd1a7c742 100644 --- a/plugins/Facebook/FacebookPlugin.php +++ b/plugins/Facebook/FacebookPlugin.php @@ -34,12 +34,6 @@ if (!defined('STATUSNET')) { define("FACEBOOK_CONNECT_SERVICE", 3); require_once INSTALLDIR . '/plugins/Facebook/facebookutil.php'; -require_once INSTALLDIR . '/plugins/Facebook/FBConnectAuth.php'; -require_once INSTALLDIR . '/plugins/Facebook/FBConnectLogin.php'; -require_once INSTALLDIR . '/plugins/Facebook/FBConnectSettings.php'; -require_once INSTALLDIR . '/plugins/Facebook/FBCLoginGroupNav.php'; -require_once INSTALLDIR . '/plugins/Facebook/FBCSettingsNav.php'; -require_once INSTALLDIR . '/plugins/Facebook/FBC_XDReceiver.php'; /** * Facebook plugin to add a StatusNet Facebook application @@ -69,11 +63,11 @@ class FacebookPlugin extends Plugin // Facebook App stuff - $m->connect('facebook', array('action' => 'facebookhome')); - $m->connect('facebook/index.php', array('action' => 'facebookhome')); - $m->connect('facebook/settings.php', array('action' => 'facebooksettings')); - $m->connect('facebook/invite.php', array('action' => 'facebookinvite')); - $m->connect('facebook/remove', array('action' => 'facebookremove')); + $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/invite.php', array('action' => 'facebookinvite')); + $m->connect('facebook/app/remove', array('action' => 'facebookremove')); // Facebook Connect stuff @@ -104,12 +98,25 @@ class FacebookPlugin extends Plugin include_once INSTALLDIR . '/plugins/Facebook/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; return false; + case 'FBConnectAuthAction': + case 'FBConnectLoginAction': + case 'FBConnectSettingsAction': + case 'FBC_XDReceiverAction': + include_once INSTALLDIR . '/plugins/Facebook/' . + mb_substr($cls, 0, -6) . '.php'; + return false; + case 'FBCLoginGroupNav': + include_once INSTALLDIR . '/plugins/Facebook/FBCLoginGroupNav.php'; + return false; + case 'FBCSettingsNav': + include_once INSTALLDIR . '/plugins/Facebook/FBCSettingsNav.php'; + return false; default: return true; } } - // Add in xmlns:fb + // Add in xmlns:fb function onStartShowHTML($action) { @@ -143,7 +150,7 @@ class FacebookPlugin extends Plugin } } - // Note: this script needs to appear in the + // Note: this script needs to appear in the function onEndShowScripts($action) { @@ -204,7 +211,7 @@ class FacebookPlugin extends Plugin } - // Note: this script needs to appear as close as possible to + // Note: this script needs to appear as close as possible to function onEndShowFooter($action) { @@ -220,7 +227,7 @@ class FacebookPlugin extends Plugin } } - /** + /** * Does the Action we're plugged into require the FB Scripts? We only * want to output FB namespace, scripts, CSS, etc. on the pages that * really need them. @@ -466,4 +473,4 @@ class FacebookPlugin extends Plugin return true; } -} \ No newline at end of file +} diff --git a/plugins/Facebook/facebookqueuehandler.php b/plugins/Facebook/facebookqueuehandler.php index 30de59efb7..e4ae7d4ee7 100755 --- a/plugins/Facebook/facebookqueuehandler.php +++ b/plugins/Facebook/facebookqueuehandler.php @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); +define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..')); $shortoptions = 'i::'; $longoptions = array('id::'); @@ -30,8 +30,7 @@ Daemon script for pushing new notices to Facebook. END_OF_FACEBOOK_HELP; -require_once INSTALLDIR.'/scripts/commandline.inc'; - +require_once INSTALLDIR . '/scripts/commandline.inc'; require_once INSTALLDIR . '/plugins/Facebook/facebookutil.php'; require_once INSTALLDIR . '/lib/queuehandler.php'; diff --git a/plugins/Facebook/facebooksettings.php b/plugins/Facebook/facebooksettings.php index 4bfdfc0efc..2f182e3681 100644 --- a/plugins/Facebook/facebooksettings.php +++ b/plugins/Facebook/facebooksettings.php @@ -21,7 +21,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR . '/lib/facebookaction.php'; +require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; class FacebooksettingsAction extends FacebookAction { -- 2.39.5