From 632192de441fa2b67f989739652802a985a62265 Mon Sep 17 00:00:00 2001 From: Simon Elvery Date: Fri, 4 Jan 2013 09:22:46 +1000 Subject: [PATCH] ENHANCEMENT Don't show translations dropdown if all translations have been created. --- code/model/Translatable.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/model/Translatable.php b/code/model/Translatable.php index 9174d5e..c1b2c12 100755 --- a/code/model/Translatable.php +++ b/code/model/Translatable.php @@ -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 = '