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:
		| @@ -648,12 +648,13 @@ function theme_include($file, $root = '') { | ||||
| 	else | ||||
| 		$parent = 'NOPATH'; | ||||
|  | ||||
| 	$theme = current_theme(); | ||||
| 	$theme = Zotlabs\Render\Theme::current(); | ||||
| 	$thname = $theme[0]; | ||||
|  | ||||
| 	$ext = substr($file,strrpos($file,'.')+1); | ||||
|  | ||||
| 	$paths = array( | ||||
| 		"{$root}view/theme/$theme/$ext/$file", | ||||
| 		"{$root}view/theme/$thname/$ext/$file", | ||||
| 		"{$root}view/theme/$parent/$ext/$file", | ||||
| 		"{$root}view/site/$ext/$file", | ||||
| 		"{$root}view/$ext/$file", | ||||
|   | ||||
| @@ -11,13 +11,14 @@ class FriendicaSmarty extends Smarty { | ||||
| 		parent::__construct(); | ||||
|  | ||||
| 		$a = get_app(); | ||||
| 		$theme = current_theme(); | ||||
| 		$theme = Zotlabs\Render\Theme::current(); | ||||
| 		$thname = $theme[0]; | ||||
|  | ||||
| 		// setTemplateDir can be set to an array, which Smarty will parse in order. | ||||
| 		// The order is thus very important here | ||||
| 		$template_dirs = array('theme' => "view/theme/$theme/tpl/"); | ||||
| 		$template_dirs = array('theme' => "view/theme/$thname/tpl/"); | ||||
| 		if( x(App::$theme_info,"extends") ) | ||||
| 			$template_dirs = $template_dirs + array('extends' => "view/theme/".App::$theme_info["extends"]."/tpl/"); | ||||
| 			$template_dirs = $template_dirs + array('extends' => "view/theme/" . App::$theme_info["extends"] . "/tpl/"); | ||||
| 		$template_dirs = $template_dirs + array('base' => 'view/tpl/'); | ||||
| 		$this->setTemplateDir($template_dirs); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user