Commit c1025c56 authored by Andreas Allacher's avatar Andreas Allacher Committed by Christian Kuhn
Browse files

[FEATURE] IRRE useCombination option to modify warning text

Add support for inline elements in combination with
['appearance']['useCombination'] to suppress the warning
messages by using ['appearance']['suppressCombinationWarning']
or ['appearance']['overwriteCombinationWarningMessage'] to
overwrite the default message.
(allows LLL: values)

Change-Id: I0765b9316cdfa9e09eb6eaf4e366c9470bfb7d75
Resolves: #64535
Releases: master
Reviewed-on: http://review.typo3.org/36415

Reviewed-by: default avatarDaniel Goerz <ervaude@gmail.com>
Tested-by: default avatarDaniel Goerz <ervaude@gmail.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent e211a7b0
......@@ -253,13 +253,21 @@ class InlineRecordContainer extends AbstractContainer {
$comboRecord = $inlineRelatedRecordResolver->getNewRecord($this->globalOptions['inlineFirstPid'], $comboConfig['foreign_table']);
$isNewRecord = TRUE;
}
$flashMessage = GeneralUtility::makeInstance(
FlashMessage::class,
$this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.inline_use_combination'),
'',
FlashMessage::WARNING
);
$resultArray['html'] = $flashMessage->render();
// Display Warning FlashMessage if it is not suppressed
if (!isset($config['appearance']['suppressCombinationWarning']) || empty($config['appearance']['suppressCombinationWarning']))
$combinationWarningMessage = 'LLL:EXT:lang/locallang_core.xlf:warning.inline_use_combination';
if (!empty($config['appearance']['overwriteCombinationWarningMessage'])) {
$combinationWarningMessage = $config['appearance']['overwriteCombinationWarningMessage'];
}
$flashMessage = GeneralUtility::makeInstance(
FlashMessage::class,
$this->getLanguageService()->sL($combinationWarningMessage),
'',
FlashMessage::WARNING
);
$resultArray['html'] = $flashMessage->render();
}
// Get the FormEngine interpretation of the TCA of the child table
$childArray = $this->renderRecord($comboConfig['foreign_table'], $comboRecord);
......
================================================================================================
Feature: #64535 - IRRE: Suppress and override useCombination warning via TCA settings
================================================================================================
Description
===========
When using ``useCombation=TRUE`` there is always a FlashMessage warning displayed.
It is now possible to override the default warning message with a custom message or
to suppress the FlashMessage completely via TCA setting.
Example to suppress useCombination warning message:
.. code-block:: php
$GLOBALS['TCA']['tx_demo_domain_model_demoinline']['columns']['irre_records']['config'] = array(
'foreign_types_combination' => array(
'1' => array(
'showitem' => 'title'
)
)
'appearance' => array(
'suppressCombinationWarning' => TRUE
'useCombination' => TRUE
)
)
Example to override useCombination warning message:
.. code-block:: php
$GLOBALS['TCA']['tx_demo_domain_model_demoinline']['columns']['irre_records']['config'] = array(
'foreign_types_combination' => array(
'1' => array(
'showitem' => 'title'
)
)
'appearance' => array(
'overwriteCombinationWarningMessage' => 'LLL:EXT:demo/Resources/Private/Language/locallang_db.xlf:tx_demo_domain_model_demoinline.irre_records.useCombinationWarning'
'useCombination' => TRUE
)
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment