From 67e95c4f525a5df0281f082ca905c1d0d4869f4e Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 6 Mar 2018 18:29:16 +0100 Subject: [PATCH] MVC/Theme, force theme setting if base theme directory (/usr/local/opnsense/www/themes) doesn't exist, which might be the case for local test/development (we can't know for sure the predefined theme doesn't exist, but if we can't probe if we might as well trust the settings) --- .../mvc/app/controllers/OPNsense/Base/ControllerBase.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Base/ControllerBase.php b/src/opnsense/mvc/app/controllers/OPNsense/Base/ControllerBase.php index b757d7d99..84ee02dfd 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Base/ControllerBase.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Base/ControllerBase.php @@ -174,7 +174,10 @@ class ControllerBase extends ControllerRoot // set theme in ui_theme template var, let template handle its defaults (if there is no theme). if ($cnf->object()->theme->count() > 0 && !empty($cnf->object()->theme) && - is_dir('/usr/local/opnsense/www/themes/'.(string)$cnf->object()->theme) + ( + is_dir('/usr/local/opnsense/www/themes/'.(string)$cnf->object()->theme) || + !is_dir('/usr/local/opnsense/www/themes') + ) ) { $this->view->ui_theme = $cnf->object()->theme; }