X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Ffacebookaction.php;h=411f795945a7de10737cbb3eab89a0dce2e5af41;hb=0190785b73b52e2c6069c31542f578f812a5e0ab;hp=5be2f2fe6603f9296a870e4ad7f99ae9b47dcb0f;hpb=1aea5989776e75f3b7af236049d511a28c3f1ff7;p=quix0rs-gnu-social.git diff --git a/lib/facebookaction.php b/lib/facebookaction.php index 5be2f2fe66..411f795945 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); } @@ -35,7 +35,6 @@ if (!defined('LACONICA')) require_once INSTALLDIR.'/lib/facebookutil.php'; require_once INSTALLDIR.'/lib/noticeform.php'; - class FacebookAction extends Action { @@ -95,34 +94,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'); } /** @@ -201,7 +180,6 @@ class FacebookAction extends Action } - // Make this into a widget later function showLocalNav() { @@ -261,7 +239,6 @@ class FacebookAction extends Action $this->endHTML(); } - function showInstructions() { @@ -287,7 +264,6 @@ class FacebookAction extends Action $this->elementEnd('div'); } - function showLoginForm($msg = null) { @@ -332,7 +308,6 @@ class FacebookAction extends Action } - function updateProfileBox($notice) { @@ -389,7 +364,7 @@ class FacebookAction extends Action display:inline-block; } - #facebook_laconica_app { + #facebook_statusnet_app { text-indent:-9999px; height:16px; width:16px; @@ -414,7 +389,6 @@ class FacebookAction extends Action $this->xw->openURI('php://output'); } - /** * Generate pagination links * @@ -473,8 +447,9 @@ class FacebookAction extends Action } else { $content_shortened = common_shorten_links($content); - if (mb_strlen($content_shortened) > 140) { - $this->showPage(_('That\'s too long. Max notice size is 140 chars.')); + if (Notice::contentTooLong($content_shortened)) { + $this->showPage(sprintf(_('That\'s too long. Max notice size is %d chars.'), + Notice::maxContent())); return; } } @@ -688,7 +663,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');