diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-24 13:45:40 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-24 13:45:40 +0200 |
commit | b98b56e4a8c92d56969806f62390d57d5986855a (patch) | |
tree | 529b8b06c7e32bc7504776a60b83cfe0c9f5a2cd /lib/util.php | |
parent | b1c9b296e809f1a1ebc1283013138f4f5cfc0141 (diff) | |
download | nextcloud-server-b98b56e4a8c92d56969806f62390d57d5986855a.tar.gz nextcloud-server-b98b56e4a8c92d56969806f62390d57d5986855a.zip |
check if there is a default/ folder in the theme directory if no theme exists
Diffstat (limited to 'lib/util.php')
-rwxr-xr-x | lib/util.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php index 38453c1ce92..987a5782779 100755 --- a/lib/util.php +++ b/lib/util.php @@ -795,4 +795,25 @@ class OC_Util { return (substr(PHP_OS, 0, 3) === "WIN"); } + + /** + * Handles the case that there may not be a theme, then check if a "default" + * theme exists and take that one + * @return string the theme + */ + public static function getTheme() { + $theme = OC_Config::getValue("theme"); + + if(is_null($theme)) { + + if(is_dir(__DIR__ . '/../themes/default')) { + $theme = 'default'; + } + + } + + return $theme; + } + + } |