Merge pull request #121 from jthomerson/pulls/cms_fields_performance_improvement

ENHANCEMENT: significant speed improvement for many locales
This commit is contained in:
Ingo Schommer 2013-07-15 03:10:53 -07:00
commit 8518d1cf20

View File

@ -1010,12 +1010,11 @@ class Translatable extends DataExtension implements PermissionProvider {
));
if(!$tab->fieldByName('existingtrans')) {
$existingTransHTML = '<ul>';
foreach($alreadyTranslatedLocales as $langCode) {
$existingTranslation = $this->owner->getTranslation($langCode);
foreach($this->getTranslations() as $existingTranslation) {
if($existingTranslation && $existingTranslation->hasMethod('CMSEditLink')) {
$existingTransHTML .= sprintf('<li><a href="%s">%s</a></li>',
sprintf('%s/?locale=%s', $existingTranslation->CMSEditLink(), $langCode),
i18n::get_locale_name($langCode)
sprintf('%s/?locale=%s', $existingTranslation->CMSEditLink(), $existingTranslation->Locale),
i18n::get_locale_name($existingTranslation->Locale)
);
}
}