ENHANCEMENT Don't show translations dropdown if all translations have been created.

This commit is contained in:
Simon Elvery 2013-01-04 09:22:46 +10:00
parent 061057ca04
commit 632192de44

View File

@ -971,11 +971,17 @@ class Translatable extends DataExtension implements PermissionProvider {
)
);
$createButton->includeDefaultJS(false);
if ( count($langDropdown->getSource()) < 1 ) {
$fields->insertAfter(new LiteralField('AllTransCreated', _t('Translatable.ALLCREATED', 'All allowed translations have been created.')), 'CreateTransHeader');
$fields->removeByName('NewTransLang');
$fields->removeByName('createtranslation');
}
if($alreadyTranslatedLocales) {
$fields->addFieldToTab(
'Root.Translations',
new HeaderField('ExistingTransHeader', _t('Translatable.EXISTING', 'Existing translations:'), 3)
new HeaderField('ExistingTransHeader', _t('Translatable.EXISTING', 'Existing translations'), 3)
);
$existingTransHTML = '<ul>';
foreach($alreadyTranslatedLocales as $langCode) {