[TASK] Add static_lang_isocode of RTE acronym table 50/44250/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 23 Oct 2015 15:07:57 +0000 (17:07 +0200)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 2 Nov 2015 17:47:05 +0000 (18:47 +0100)
Add static_lang_isocode field to tx_rtehtmlarea_acronym TCA
definition. This field was removed from core to get rid of
the inverse LOADED display condition in core.

Change-Id: I5c65078dae1fb200babf21f5c9d5c01f64de9627
Related: #70052
Resolves: #71005
Reviewed-on: https://review.typo3.org/44250
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
Configuration/TCA/Overrides/sys_language.php
Configuration/TCA/Overrides/tx_rtehtmlarea_acronym.php [new file with mode: 0644]

index 332b814..18f8b5e 100644 (file)
@@ -5,7 +5,6 @@ defined('TYPO3_MODE') or die();
 $GLOBALS['TCA']['sys_language']['columns']['static_lang_isocode'] = array(
        'exclude' => 1,
        'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_language.isocode',
-       'displayCond' => 'EXT:static_info_tables:LOADED:true',
        'config' => array(
                'type' => 'select',
                'renderType' => 'selectSingle',
diff --git a/Configuration/TCA/Overrides/tx_rtehtmlarea_acronym.php b/Configuration/TCA/Overrides/tx_rtehtmlarea_acronym.php
new file mode 100644 (file)
index 0000000..e35115a
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+defined('TYPO3_MODE') or die();
+if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version()) > 7005000
+       && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('rtehtmlarea')
+) {
+       $additionalColumns = [
+               'static_lang_isocode' => [
+                       'exclude' => 0,
+                       'label' => 'LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_db.xlf:tx_rtehtmlarea_acronym.static_lang_isocode',
+                       'config' => [
+                               'type' => 'select',
+                               'renderType' => 'selectSingle',
+                               'items' => [
+                                       ['', 0],
+                               ],
+                               'foreign_table' => 'static_languages',
+                               'foreign_table_where' => 'ORDER BY static_languages.lg_name_en',
+                               'itemsProcFunc' => SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaSelectItemsProcessor::class. '->translateLanguagesSelector',
+                               'size' => 1,
+                               'minitems' => 0,
+                               'maxitems' => 1,
+                               'wizards' => [
+                                       'suggest' => [
+                                               'type' => 'suggest',
+                                               'default' => [
+                                                       'receiverClass' => SJBR\StaticInfoTables\Hook\Backend\Form\Wizard\SuggestReceiver::class
+                                               ]
+                                       ]
+                               ]
+                       ]
+               ]
+       ];
+
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_rtehtmlarea_acronym', $additionalColumns);
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tx_rtehtmlarea_acronym', 'static_lang_isocode');
+}
\ No newline at end of file