[FEATURE] Adapt to new TCA and Form Engine API of TYPO3 CMS 7
[TYPO3CMS/Extensions/static_info_tables.git] / Configuration / TCA / Overrides / sys_language.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 // Configure static_lang_isocode field in TCA
5 $GLOBALS['TCA']['sys_language']['columns']['static_lang_isocode'] = array(
6 'exclude' => 1,
7 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_language.isocode',
8 'displayCond' => 'EXT:static_info_tables:LOADED:true',
9 'config' => array(
10 'type' => 'select',
11 'items' => array(
12 array('', 0)
13 ),
14 'foreign_table' => 'static_languages',
15 'foreign_table_where' => 'AND static_languages.pid=0 ORDER BY static_languages.lg_name_en',
16 'itemsProcFunc' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\FormDataProvider\\TcaSelectItemsProcessor->translateLanguagesSelector',
17 'noIconsBelowSelect' => 1,
18 'size' => 1,
19 'minitems' => 0,
20 'maxitems' => 1,
21 'wizards' => array(
22 'suggest' => array(
23 'type' => 'suggest',
24 'default' => array(
25 'receiverClass' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\Wizard\\SuggestReceiver'
26 )
27 )
28 )
29 )
30 );
31
32 // Restore static_lang_isocode field in TCA
33 if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version()) >= 7000000) {
34 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('sys_language', 'static_lang_isocode', '', 'after:language_isocode');
35 } else {
36 $GLOBALS['TCA']['sys_language']['columns']['static_lang_isocode']['config']['itemsProcFunc'] = 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\ElementRenderingHelper->translateLanguagesSelector';
37 $GLOBALS['TCA']['sys_language']['columns']['static_lang_isocode']['config']['wizards']['suggest']['default'] = array('receiverClass' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\SuggestReceiver');
38 }