summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-01-23 10:51:49 +0000
committerZach Copley <zach@controlyourself.ca>2009-01-23 10:51:49 +0000
commit767c7d293d967a45481e31f09022c13d077eb037 (patch)
treed39e6e173346dc7eddd593710838adf5be1b0fd7 /lib
parent1e5ad33f7232a64ba847387587ea7efd41c4c7c3 (diff)
trac750 Better CSS file organization and linking fore the FB app
Diffstat (limited to 'lib')
-rw-r--r--lib/facebookaction.php24
-rw-r--r--lib/facebookutil.php32
2 files changed, 19 insertions, 37 deletions
diff --git a/lib/facebookaction.php b/lib/facebookaction.php
index 92130e199..c781b86f4 100644
--- a/lib/facebookaction.php
+++ b/lib/facebookaction.php
@@ -95,21 +95,35 @@ 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' => getFacebookBaseCSS()));
-
+ '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' => getFacebookThemeCSS()));
+ 'href' => theme_path('css/facebookapp.css', 'base') . '?ts=' . $ts));
}
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('type' => 'text/javascript',
- 'src' => getFacebookJS()),
- ' ');
+ 'src' => common_path('js/facebookapp.js') . '?ts=' . $ts));
}
/**
diff --git a/lib/facebookutil.php b/lib/facebookutil.php
index a2a2d7cb1..b4c73da87 100644
--- a/lib/facebookutil.php
+++ b/lib/facebookutil.php
@@ -45,38 +45,6 @@ function getFacebook()
return new Facebook($apikey, $secret);
}
-function startFBML($indent = true)
-{
- global $xw;
- $xw = new XMLWriter();
- $xw->openURI('php://output');
- $xw->setIndent($indent);
-}
-
-function getFacebookBaseCSS()
-{
- # Add a timestamp to the CSS file so Facebook cache wont ignore our changes
- $ts = filemtime(INSTALLDIR.'/theme/base/css/facebookapp.base.css');
- $cssurl = theme_path('css/facebookapp.base.css', 'base') . "?ts=$ts";
- return $cssurl;
-}
-
-function getFacebookThemeCSS()
-{
- # Add a timestamp to the CSS file so Facebook cache wont ignore our changes
- $ts = filemtime(theme_file('css/facebookapp.theme.css'));
- $cssurl = theme_path('css/facebookapp.theme.css') . "?ts=$ts";
- return $cssurl;
-}
-
-function getFacebookJS() {
-
- # Add a timestamp to the FBJS file so Facebook cache wont ignore our changes
- $ts = filemtime(INSTALLDIR.'/js/facebookapp.js');
- $jsurl = common_path('js/facebookapp.js') . "?ts=$ts";
- return $jsurl;
-}
-
function updateProfileBox($facebook, $flink, $notice) {
$fbaction = new FacebookAction($output='php://output', $indent=true, $facebook, $flink);
$fbaction->updateProfileBox($notice);