[FEATURE] Add TCA renderType additionalHelpText
This commit is contained in:
parent
bad951d9e7
commit
e881d9b045
30
Classes/FormEngine/AdditionalHelpText.php
Normal file
30
Classes/FormEngine/AdditionalHelpText.php
Normal 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 /> ';
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
@ -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,
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user