mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Removed duplicated code in i18nTextCollector, more defensive checks for get_owner_module()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@104992 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
416c8fcc2a
commit
a809289a25
@ -94,6 +94,7 @@ class i18nTextCollector extends Object {
|
||||
|
||||
// we store the master string tables
|
||||
$processedEntities = $this->processModule($module);
|
||||
|
||||
if(isset($entitiesByModule[$module])) {
|
||||
$entitiesByModule[$module] = array_merge_recursive($entitiesByModule[$module], $processedEntities);
|
||||
} else {
|
||||
@ -102,24 +103,14 @@ class i18nTextCollector extends Object {
|
||||
|
||||
// extract all entities for "foreign" modules (fourth argument)
|
||||
foreach($entitiesByModule[$module] as $fullName => $spec) {
|
||||
if(isset($spec[3]) && $spec[3] != $module) {
|
||||
if(isset($spec[3]) && $spec[3] && $spec[3] != $module) {
|
||||
$othermodule = $spec[3];
|
||||
if(!isset($entitiesByModule[$othermodule])) $entitiesByModule[$othermodule] = array();
|
||||
unset($spec[3]);
|
||||
$entitiesByModule[$othermodule][$fullName] = $spec;
|
||||
unset($entitiesByModule[$module][$fullName]);
|
||||
}
|
||||
}
|
||||
|
||||
// extract all entities for "foreign" modules (fourth argument)
|
||||
foreach($entitiesByModule[$module] as $fullName => $spec) {
|
||||
if(isset($spec[3]) && $spec[3] != $module) {
|
||||
$othermodule = $spec[3];
|
||||
if(!isset($entitiesByModule[$othermodule])) $entitiesByModule[$othermodule] = array();
|
||||
unset($spec[3]);
|
||||
$entitiesByModule[$othermodule][$fullName] = $spec;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Write the generated master string tables
|
||||
|
Loading…
Reference in New Issue
Block a user