From e881d9b045f357bb729e550c98168607d8265027 Mon Sep 17 00:00:00 2001 From: Philipp Dieter Date: Mon, 4 Feb 2019 17:38:42 +0100 Subject: [PATCH] [FEATURE] Add TCA renderType additionalHelpText --- Classes/FormEngine/AdditionalHelpText.php | 30 +++++++++++++++++++++++ ext_localconf.php | 8 +++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Classes/FormEngine/AdditionalHelpText.php diff --git a/Classes/FormEngine/AdditionalHelpText.php b/Classes/FormEngine/AdditionalHelpText.php new file mode 100644 index 0000000..fd9736a --- /dev/null +++ b/Classes/FormEngine/AdditionalHelpText.php @@ -0,0 +1,30 @@ +initializeResultArray(); + $text = $this->data['renderData']['fieldInformationOptions']['text']; + if (substr($text, 0, 4) !== 'LLL:') { + $result['html'] = $text; + } else { + $result['html'] = LocalizationUtility::translate($text, 'templates_aide'); + } + if (array_key_exists('linebreak', $this->data['renderData']['fieldInformationOptions'])) { + $result['html'] .= '
 '; + } + return $result; + } +} diff --git a/ext_localconf.php b/ext_localconf.php index 8817685..6a0e775 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -46,4 +46,10 @@ call_user_func( } ); -## EXTENSION BUILDER DEFAULTS END TOKEN - Everything BEFORE this line is overwritten with the defaults of the extension builder \ No newline at end of file +## EXTENSION BUILDER DEFAULTS END TOKEN - Everything BEFORE this line is overwritten with the defaults of the extension builder + +$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1549297828] = [ + 'nodeName' => 'additionalHelpText', + 'priority' => 30, + 'class' => \Cjel\TemplatesAide\FormEngine\AdditionalHelpText::class, +];