diff options
author | Evan Prodromou <evan@status.net> | 2009-11-08 17:16:50 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-11-08 17:16:50 -0500 |
commit | cbae1b0c8b18de0b6643e066c89578523c5e8002 (patch) | |
tree | 2fbb7aad6dec43a45f83d9969f3984c83fdabffb | |
parent | 111f6a775daf9334adb05c9f8e539d682238f4dd (diff) |
add utilities for calculating local and installation theme root dirs
-rw-r--r-- | lib/theme.php | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/lib/theme.php b/lib/theme.php index c658058ff..e5fad2316 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -70,7 +70,7 @@ class Theme // Check to see if it's in the local dir - $localroot = INSTALLDIR.'/local/theme'; + $localroot = Theme::localRoot(); $fulldir = $localroot.'/'.$name; @@ -82,11 +82,7 @@ class Theme // Check to see if it's in the distribution dir - $instroot = common_config('theme', 'dir'); - - if (empty($instroot)) { - $instroot = INSTALLDIR.'/theme'; - } + $instroot = Theme::installRoot(); $fulldir = $instroot.'/'.$name; @@ -175,4 +171,32 @@ class Theme $theme = new Theme($name); return $theme->getPath($relative); } + + /** + * Local root dir for themes + * + * @return string local root dir for themes + */ + + protected static function localRoot() + { + return INSTALLDIR.'/local/theme'; + } + + /** + * Root dir for themes that are shipped with StatusNet + * + * @return string root dir for StatusNet themes + */ + + protected static function installRoot() + { + $instroot = common_config('theme', 'dir'); + + if (empty($instroot)) { + $instroot = INSTALLDIR.'/theme'; + } + + return $instroot; + } } |