X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FFacebookBridge%2FFacebookBridgePlugin.php;h=83170396d2f77a1d2df8c6b13221fa348426746b;hb=3f28b17c86c4cd88d4f39629ea8a89ec3a820790;hp=289f219112a9e78645a4c77f6dd7f92f5c58b5a6;hpb=206c09068884f701d9dc295c851a1216c5839ff3;p=quix0rs-gnu-social.git diff --git a/plugins/FacebookBridge/FacebookBridgePlugin.php b/plugins/FacebookBridge/FacebookBridgePlugin.php index 289f219112..83170396d2 100644 --- a/plugins/FacebookBridge/FacebookBridgePlugin.php +++ b/plugins/FacebookBridge/FacebookBridgePlugin.php @@ -109,23 +109,9 @@ class FacebookBridgePlugin extends Plugin include_once $dir . '/extlib/base_facebook.php'; include_once $dir . '/extlib/facebook.php'; return false; - case 'FacebookloginAction': - case 'FacebookfinishloginAction': - case 'FacebookadminpanelAction': - case 'FacebooksettingsAction': - case 'FacebookdeauthorizeAction': - include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'Facebookclient': - case 'FacebookQueueHandler': - include_once $dir . '/lib/' . strtolower($cls) . '.php'; - return false; - case 'Notice_to_item': - include_once $dir . '/classes/' . $cls . '.php'; - return false; - default: - return true; } + + return parent::onAutoload($cls); } /** @@ -167,11 +153,11 @@ class FacebookBridgePlugin extends Plugin /** * Map URLs to actions * - * @param Net_URL_Mapper $m path-to-action mapper + * @param URLMapper $m path-to-action mapper * * @return boolean hook value; true means continue processing, false means stop. */ - function onRouterInitialized($m) + public function onRouterInitialized(URLMapper $m) { // Always add the admin panel route $m->connect('panel/facebook', array('action' => 'facebookadminpanel')); @@ -243,7 +229,7 @@ class FacebookBridgePlugin extends Plugin * * @return boolean hook value */ - function onEndAdminPanelNav($nav) + function onEndAdminPanelNav(Menu $nav) { if (AdminPanelAction::canAdmin('facebook')) { @@ -343,7 +329,7 @@ class FacebookBridgePlugin extends Plugin * @param Action $action the current action * */ - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { if ($this->needsScripts($action)) { @@ -428,7 +414,6 @@ ENDOFSCRIPT; $action->logout(); common_redirect($logoutUrl, 303); - return false; // probably never get here, but hey } return true; @@ -464,7 +449,7 @@ ENDOFSCRIPT; * * @return boolean hook return */ - function onStartEnqueueNotice($notice, &$transports) + function onStartEnqueueNotice(Notice $notice, array &$transports) { if (self::hasApplication() && $notice->isLocal() && $notice->inScope(null)) { array_push($transports, 'facebook'); @@ -580,7 +565,7 @@ ENDOFSCRIPT; if (!empty($fuser)) { $links[] = array("href" => $fuser->link, - "text" => sprintf(_("@%s on Facebook"), $fuser->name), + "text" => sprintf(_("%s on Facebook"), $fuser->name), "image" => $this->path("images/f_logo.png")); } } @@ -590,7 +575,7 @@ ENDOFSCRIPT; function getFacebookUser($id) { - $key = Cache::key(sprintf("FacebookBridgePlugin:userdata:%d", $id)); + $key = Cache::key(sprintf("FacebookBridgePlugin:userdata:%s", $id)); $c = Cache::instance(); @@ -602,7 +587,7 @@ ENDOFSCRIPT; } $url = sprintf("https://graph.facebook.com/%s", $id); - $client = new HTTP_Client(); + $client = new HTTPClient(); $resp = $client->get($url); if (!$resp->isOK()) { @@ -627,11 +612,11 @@ ENDOFSCRIPT; * * @param array &$versions plugin version descriptions */ - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array( 'name' => 'Facebook Bridge', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Craig Andrews, Zach Copley', 'homepage' => 'http://status.net/wiki/Plugin:FacebookBridge', 'rawdescription' =>