From b98b56e4a8c92d56969806f62390d57d5986855a Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 24 Apr 2013 13:45:40 +0200 Subject: check if there is a default/ folder in the theme directory if no theme exists --- lib/util.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/util.php') 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; + } + + } -- cgit v1.2.3