Index: branches/5.2.x/core/units/helpers/minifiers/minify_helper.php =================================================================== diff -u -N -r15137 -r15284 --- branches/5.2.x/core/units/helpers/minifiers/minify_helper.php (.../minify_helper.php) (revision 15137) +++ branches/5.2.x/core/units/helpers/minifiers/minify_helper.php (.../minify_helper.php) (revision 15284) @@ -1,6 +1,6 @@ debugMode ) { $string .= '/* === File: ' . substr($file, $path_length) . ' === */' . "\n"; @@ -139,7 +143,9 @@ $ret = 0; foreach ($files as $file) { - $ret = max($ret, filemtime($file)); + if ( file_exists($file) ) { + $ret = max($ret, filemtime($file)); + } } return $ret; @@ -266,14 +272,42 @@ if ( preg_match($reg_exp, $template, $regs) ) { // full url (from current domain) to a file - $path = FULL_PATH . '/' . $regs[1]; + $ret[] = FULL_PATH . '/' . $regs[1]; } + elseif ( strpos($template, '{module_path}') !== false ) { + $ret = array_merge($ret, $this->_moduleInclude($template)); + } else { - list ($path, $module_filename) = $this->Application->TemplatesCache->GetTemplatePaths($template); - $path .= DIRECTORY_SEPARATOR . $module_filename; + $ret[] = $this->Application->TemplatesCache->GetRealFilename($template); } + } - $ret[] = $path; + return $ret; + } + + /** + * + * @param string $template + * @return Array + * @access protected + */ + protected function _moduleInclude($template) + { + $ret = $included = Array (); + + foreach ($this->Application->ModuleInfo as $module_name => $module_data) { + if ( $module_name == 'In-Portal' ) { + continue; + } + + $module_prefix = $this->Application->isAdmin ? mb_strtolower($module_name) . '/' : $module_data['TemplatePath']; + + if ( in_array($module_prefix, $included) ) { + continue; + } + + $ret[] = $this->Application->TemplatesCache->GetRealFilename(str_replace('{module_path}', $module_prefix, $template)); + $included[] = $module_prefix; } return $ret;