Index: branches/5.1.x/core/kernel/processors/main_processor.php =================================================================== diff -u -N -r13086 -r13113 --- branches/5.1.x/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 13086) +++ branches/5.1.x/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 13113) @@ -1,6 +1,6 @@ Application->isAdmin || $force_admin) { + if ($this->Application->isAdmin) { if ($module == 'in-portal') { $module = 'kernel'; } - $path = $force_admin ? '/core/admin_templates' : THEMES_PATH; - $path = preg_replace('/\/(.*?)\/(.*)/', $module.'/\\2', $path); // remove leading slash + substitute module + // remove leading slash + substitute module + $module_path = $this->Application->findModule('Name', $module, 'Path'); + + if ($module_path !== false) { + $path = $module_path . 'admin_templates'; + } + else { + // remove leading slash + substitute module + $path = preg_replace('/\/(.*?)\/(.*)/', $module . '/\\2', THEMES_PATH); + } } else { $path = mb_substr(THEMES_PATH, 1); @@ -574,15 +581,14 @@ function ModuleInclude($params) { $ret = ''; + $included = Array (); $block_params = array_merge($params, Array('is_silent' => 2)); // don't make fatal errors in case if template is missing $current_template = $this->Application->GetVar('t'); $replace_main = isset($params['replace_m']) && $params['replace_m']; $skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array(); $cms_mode = $this->Application->GetVar('admin'); - $included = Array (); - foreach ($this->Application->ModuleInfo as $module_name => $module_data) { $module_key = mb_strtolower($module_name); @@ -596,7 +602,7 @@ $module_prefix = $module_data['TemplatePath']; } elseif ($this->Application->isAdmin) { - $module_prefix = $module_data['Path']; // was $module_key . '/'; + $module_prefix = $module_key . '/'; // was $module_data['Path']; } else { $module_prefix = $module_data['TemplatePath']; // always have trailing "/"