[FEATURE] Add TCA renderType additionalHelpText

This commit is contained in:
Philipp Dieter 2019-02-04 17:38:42 +01:00
parent bad951d9e7
commit e881d9b045
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,30 @@
<?php
//declare(strict_types=1);
namespace Cjel\TemplatesAide\FormEngine;
use TYPO3\CMS\Backend\Form\AbstractNode;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
class AdditionalHelpText extends AbstractNode
{
/**
* Handler for single nodes
*
* @return array As defined in initializeResultArray() of AbstractNode
*/
public function render(): array
{
$result = $this->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'] .= '<br />&nbsp;';
}
return $result;
}
}

View File

@ -47,3 +47,9 @@ call_user_func(
}
);
## 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,
];