first commit
This commit is contained in:
commit
1218dd1517
12716 files changed
+989233
No files matched your search
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Frontend\Hooks\PageLayoutView;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Contains a preview rendering for the page module of CType="image"
|
||||
* @internal this is a concrete TYPO3 hook implementation and solely used for EXT:frontend and not part of TYPO3's Core API.
|
||||
*/
|
||||
class ImagePreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface
|
||||
{
|
||||
/**
|
||||
* Preprocesses the preview rendering of the content element "image".
|
||||
*
|
||||
* @param \TYPO3\CMS\Backend\View\PageLayoutView $parentObject Calling parent object
|
||||
* @param bool $drawItem Whether to draw the item using the default functionalities
|
||||
* @param string $headerContent Header content
|
||||
* @param string $itemContent Item content
|
||||
* @param array $row Record row of tt_content
|
||||
*/
|
||||
public function preProcess(
|
||||
\TYPO3\CMS\Backend\View\PageLayoutView &$parentObject,
|
||||
&$drawItem,
|
||||
&$headerContent,
|
||||
&$itemContent,
|
||||
array &$row
|
||||
) {
|
||||
if ($row['CType'] === 'image') {
|
||||
if ($row['image']) {
|
||||
$itemContent .= $parentObject->linkEditContent($parentObject->getThumbCodeUnlinked($row, 'tt_content', 'image'), $row);
|
||||
|
||||
$fileReferences = \TYPO3\CMS\Backend\Utility\BackendUtility::resolveFileReferences('tt_content', 'image', $row);
|
||||
|
||||
if (!empty($fileReferences)) {
|
||||
$linkedContent = '';
|
||||
|
||||
foreach ($fileReferences as $fileReference) {
|
||||
$description = $fileReference->getDescription();
|
||||
if ($description !== null && $description !== '') {
|
||||
$linkedContent .= htmlspecialchars($description) . '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
$itemContent .= $parentObject->linkEditContent($linkedContent, $row);
|
||||
|
||||
unset($linkedContent);
|
||||
}
|
||||
}
|
||||
|
||||
$drawItem = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Frontend\Hooks\PageLayoutView;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Contains a preview rendering for the page module of CType="text"
|
||||
* @internal this is a concrete TYPO3 hook implementation and solely used for EXT:frontend and not part of TYPO3's Core API.
|
||||
*/
|
||||
class TextPreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface
|
||||
{
|
||||
/**
|
||||
* Preprocesses the preview rendering of the content element "text".
|
||||
*
|
||||
* @param \TYPO3\CMS\Backend\View\PageLayoutView $parentObject Calling parent object
|
||||
* @param bool $drawItem Whether to draw the item using the default functionalities
|
||||
* @param string $headerContent Header content
|
||||
* @param string $itemContent Item content
|
||||
* @param array $row Record row of tt_content
|
||||
*/
|
||||
public function preProcess(
|
||||
\TYPO3\CMS\Backend\View\PageLayoutView &$parentObject,
|
||||
&$drawItem,
|
||||
&$headerContent,
|
||||
&$itemContent,
|
||||
array &$row
|
||||
) {
|
||||
if ($row['CType'] === 'text') {
|
||||
if ($row['bodytext']) {
|
||||
$itemContent .= $parentObject->linkEditContent($parentObject->renderText($row['bodytext']), $row) . '<br />';
|
||||
}
|
||||
|
||||
$drawItem = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Frontend\Hooks\PageLayoutView;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Backend\Utility\BackendUtility;
|
||||
use TYPO3\CMS\Backend\View\PageLayoutView;
|
||||
use TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface;
|
||||
|
||||
/**
|
||||
* Contains a preview rendering for the page module of CType="textmedia"
|
||||
* @internal this is a concrete TYPO3 hook implementation and solely used for EXT:frontend and not part of TYPO3's Core API.
|
||||
*/
|
||||
class TextmediaPreviewRenderer implements PageLayoutViewDrawItemHookInterface
|
||||
{
|
||||
/**
|
||||
* Preprocesses the preview rendering of a content element of type "textmedia"
|
||||
*
|
||||
* @param \TYPO3\CMS\Backend\View\PageLayoutView $parentObject Calling parent object
|
||||
* @param bool $drawItem Whether to draw the item using the default functionality
|
||||
* @param string $headerContent Header content
|
||||
* @param string $itemContent Item content
|
||||
* @param array $row Record row of tt_content
|
||||
*/
|
||||
public function preProcess(
|
||||
PageLayoutView &$parentObject,
|
||||
&$drawItem,
|
||||
&$headerContent,
|
||||
&$itemContent,
|
||||
array &$row
|
||||
) {
|
||||
if ($row['CType'] === 'textmedia') {
|
||||
if ($row['bodytext']) {
|
||||
$itemContent .= $parentObject->linkEditContent($parentObject->renderText($row['bodytext']), $row) . '<br />';
|
||||
}
|
||||
|
||||
if ($row['assets']) {
|
||||
$itemContent .= $parentObject->linkEditContent($parentObject->getThumbCodeUnlinked($row, 'tt_content', 'assets'), $row) . '<br />';
|
||||
|
||||
$fileReferences = BackendUtility::resolveFileReferences('tt_content', 'assets', $row);
|
||||
|
||||
if (!empty($fileReferences)) {
|
||||
$linkedContent = '';
|
||||
|
||||
foreach ($fileReferences as $fileReference) {
|
||||
$description = $fileReference->getDescription();
|
||||
if ($description !== null && $description !== '') {
|
||||
$linkedContent .= htmlspecialchars($description) . '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
$itemContent .= $parentObject->linkEditContent($linkedContent, $row);
|
||||
|
||||
unset($linkedContent);
|
||||
}
|
||||
}
|
||||
|
||||
$drawItem = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Frontend\Hooks\PageLayoutView;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Contains a preview rendering for the page module of CType="textpic"
|
||||
* @internal this is a concrete TYPO3 hook implementation and solely used for EXT:frontend and not part of TYPO3's Core API.
|
||||
*/
|
||||
class TextpicPreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface
|
||||
{
|
||||
/**
|
||||
* Preprocesses the preview rendering of the content element "textpic".
|
||||
*
|
||||
* @param \TYPO3\CMS\Backend\View\PageLayoutView $parentObject Calling parent object
|
||||
* @param bool $drawItem Whether to draw the item using the default functionalities
|
||||
* @param string $headerContent Header content
|
||||
* @param string $itemContent Item content
|
||||
* @param array $row Record row of tt_content
|
||||
*/
|
||||
public function preProcess(
|
||||
\TYPO3\CMS\Backend\View\PageLayoutView &$parentObject,
|
||||
&$drawItem,
|
||||
&$headerContent,
|
||||
&$itemContent,
|
||||
array &$row
|
||||
) {
|
||||
if ($row['CType'] === 'textpic') {
|
||||
if ($row['bodytext']) {
|
||||
$itemContent .= $parentObject->linkEditContent($parentObject->renderText($row['bodytext']), $row) . '<br />';
|
||||
}
|
||||
|
||||
if ($row['image']) {
|
||||
$itemContent .= $parentObject->linkEditContent($parentObject->getThumbCodeUnlinked($row, 'tt_content', 'image'), $row);
|
||||
|
||||
$fileReferences = \TYPO3\CMS\Backend\Utility\BackendUtility::resolveFileReferences('tt_content', 'image', $row);
|
||||
|
||||
if (!empty($fileReferences)) {
|
||||
$linkedContent = '';
|
||||
|
||||
foreach ($fileReferences as $fileReference) {
|
||||
$description = $fileReference->getDescription();
|
||||
if ($description !== null && $description !== '') {
|
||||
$linkedContent .= htmlspecialchars($description) . '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
$itemContent .= $parentObject->linkEditContent($linkedContent, $row);
|
||||
|
||||
unset($linkedContent);
|
||||
}
|
||||
}
|
||||
|
||||
$drawItem = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user