trac750 New CSS files for FB app to allow bettter per-install theming

This commit is contained in:
Zach Copley 2009-01-19 01:34:25 +00:00
parent 12f7ec980c
commit 64bda5bd6c
2 changed files with 16 additions and 4 deletions

View File

@ -37,7 +37,11 @@ class FacebookAction extends Action
common_element('link', array('rel' => 'stylesheet', common_element('link', array('rel' => 'stylesheet',
'type' => 'text/css', 'type' => 'text/css',
'href' => getFacebookCSS())); 'href' => getFacebookBaseCSS()));
common_element('link', array('rel' => 'stylesheet',
'type' => 'text/css',
'href' => getFacebookThemeCSS()));
common_element('script', array('type' => 'text/javascript', common_element('script', array('type' => 'text/javascript',
'src' => getFacebookJS()), 'src' => getFacebookJS()),

View File

@ -107,14 +107,22 @@ function update_profile_box($facebook, $fbuid, $user, $notice)
$facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main); $facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main);
} }
function getFacebookCSS() function getFacebookBaseCSS()
{ {
# Add a timestamp to the CSS file so Facebook cache wont ignore our changes # Add a timestamp to the CSS file so Facebook cache wont ignore our changes
$ts = filemtime(theme_file('facebookapp.css')); $ts = filemtime(theme_file('facebookapp_base.css'));
$cssurl = theme_path('facebookapp.css') . "?ts=$ts"; $cssurl = theme_path('facebookapp_base.css') . "?ts=$ts";
return $cssurl; return $cssurl;
} }
function getFacebookThemeCSS()
{
# Add a timestamp to the CSS file so Facebook cache wont ignore our changes
$ts = filemtime(theme_file('facebookapp_theme.css'));
$cssurl = theme_path('facebookapp_theme.css') . "?ts=$ts";
return $cssurl;
}
function getFacebookJS() { function getFacebookJS() {
# Add a timestamp to the FBJS file so Facebook cache wont ignore our changes # Add a timestamp to the FBJS file so Facebook cache wont ignore our changes