Index: branches/5.0.x/core/kernel/nparser/template_cache.php =================================================================== diff -u -N -r12323 -r12726 --- branches/5.0.x/core/kernel/nparser/template_cache.php (.../template_cache.php) (revision 12323) +++ branches/5.0.x/core/kernel/nparser/template_cache.php (.../template_cache.php) (revision 12726) @@ -1,6 +1,6 @@ _compileToDatabase = defined('SAFE_MODE') && SAFE_MODE; $this->_compressOutput = $this->Application->ConfigValue('UseTemplateCompression'); - $this->_isAdmin = $this->Application->IsAdmin(); + + if ($this->Application->isAdmin) { + // prepare module template paths for quick access + $module_paths = Array (); + + foreach ($this->Application->ModuleInfo as $module_name => $module_info) { + $module_paths[$module_name] = rtrim($module_info['Path'], '/'); + } + + $this->_modulePaths = $module_paths; + } } /** @@ -73,7 +83,7 @@ */ function GetTemplatePaths($filename) { - if ($this->_isAdmin && array_key_exists($filename, $this->Application->ReplacementTemplates)) { + if ($this->Application->isAdmin && array_key_exists($filename, $this->Application->ReplacementTemplates)) { $filename = $this->Application->ReplacementTemplates[$filename]; } @@ -95,7 +105,7 @@ } // !preg_match for backward compatability with full-path plugins - if ($this->_isAdmin && ($first_dir == 'plugins') && !preg_match('/admin_templates/', $module_filename)) { + if ($this->Application->isAdmin && ($first_dir == 'plugins') && !preg_match('/admin_templates/', $module_filename)) { if (preg_match('#^[\/]{0,1}([^\/]*)\/(.*)#', $module_filename, $regs)) {; $path = MODULES_PATH.'/'.mb_strtolower($first_dir).'/'.$regs[1].'/admin_templates'; $module_filename = $regs[2]; @@ -105,7 +115,8 @@ $module_filename = $filename; } } - elseif ($this->_isAdmin && $this->Application->findModule('Name', $first_dir)) { + elseif ($this->Application->isAdmin && in_array($first_dir, $this->_modulePaths)) { + // $this->Application->findModule('Name', $first_dir) /*if ($first_dir == 'in-portal') { $first_dir = 'kernel'; }*/