X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Ffacebookaction.php;h=5cbb9be5312bf2ff50907cbc06dd41b31cc5a342;hb=18df82ba2302d5b72bc42f4d3296d6fff7d16341;hp=1ae90d53bdeb534afd8a65a1f5f51c5b90a2b480;hpb=ccbc5c447df5a5284b8845d9a53f28d17d8df875;p=quix0rs-gnu-social.git diff --git a/lib/facebookaction.php b/lib/facebookaction.php index 1ae90d53bd..5cbb9be531 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -1,6 +1,6 @@ . * * @category Faceboook - * @package Laconica - * @author Zach Copley - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Zach Copley + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -95,34 +95,14 @@ class FacebookAction extends Action function showStylesheets() { - // Add a timestamp to the file so Facebook cache wont ignore our changes - $ts = filemtime(INSTALLDIR.'/theme/base/css/display.css'); - - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/display.css', 'base') . '?ts=' . $ts)); - - $theme = common_config('site', 'theme'); - - $ts = filemtime(INSTALLDIR. '/theme/' . $theme .'/css/display.css'); - - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/display.css', null) . '?ts=' . $ts)); - - $ts = filemtime(INSTALLDIR.'/theme/base/css/facebookapp.css'); - - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/facebookapp.css', 'base') . '?ts=' . $ts)); + $this->cssLink('css/display.css', 'base'); + $this->cssLink('css/display.css',null,'screen, projection, tv'); + $this->cssLink('css/facebookapp.css', 'base'); } function showScripts() { - // Add a timestamp to the file so Facebook cache wont ignore our changes - $ts = filemtime(INSTALLDIR.'/js/facebookapp.js'); - - $this->element('script', array('src' => common_path('js/facebookapp.js') . '?ts=' . $ts)); + $this->script('js/facebookapp.js'); } /** @@ -277,8 +257,13 @@ class FacebookAction extends Action $this->elementStart('dd'); $this->elementStart('p'); $this->text(sprintf($loginmsg_part1, common_config('site', 'name'))); - $this->element('a', - array('href' => common_local_url('register')), _('Register')); + if (!common_config('site', 'openidonly')) { + $this->element('a', + array('href' => common_local_url('register')), _('Register')); + } else { + $this->element('a', + array('href' => common_local_url('openidlogin')), _('Register')); + } $this->text($loginmsg_part2); $this->elementEnd('p'); $this->elementEnd('dd'); @@ -389,7 +374,7 @@ class FacebookAction extends Action display:inline-block; } - #facebook_laconica_app { + #facebook_statusnet_app { text-indent:-9999px; height:16px; width:16px; @@ -460,16 +445,6 @@ class FacebookAction extends Action } } - function updateFacebookStatus($notice) - { - $prefix = $this->facebook->api_client->data_getUserPreference(FACEBOOK_NOTICE_PREFIX, $this->fbuid); - $content = "$prefix $notice->content"; - - if ($this->facebook->api_client->users_hasAppPermission('status_update', $this->fbuid)) { - $this->facebook->api_client->users_setStatus($content, $this->fbuid, false, true); - } - } - function saveNewNotice() { @@ -504,7 +479,7 @@ class FacebookAction extends Action $replyto = $this->trimmed('inreplyto'); $notice = Notice::saveNew($user->id, $content, - 'Facebook', 1, ($replyto == 'false') ? null : $replyto); + 'web', 1, ($replyto == 'false') ? null : $replyto); if (is_string($notice)) { $this->showPage($notice); @@ -514,8 +489,7 @@ class FacebookAction extends Action common_broadcast_notice($notice); // Also update the user's Facebook status - $this->updateFacebookStatus($notice); - $this->updateProfileBox($notice); + facebookBroadcastNotice($notice); } @@ -699,7 +673,7 @@ class FacebookProfileBoxNotice extends FacebookNoticeListItem $this->app_uri = 'http://apps.facebook.com/' . $app_props['canvas_name']; $this->app_name = $app_props['application_name']; - $this->out->elementStart('a', array('id' => 'facebook_laconica_app', + $this->out->elementStart('a', array('id' => 'facebook_statusnet_app', 'href' => $this->app_uri)); $this->out->text($this->app_name); $this->out->elementEnd('a');