[FEATURE] Add translation params for category 54/39154/9
authorMarkus Sommer <markussom@posteo.de>
Fri, 1 May 2015 12:22:52 +0000 (14:22 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 2 May 2015 12:49:24 +0000 (14:49 +0200)
Add l10n_mode and l10n_display to TCA Config for category view.

Resolves: #66681
Releases: master, 6.2
Change-Id: I3f895c0578b8506179493f077f94ff0270b78167
Reviewed-on: http://review.typo3.org/39154
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Category/CategoryRegistry.php
typo3/sysext/core/Documentation/Changelog/master/Feature-66681-CategoryRegistryAddOptionsToSetL10n_modeAndL10n_display.rst [new file with mode: 0644]

index 933ed53..cdb6a14 100644 (file)
@@ -311,6 +311,8 @@ class CategoryRegistry implements SingletonInterface {
         *              + fieldConfiguration: TCA field config array to override defaults
         *              + label: backend label of the categories field
         *              + interface: boolean if the category should be included in the "interface" section of the TCA table
+        *              + l10n_mode
+        *              + l10n_display
         * @return void
         */
        protected function addTcaColumn($tableName, $fieldName, array $options) {
@@ -338,6 +340,13 @@ class CategoryRegistry implements SingletonInterface {
                                ),
                        );
 
+                       if (isset($options['l10n_mode'])) {
+                               $columns[$fieldName]['l10n_mode'] = $options['l10n_mode'];
+                       }
+                       if (isset($options['l10n_display'])) {
+                               $columns[$fieldName]['l10n_display'] = $options['l10n_display'];
+                       }
+
                        // Register opposite references for the foreign side of a relation
                        if (empty($GLOBALS['TCA']['sys_category']['columns']['items']['config']['MM_oppositeUsage'][$tableName])) {
                                $GLOBALS['TCA']['sys_category']['columns']['items']['config']['MM_oppositeUsage'][$tableName] = array();
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-66681-CategoryRegistryAddOptionsToSetL10n_modeAndL10n_display.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-66681-CategoryRegistryAddOptionsToSetL10n_modeAndL10n_display.rst
new file mode 100644 (file)
index 0000000..e3e0be1
--- /dev/null
@@ -0,0 +1,21 @@
+=================================================================================
+Feature: #66681 - CategoryRegistry: add options to set l10n_mode and l10n_display
+=================================================================================
+
+Description
+===========
+
+Class *CategoryRegistry->addTcaColumn* got options to set  *l10n_mode* and *l10n_display*.
+The values can be set via:
+
+.. code-block:: php
+
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable(
+               $extensionKey,
+               $tableName,
+               'categories',
+               array(
+                       'l10n_mode' => 'string (keyword)',
+                       'l10n_display' => 'list of keywords'
+               )
+       );