Index: branches/unlabeled/unlabeled-1.2.2/core/units/general/helpers/themes_helper.php =================================================================== diff -u -N -r7755 -r7757 --- branches/unlabeled/unlabeled-1.2.2/core/units/general/helpers/themes_helper.php (.../themes_helper.php) (revision 7755) +++ branches/unlabeled/unlabeled-1.2.2/core/units/general/helpers/themes_helper.php (.../themes_helper.php) (revision 7757) @@ -90,7 +90,7 @@ * @param string $theme_path theme path from web server root * @param int $theme_id id of theme we are scanning */ - function FindThemeFiles($folder_path, $theme_path, $theme_id) + function FindThemeFiles($folder_path, $theme_path, $theme_id, $auto_structure_mode=1) { $fh = opendir($theme_path.$folder_path.'/'); @@ -104,22 +104,22 @@ while (($filename = readdir($fh))) { if ($filename == '.' || $filename == '..') continue; + $auto_structure = $auto_structure_mode; + foreach ($ignore as $pattern) + { + if (preg_match('/'.str_replace('/', '\\/',$pattern).'/', $filename)) { + $auto_structure = 2; + break; + } + } + $full_path = $theme_path.$folder_path.'/'.$filename; if (is_dir($full_path)) { - $this->FindThemeFiles($folder_path.'/'.$filename, $theme_path, $theme_id); + $this->FindThemeFiles($folder_path.'/'.$filename, $theme_path, $theme_id, $auto_structure); } elseif (substr($filename, -4) == '.tpl') { $file_path = $folder_path.'/'.$filename; - $auto_structure = 1; - foreach ($ignore as $pattern) - { - if (preg_match('/'.str_replace('/', '\\/',$pattern).'/', $filename)) { - $auto_structure = 2; - break; - } - } - $file_id = isset($this->themeFiles[$file_path]) ? $this->themeFiles[$file_path] : false; if ($file_id) { // file was found in db & on hdd -> mark as existing