‪TYPO3CMS  11.5
TextmediaPreviewRenderer.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 
20 use TYPO3\CMS\Backend\Utility\BackendUtility;
22 
28 {
30  {
31  $content = '';
32  $row = $item->‪getRecord();
33  if ($row['bodytext']) {
34  $content = $this->‪linkEditContent($this->‪renderText($row['bodytext']), $row) . '<br />';
35  }
36 
37  if ($row['assets']) {
38  $content .= $this->‪linkEditContent(BackendUtility::thumbCode($row, 'tt_content', 'assets', '', '', null, 0, '', '', false), $row);
39 
40  $fileReferences = BackendUtility::resolveFileReferences('tt_content', 'assets', $row);
41 
42  if (!empty($fileReferences)) {
43  $linkedContent = '';
44 
45  foreach ($fileReferences as $fileReference) {
46  $description = $fileReference->getDescription();
47  if ($description !== null && $description !== '') {
48  $linkedContent .= htmlspecialchars($description) . '<br />';
49  }
50  }
51 
52  $content .= $this->‪linkEditContent($linkedContent, $row);
53  }
54  }
55  return $content;
56  }
57 }
‪TYPO3\CMS\Backend\Preview\StandardContentPreviewRenderer
Definition: StandardContentPreviewRenderer.php:50
‪TYPO3\CMS\Frontend\Preview\TextmediaPreviewRenderer
Definition: TextmediaPreviewRenderer.php:28
‪TYPO3\CMS\Frontend\Preview
Definition: ImagePreviewRenderer.php:18
‪TYPO3\CMS\Frontend\Preview\TextmediaPreviewRenderer\renderPageModulePreviewContent
‪renderPageModulePreviewContent(GridColumnItem $item)
Definition: TextmediaPreviewRenderer.php:29
‪TYPO3\CMS\Backend\Preview\StandardContentPreviewRenderer\renderText
‪string renderText(string $input)
Definition: StandardContentPreviewRenderer.php:365
‪TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem\getRecord
‪getRecord()
Definition: GridColumnItem.php:187
‪TYPO3\CMS\Backend\Preview\StandardContentPreviewRenderer\linkEditContent
‪string linkEditContent(string $linkText, $row)
Definition: StandardContentPreviewRenderer.php:410
‪TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem
Definition: GridColumnItem.php:44