forked from GNUsocial/gnu-social
Restructure theme.php to define a class Theme
For various reasons, it's nicer to have a class for theme-file paths and such. So, I've rewritten the code for determining the locations of theme files to be more OOPy. I changed all the uses of the two functions in the module (theme_file and theme_path) to use Theme::file and Theme::path respectively. I've also removed the code in common.php that require's the module; using a class means we can autoload it instead.
This commit is contained in:
@@ -375,8 +375,8 @@ class HTMLOutputter extends XMLOutputter
|
||||
$url = parse_url($src);
|
||||
if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
|
||||
{
|
||||
if(file_exists(theme_file($src,$theme))){
|
||||
$src = theme_path($src, $theme) . '?version=' . STATUSNET_VERSION;
|
||||
if(file_exists(Theme::file($src,$theme))){
|
||||
$src = Theme::path($src, $theme) . '?version=' . STATUSNET_VERSION;
|
||||
}else{
|
||||
$src = common_path($src);
|
||||
}
|
||||
|
Reference in New Issue
Block a user