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