support work for a long-term fix for issue #390, essentially one can specify a theme:schema string anywhere a theme is input. It will be honoured unless an existing schema setting over-rides this behaviour. This should also be backward compatible but the theme selection code has been cleaned up slightly and there may be subtle differences in behaviour after this commit. On my site this required a page refresh as the first page load after this change was a bit confused.

This commit is contained in:
redmatrix
2016-05-17 17:46:30 -07:00
parent 51edd472c2
commit 20cb4130d4
6 changed files with 153 additions and 112 deletions

View File

@@ -206,13 +206,15 @@ class Router {
* load current theme info
*/
$theme_info_file = 'view/theme/' . current_theme() . '/php/theme.php';
$current_theme = \Zotlabs\Render\Theme::current();
$theme_info_file = 'view/theme/' . $current_theme[0] . '/php/theme.php';
if (file_exists($theme_info_file)){
require_once($theme_info_file);
}
if(function_exists(str_replace('-', '_', current_theme()) . '_init')) {
$func = str_replace('-', '_', current_theme()) . '_init';
if(function_exists(str_replace('-', '_', $current_theme[0]) . '_init')) {
$func = str_replace('-', '_', $current_theme[0]) . '_init';
$func($a);
}
elseif (x(\App::$theme_info, 'extends') && file_exists('view/theme/' . \App::$theme_info['extends'] . '/php/theme.php')) {