Skip to content

Commit

Permalink
BUGFIX: #123
Browse files Browse the repository at this point in the history
  • Loading branch information
t3solution committed Jul 22, 2021
1 parent 1660407 commit bdf7bf2
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion Classes/Backend/Preview/T3sbPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3\CMS\Core\Service\FlexFormService;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Information\Typo3Version;

class T3sbPreviewRenderer extends StandardContentPreviewRenderer
{
Expand Down Expand Up @@ -167,7 +168,7 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string
}
if ( $flexconf['owlCarousel'] ) {
$out .= '<br />- OWL Carousel';
$out .= '<br />- OWL Style: '.$flexconf['owlStyle'];
$out .= '<br />- OWL Style: '.$flexconf['owlStyle'];
if ($flexconf['owlStyle'] == 1)
$out .= '<br />- OWL Line: '.$flexconf['owlLine'];
}
Expand Down Expand Up @@ -297,6 +298,7 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string
$view->assign('newContentTitleShort', $this->getLanguageService()->getLL('content'));
$view->assign('allowEditContent', $this->getBackendUser()->check('tables_modify', 'tt_content'));
$view->assign('containerGrid', $grid);
$view->assign('defaultRecordDirectory', $this->hasDefaultDirectory() ? 'RecordDefault' : 'Record');

$rendered = $view->render();

Expand Down Expand Up @@ -350,4 +352,27 @@ public function wrapPageModulePreview($previewHeader, $previewContent, GridColum
return $content;
}


/**
* Check TYPO3 version to see whether the default record templates
* are located in RecordDefault/ instead of Record/.
* See: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69769
*
* @return bool
*/
protected function hasDefaultDirectory(): bool
{
$typo3Version = new Typo3Version();

if ($typo3Version->getMajorVersion() === 10) {
return version_compare((new Typo3Version())->getVersion(), '10.4.17', '>');
}

if ($typo3Version->getMajorVersion() === 11) {
return version_compare((new Typo3Version())->getVersion(), '11.3.0', '>');
}

return false;
}

}

0 comments on commit bdf7bf2

Please sign in to comment.