Move theme determination after full module run

This commit is contained in:
Hypolite Petovan
2019-10-06 11:18:51 -04:00
parent cb4950a3be
commit 4a5dfefacc
3 changed files with 20 additions and 17 deletions

View File

@@ -364,6 +364,18 @@ class Page implements ArrayAccess
*/
$this->initContent($module, $mode);
// Load current theme info after module has been initialized as theme could have been set in module
$currentTheme = $app->getCurrentTheme();
$theme_info_file = 'view/theme/' . $currentTheme . '/theme.php';
if (file_exists($theme_info_file)) {
require_once $theme_info_file;
}
if (function_exists(str_replace('-', '_', $currentTheme) . '_init')) {
$func = str_replace('-', '_', $currentTheme) . '_init';
$func($app);
}
/* Create the page head after setting the language
* and getting any auth credentials.
*