The GPL headers named dreipunktnull and an old address and no longer match the license of the code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
35 lines
1010 B
PHP
35 lines
1010 B
PHP
<?php
|
|
|
|
namespace EP\EpTheme\DataProcessing;
|
|
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
|
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
|
|
use TYPO3\CMS\Frontend\Resource\FileCollector;
|
|
|
|
class TeaserImageProcessor implements DataProcessorInterface
|
|
{
|
|
|
|
/**
|
|
* @param ContentObjectRenderer $cObj
|
|
* @param array $contentObjectConfiguration
|
|
* @param array $processorConfiguration
|
|
* @param array $processedData
|
|
*
|
|
* @return array
|
|
*/
|
|
public function process(
|
|
ContentObjectRenderer $cObj,
|
|
array $contentObjectConfiguration,
|
|
array $processorConfiguration,
|
|
array $processedData
|
|
) {
|
|
$imageFileCollector = GeneralUtility::makeInstance(FileCollector::class);
|
|
$imageFileCollector->addFilesFromRelation('tt_content', 'assets', $cObj->data);
|
|
$processedData['teaserImage'] = reset($imageFileCollector->getFiles());
|
|
|
|
return $processedData;
|
|
}
|
|
|
|
}
|