[TASK] Use FormDataProvider to provide system-languages 46/44146/3
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 19 Oct 2015 02:02:40 +0000 (04:02 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 22 Oct 2015 10:59:29 +0000 (12:59 +0200)
This allows fetching the languages in a central place, including
fetching the default-language name/flag.

Change-Id: I5211bb6fa4ee6df95cb25296b6b35b678d1cc225
Resolves: #70825
Releases: master
Reviewed-on: https://review.typo3.org/44146
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php
typo3/sysext/frontend/Configuration/TCA/tt_content.php

index 547592e..fad9afd 100644 (file)
@@ -245,6 +245,7 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
                 }
             }
         } elseif ($special === 'languages') {
+            // @todo: This should probably use the data provided by DatabaseSystemLanguageRows sitting in $result['systemLanguageRows']
             /** @var TranslationConfigurationProvider $translationConfigurationProvider */
             $translationConfigurationProvider = GeneralUtility::makeInstance(TranslationConfigurationProvider::class);
             $languages = $translationConfigurationProvider->getSystemLanguages();
index ac77f67..31e371e 100644 (file)
@@ -206,20 +206,15 @@ return array(
             'config' => array(
                 'type' => 'select',
                 'renderType' => 'selectSingle',
-                'foreign_table' => 'sys_language',
-                'foreign_table_where' => 'ORDER BY sys_language.title',
+                'special' => 'languages',
                 'items' => array(
                     array(
                         'LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages',
-                        -1
+                        -1,
+                        'flags-multiple'
                     ),
-                    array(
-                        'LLL:EXT:lang/locallang_general.xlf:LGL.default_value',
-                        0
-                    )
                 ),
                 'default' => 0,
-                'showIconTable' => true,
             )
         ),
         'l18n_parent' => array(