mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Adjusted i18nTextCollector to use DataObject->i18nCollectStatics()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64559 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
bd023527e6
commit
69d370dfd7
@ -165,6 +165,7 @@ class i18nTextCollector extends Object {
|
|||||||
!in_array('_manifest_exclude', $items)
|
!in_array('_manifest_exclude', $items)
|
||||||
&& !preg_match('/\/tests$/', $folder)
|
&& !preg_match('/\/tests$/', $folder)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($items && $isValidFolder) foreach($items as $item) {
|
if($items && $isValidFolder) foreach($items as $item) {
|
||||||
if(substr($item,0,1) == '.') continue;
|
if(substr($item,0,1) == '.') continue;
|
||||||
if(substr($item,-4) == '.php') $fileList[substr($item,0,-4)] = "$folder/$item";
|
if(substr($item,-4) == '.php') $fileList[substr($item,0,-4)] = "$folder/$item";
|
||||||
@ -308,14 +309,14 @@ class i18nTextCollector extends Object {
|
|||||||
return $php;
|
return $php;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function collectFromStatics($filePath) {
|
function collectFromStatics($filePath) {
|
||||||
$entitiesArr = array();
|
$entitiesArr = array();
|
||||||
|
|
||||||
$classes = ClassInfo::classes_for_file($filePath);
|
$classes = ClassInfo::classes_for_file($filePath);
|
||||||
if($classes) foreach($classes as $class) {
|
if($classes) foreach($classes as $class) {
|
||||||
if(class_exists($class) && method_exists($class, 'provideI18nStatics')) {
|
if(class_exists($class) && method_exists($class, 'i18nCollectStatics')) {
|
||||||
$obj = singleton($class);
|
$obj = singleton($class);
|
||||||
$entitiesArr = array_merge($entitiesArr,(array)$obj->provideI18nStatics());
|
$entitiesArr = array_merge($entitiesArr,(array)$obj->i18nCollectStatics());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user