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:
Evan Prodromou
2009-11-08 17:04:46 -05:00
parent 321ac38884
commit b7e2e3fd2b
8 changed files with 150 additions and 67 deletions

View File

@@ -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);
}