Index: branches/RC/core/kernel/parser/template.php =================================================================== diff -u -N -r11501 -r11661 --- branches/RC/core/kernel/parser/template.php (.../template.php) (revision 11501) +++ branches/RC/core/kernel/parser/template.php (.../template.php) (revision 11661) @@ -80,6 +80,16 @@ var $BasePath; var $FileNames = Array(); + /** + * Force templates cache to search templates on front-end: + * true - search for theme name in template name + * false - don't search anywhere + * name - theme name to prepend for each template name + * + * @var mixed + */ + var $forceThemeName = false; + function TemplatesCache() { parent::kBase(); @@ -112,6 +122,11 @@ $module_filename = $filename; } + if (is_string($this->forceThemeName)) { + // when defined, then all templates are read from given theme name + $first_dir = 'theme:' . $this->forceThemeName . ($first_dir ? '/' . $first_dir : ''); + } + // !preg_match for backward compatability with full-path plugins if ($this->Application->IsAdmin() && $first_dir == 'plugins' && !preg_match('/admin_templates/', $module_filename)) { if (preg_match('#^[\/]{0,1}([^\/]*)\/(.*)#', $module_filename, $regs)) {; @@ -129,7 +144,7 @@ } $path = MODULES_PATH.'/'.mb_strtolower($first_dir).'/admin_templates'; } - elseif (defined('DBG_NPARSER_FORCE_COMPILE') && DBG_NPARSER_FORCE_COMPILE && preg_match('/^theme:(.*)/', $first_dir, $regs)) { + elseif ($this->forceThemeName && preg_match('/^theme:(.*)/', $first_dir, $regs)) { // ability to use Front-End templates in admin (only during mass compilation) $path = FULL_PATH . '/themes/' . $regs[1]; }