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)

This commit is contained in:
Ad Schellevis 2018-03-06 18:29:16 +01:00
parent c58c2fdc8d
commit 67e95c4f52

View File

@ -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;
}