From 081d4edbf5e5a72bb7cab8b5587be1bdf71e40cb Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 20 Sep 2011 12:32:49 -0400 Subject: [PATCH] fallback theme --- lib/theme.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/theme.php b/lib/theme.php index b5f2b58cf2..1239e317f4 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -53,6 +53,8 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { */ class Theme { + const FALLBACK = 'neo'; + var $name = null; var $dir = null; var $path = null; @@ -99,7 +101,19 @@ class Theme if (file_exists($fulldir) && is_dir($fulldir)) { $this->dir = $fulldir; $this->path = $this->relativeThemePath('theme', 'theme', $name); + return; } + + // Ruh roh. Fall back to default, then. + + common_log(LOG_WARN, sprintf("Unable to find theme '%s', falling back to default theme '%s'", + $name, + Theme::FALLBACK)); + + $this->name = Theme::FALLBACK; + $this->dir = $instroot.'/'.Theme::FALLBACK; + $this->path = $this->relativeThemePath('theme', 'theme', Theme::FALLBACK); + } /** -- 2.39.5