[FEATURE] Add TCA renderType additionalHelpText
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user