Fixed ThemeLoader with manually specified themes

This commit is contained in:
buddh4 2018-06-26 14:23:19 +02:00
parent 670f49b4cb
commit 64985ef69f
2 changed files with 10 additions and 27 deletions

View File

@ -9,6 +9,7 @@
namespace humhub\modules\ui\view\bootstrap;
use humhub\libs\BaseSettingsManager;
use humhub\modules\ui\view\components\Theme;
use humhub\modules\ui\view\helpers\ThemeHelper;
use yii\base\BootstrapInterface;
@ -33,18 +34,18 @@ class ThemeLoader implements BootstrapInterface
}
$themePath = $app->settings->get('theme');
if (empty($themePath) || !is_dir($themePath)) {
return;
if (!empty($themePath) && is_dir($themePath)) {
$theme = ThemeHelper::getThemeByPath($themePath);
if ($theme !== null) {
$app->view->theme = $theme;
$app->mailer->view->theme = $theme;
}
}
$theme = ThemeHelper::getThemeByPath($themePath);
if ($theme !== null) {
$app->view->theme = $theme;
$app->mailer->view->theme = $theme;
if ($app->view->theme instanceof Theme) {
$app->view->theme->register();
}
$theme->register();
}
}

View File

@ -22,24 +22,6 @@
array (
),
'useFileTransport' => true,
'view' =>
array (
'theme' =>
array (
'name' => 'HumHub',
'basePath' => 'E:\\codebase\\humhub\\master/themes\\HumHub',
'publishResources' => false,
),
),
),
'view' =>
array (
'theme' =>
array (
'name' => 'HumHub',
'basePath' => 'E:\\codebase\\humhub\\master/themes\\HumHub',
'publishResources' => false,
),
),
'cache' =>
array (