ENHANCEMENT More robust path-extraction of module-names

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@43692 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-10-23 01:56:03 +00:00
parent 94c923459d
commit a645869bc3

View File

@ -923,11 +923,11 @@ class i18n extends Controller {
if (substr($name,-3) == '.ss') {
global $_TEMPLATE_MANIFEST;
$path = current($_TEMPLATE_MANIFEST[substr($name,0,-3)]);
ereg('.*/([^/]+)/templates/',$path,$module);
ereg(Director::baseFolder() . '/([^/]+)/',$path,$module);
} else {
global $_CLASS_MANIFEST;
$path = $_CLASS_MANIFEST[$name];
ereg('.*/([^/]+)/code/',$path,$module);
ereg(Director::baseFolder() . '/([^/]+)/',$path,$module);
}
return $module[1];