[TASK] EXT:form - Optimize preview in page module 82/47082/2
authorBjörn Jacob <bjoern.jacob@tritum.de>
Fri, 4 Mar 2016 20:01:20 +0000 (21:01 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 4 Mar 2016 20:47:40 +0000 (21:47 +0100)
This patchset optimizes the preview of a form
elements in the page module. The output of the bodytext
field has been removed. Instead, the ctype is shown.
This avoids the useless display of TypoScript in the
preview.

Resolves: #28403
Releases: master, 7.6
Change-Id: I09a18e6b8a782a50a2ea7570b41fe2abc10df835
Reviewed-on: https://review.typo3.org/47082
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/form/Classes/Hooks/PageLayoutView/MailformPreviewRenderer.php

index 2170261..5a5b3f8 100644 (file)
@@ -34,7 +34,8 @@ class MailformPreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewD
     public function preProcess(\TYPO3\CMS\Backend\View\PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row)
     {
         if ($row['CType'] === 'mailform') {
-            $itemContent = $parentObject->linkEditContent($parentObject->renderText($row['bodytext']), $row) . '<br />';
+            $contentType = $parentObject->CType_labels[$row['CType']];
+            $itemContent = $parentObject->linkEditContent('<strong>' . htmlspecialchars($contentType) . '</strong>', $row) . '<br />';
             $drawItem = false;
         }
     }