Actions
Bug #29461
closedPage TSconfig for Extbase flexform values doesn't work
Start date:
2011-09-03
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:
Description
Description¶
Works
TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.title = New title TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.switchableControllerActions.disabled = 1 TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.switchableControllerActions.label = New label TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.switchableControllerActions.removeItems = Object->View
Doesn't work due to removeDotsFromTS in modifyFlexFormDS (t3lib/tceforms/class.t3lib_tceforms_flexforms.php)
TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.settings.firstsetting.label = New label
Doesn't work due to violation of TS-syntax (duh ;))
TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.switchableControllerActions.addItems.Object->action = Actionname
Problems¶
- Due to the removal of dots in TSconfig Extbase FF-fields (which normally use the format settings.settingsname) those fields cannot be overriden with (Page) TSconfig.
- Due to the format of the value field of switchableControllerActions-items (Object->action) no items can be added
Possible solution¶
Problem 1 (hackish, I know)¶
- Use special format in TSconfig (_settings_
in stead of settings.
):
TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF._settings_firstsetting.label = New label TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF._settings_firstsetting.removeItems = itemvalueA
- Add this code in t3lib/tceforms/class.t3lib_tceforms_flexforms.php, line 95+ (just after $sheetConf = t3lib_div::removeDotsFromTS(...);)
// Replace _settings_ by settings. for Extbase Flexforms foreach($sheetConf as $sheetName => $sheetArray) { foreach($sheetArray as $fieldName => $fieldArray) { if (t3lib_div::isFirstPartOfStr($fieldName, '_settings_')) { $newFieldName = str_replace('_settings_', 'settings.', $fieldName); $sheetConf[$sheetName][$newFieldName] = $fieldArray; unset($sheetConf[$sheetName][$fieldName]); } } }
Problem 2 (hackish too)¶
- Use special format in TSconfig (_Object_Action
in stead of Object->
):
TCEFORM.tt_content.pi_flexform.myextbaseext_pi.sDEF.switchableControllerActions.addItems._Object_action = Actionname
- Extend the code of solution 1 to ...
// Replace _settings_ by settings. for Extbase Flexforms foreach($sheetConf as $sheetName => $sheetArray) { foreach($sheetArray as $fieldName => $fieldArray) { if (t3lib_div::isFirstPartOfStr($fieldName, '_settings_')) { $newFieldName = str_replace('_settings_', 'settings.', $fieldName); $sheetConf[$sheetName][$newFieldName] = $fieldArray; unset($sheetConf[$sheetName][$fieldName]); } else if ($fieldName === 'switchableControllerActions' && array_key_exists('addItems', $fieldArray)) { foreach($fieldArray['addItems'] as $addItemValue => $addItemLabel) { $newAddItemValue = preg_replace('/\_([^\_]*)\_(.*)/', '$1->$2', $addItemValue); $sheetConf[$sheetName][$fieldName]['addItems'][$newAddItemValue] = $addItemLabel; unset($sheetConf[$sheetName][$fieldName]['addItems'][$addItemValue]); } } } }
Conclusion¶
I guess the Extbase FF overrides in TSconfig needs some more thinking to solve permanently.
Files
Actions