From 0262738c913122cf30edf0b0c1db7be746f6edb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Mon, 27 Sep 2021 18:26:56 +0200 Subject: [PATCH] Add preview renderers for custom content elements --- .../ConfigurationMissingException.php | 6 + .../TemplateFileMissingException.php | 6 + .../ep_theme/Classes/Hook/PageLayoutView.php | 137 ---------------- .../AbstractPreviewRenderer.php | 146 ++++++++++++++++++ .../DisrupterPreviewRenderer.php | 20 +++ .../DisturberPreviewRenderer.php | 8 + .../PageLayoutView/GmapPreviewRenderer.php | 26 ++++ .../PageLayoutView/LineupPreviewRenderer.php | 31 ++++ .../TeaserCityPreviewRenderer.php | 20 +++ .../TeaserConceptPreviewRenderer.php | 20 +++ .../TeaserCountryPreviewRenderer.php | 20 +++ .../TeaserHotelPreviewRenderer.php | 20 +++ .../TeaserProductPreviewRenderer.php | 24 +++ .../TeaserRegionPreviewRenderer.php | 20 +++ .../TCA/Overrides/tt_content.php | 10 +- .../Templates/PreviewRenderer/Disrupter.html | 11 ++ .../Templates/PreviewRenderer/Disturber.html | 24 +++ .../Templates/PreviewRenderer/Gmap.html | 11 ++ .../Templates/PreviewRenderer/Lineup.html | 15 ++ .../Templates/PreviewRenderer/TeaserCity.html | 23 +++ .../PreviewRenderer/TeaserConcept.html | 23 +++ .../PreviewRenderer/TeaserCountry.html | 23 +++ .../PreviewRenderer/TeaserHotel.html | 23 +++ .../PreviewRenderer/TeaserProduct.html | 23 +++ .../PreviewRenderer/TeaserRegion.html | 23 +++ .../typo3conf/ext/ep_theme/ext_localconf.php | 24 ++- 26 files changed, 596 insertions(+), 141 deletions(-) create mode 100644 public/typo3conf/ext/ep_theme/Classes/Exception/ConfigurationMissingException.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Exception/TemplateFileMissingException.php delete mode 100644 public/typo3conf/ext/ep_theme/Classes/Hook/PageLayoutView.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/AbstractPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/DisrupterPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/DisturberPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/GmapPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/LineupPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserCityPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserConceptPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserCountryPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserHotelPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserProductPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserRegionPreviewRenderer.php create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Disrupter.html create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Disturber.html create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Gmap.html create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Lineup.html create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserCity.html create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserConcept.html create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserCountry.html create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserHotel.html create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserProduct.html create mode 100644 public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserRegion.html diff --git a/public/typo3conf/ext/ep_theme/Classes/Exception/ConfigurationMissingException.php b/public/typo3conf/ext/ep_theme/Classes/Exception/ConfigurationMissingException.php new file mode 100644 index 00000000..a59dd0a2 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Exception/ConfigurationMissingException.php @@ -0,0 +1,6 @@ +, dreipunktnull - * - * All rights reserved - * - * This script is part of the TYPO3 project. The TYPO3 project is - * free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * The GNU General Public License can be found at - * http://www.gnu.org/copyleft/gpl.html. - * - * This script is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * This copyright notice MUST APPEAR in all copies of the script! - ***************************************************************/ - -use TYPO3\CMS\Backend\Utility\BackendUtility; -use TYPO3\CMS\Backend\View\PageLayoutView as CorePageLayoutView; -use TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface; - -class PageLayoutView implements PageLayoutViewDrawItemHookInterface -{ - - /** - * @param CorePageLayoutView $parentObject - * @param bool $drawItem - * @param string $headerContent - * @param string $itemContent - * @param array $row - */ - public function preProcess(CorePageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row) - { - switch ($row['CType']) - { - case 'teaser_country': - if ((int) $row['tx_eptheme_context_country'] > 0) { - $drawItem = false; - $country = BackendUtility::getRecord('tx_epproducts_domain_model_country', $row['tx_eptheme_context_country']); - $itemContent = 'Teaser Land
' . $country['name']; - } - break; - case 'teaser_region': - if ((int) $row['tx_eptheme_context_region'] > 0) { - $drawItem = false; - $region = BackendUtility::getRecord('tx_epproducts_domain_model_region', $row['tx_eptheme_context_region']); - $itemContent = 'Teaser Gebiet
' . $region['name']; - } - break; - case 'teaser_city': - if ((int) $row['tx_eptheme_context_city'] > 0) { - $drawItem = false; - $city = BackendUtility::getRecord('tx_epproducts_domain_model_city', $row['tx_eptheme_context_city']); - $itemContent = 'Teaser Ort
' . $city['name']; - } - break; - case 'teaser_hotel': - if ((int) $row['tx_eptheme_context_hotel'] > 0) { - $drawItem = false; - $hotel = BackendUtility::getRecord('tx_epproducts_domain_model_hotel', $row['tx_eptheme_context_hotel']); - $itemContent = 'Teaser Hotel
' . $hotel['name']; - } - break; - case 'teaser_concept': - if ((int) $row['tx_eptheme_context_concept'] > 0) { - $drawItem = false; - $concept = BackendUtility::getRecord('tx_epproducts_domain_model_concept', $row['tx_eptheme_context_concept']); - $itemContent = 'Teaser Konzept
' . $concept['name']; - } - break; - case 'teaser_product': - if ((int) $row['tx_eptheme_context_product'] > 0) { - $drawItem = false; - $product = BackendUtility::getRecord('tx_epproducts_domain_model_product', $row['tx_eptheme_context_product']); - $itemContent = 'Teaser Product
' . $product['name']; - if ((int) $row['tx_eptheme_context_hotel'] > 0) { - $hotel = BackendUtility::getRecord('tx_epproducts_domain_model_hotel', - $row['tx_eptheme_context_hotel']); - $itemContent .= ', ' . $hotel['name']; - } - } - break; - case 'gmap': - if ((int) $row['tx_eptheme_context_region'] > 0) { - $drawItem = false; - $region = BackendUtility::getRecord('tx_epproducts_domain_model_region', $row['tx_eptheme_context_region']); - $itemContent = 'Google Map
' . $region['name']; - } elseif ((int) $row['tx_eptheme_context_hotel'] > 0) { - $drawItem = false; - $hotel = BackendUtility::getRecord('tx_epproducts_domain_model_hotel', $row['tx_eptheme_context_hotel']); - $itemContent = 'Google Map
' . $hotel['name']; - } - break; - case 'disturber': - $drawItem = false; - switch ($row['layout']) - { - case 1: - $size = 'groß'; - break; - case 2: - $size = 'Event klein'; - break; - case 3: - $size = 'Event groß'; - break; - default: - $size = 'klein'; - } - $itemContent = 'Störer ' . $size . ''; - break; - case 'disrupter': - $drawItem = false; - $disrupter = BackendUtility::getRecord('tx_eptheme_domain_model_disrupter', $row['tx_eptheme_disrupter']); - $itemContent = 'Störer
' . $disrupter['headline']; - break; - case 'lineup': - $drawItem = false; - $itemContent = 'Lineup
' . $row['tx_eptheme_lineup'] . ' Einträge'; - break; - default: - } - } - -} diff --git a/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/AbstractPreviewRenderer.php b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/AbstractPreviewRenderer.php new file mode 100644 index 00000000..7765f640 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/AbstractPreviewRenderer.php @@ -0,0 +1,146 @@ +cType)) { + throw new ConfigurationMissingException('Property cType must not be empty', 1586703436); + } + } + + public function preProcess( + PageLayoutView &$parentObject, + &$drawItem, + &$headerContent, + &$itemContent, + array &$row + ) { + $this->data = &$row; + if ($this->isCtypeMatching() && $this->checkTemplateFile()) { + $drawItem = false; + $headerContent = $this->getHeaderContent(); + $itemContent .= $this->getBodytext(); + } + } + + protected function getHeaderContent(): string + { + return '
'; + } + + protected function getBodytext(): string + { + /** @var ObjectManager $objectManager */ + $objectManager = GeneralUtility::makeInstance(ObjectManager::class); + $standaloneView = $objectManager->get(StandaloneView::class); + $standaloneView->setTemplatePathAndFilename($this->getTemplateFile()); + $standaloneView->assignMultiple($this->getAssignmentsForTemplate() + [ + 'data' => $this->data, + 'flexForm' => $this->getFlexForm(), + 'firstImage' => count($this->getImages()) > 0 ? $this->getImages()[0] : null, + 'images' => $this->getImages() + ]); + return $standaloneView->render(); + } + + protected function getAssignmentsForTemplate(): array + { + return []; + } + + protected function getFlexForm(): array + { + /** @var ObjectManager $objectManager */ + $objectManager = GeneralUtility::makeInstance(ObjectManager::class); + $flexFormService = $objectManager->get(FlexFormService::class); + return $flexFormService->convertFlexFormContentToArray($this->data['pi_flexform']); + } + + protected function getImages(int $uid = null, string $tablenames = 'tt_content', string $fieldname = 'image'): array + { + $uid = $uid ?? $this->data['uid']; + $references = []; + /** @var ObjectManager $objectManager */ + $objectManager = GeneralUtility::makeInstance(ObjectManager::class); + $fileRepository = $objectManager->get(FileRepository::class); + /** @var ConnectionPool $connectionPool */ + $connectionPool = $objectManager->get(ConnectionPool::class); + $queryBuilder = $connectionPool->getQueryBuilderForTable('sys_file_reference'); + $identifiers = (array)$queryBuilder + ->select('uid') + ->from('sys_file_reference') + ->where('uid_foreign=' . $uid . ' and tablenames="' . $tablenames . '" and fieldname="' . $fieldname . '"') + ->execute() + ->fetch(\PDO::FETCH_COLUMN); + foreach ($identifiers as $identifier) { + if ($identifier > 0) { + $reference = $fileRepository->findFileReferenceByUid($identifier); + if ($reference !== null) { + $references[] = $reference; + } + } + } + return $references; + } + + /** + * @return bool + */ + protected function isCtypeMatching(): bool + { + return $this->data['CType'] === $this->cType; + } + + protected function checkTemplateFile(): bool + { + if (is_file($this->getTemplateFile()) === false) { + throw new TemplateFileMissingException( + 'Expected template file for preview rendering for CType ' . $this->cType . ' is missing', + 1586703260 + ); + } + return true; + } + + protected function getTemplateFile(): string + { + return GeneralUtility::getFileAbsFileName( + $this->templatePath . GeneralUtility::underscoredToUpperCamelCase($this->data['CType']) . '.html' + ); + } +} diff --git a/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/DisrupterPreviewRenderer.php b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/DisrupterPreviewRenderer.php new file mode 100644 index 00000000..523635b3 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/DisrupterPreviewRenderer.php @@ -0,0 +1,20 @@ +data['tx_eptheme_disrupter']; + $content = BackendUtility::getRecord('tx_eptheme_domain_model_disrupter', $uid); + + return [ + 'content' => $content, + ]; + } +} diff --git a/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/DisturberPreviewRenderer.php b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/DisturberPreviewRenderer.php new file mode 100644 index 00000000..088fed60 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/DisturberPreviewRenderer.php @@ -0,0 +1,8 @@ +data['tx_eptheme_context_region']; + if ((int)$uid > 0) { + $content = BackendUtility::getRecord('tx_epproducts_domain_model_region', $uid); + } else { + $uid = $this->data['tx_eptheme_context_hotel']; + $content = BackendUtility::getRecord('tx_epproducts_domain_model_hotel', $uid); + + } + + return [ + 'content' => $content, + ]; + } +} diff --git a/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/LineupPreviewRenderer.php b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/LineupPreviewRenderer.php new file mode 100644 index 00000000..d1763734 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/LineupPreviewRenderer.php @@ -0,0 +1,31 @@ +get(ConnectionPool::class); + $queryBuilder = $connectionPool->getQueryBuilderForTable('tx_eptheme_domain_model_lineup'); + $rows = $queryBuilder->select('*') + ->from('tx_eptheme_domain_model_lineup') + ->where('tt_content='.$this->data['uid']) + ->orderBy('sorting', 'ASC') + ->execute() + ->fetchAllAssociative(); + + return [ + 'rows' => $rows, + ]; + } +} diff --git a/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserCityPreviewRenderer.php b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserCityPreviewRenderer.php new file mode 100644 index 00000000..e8e10682 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserCityPreviewRenderer.php @@ -0,0 +1,20 @@ +data['tx_eptheme_context_city']; + $images = $this->getImages($uid, 'tx_epproducts_domain_model_city', 'teaser_images'); + return [ + 'images' => $images, + 'city' => BackendUtility::getRecord('tx_epproducts_domain_model_city', $uid), + ]; + } +} diff --git a/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserConceptPreviewRenderer.php b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserConceptPreviewRenderer.php new file mode 100644 index 00000000..ea52ab9d --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserConceptPreviewRenderer.php @@ -0,0 +1,20 @@ +data['tx_eptheme_context_concept']; + $images = $this->getImages($uid, 'tx_epproducts_domain_model_concept', 'teaser_images'); + return [ + 'images' => $images, + 'concept' => BackendUtility::getRecord('tx_epproducts_domain_model_concept', $uid), + ]; + } +} diff --git a/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserCountryPreviewRenderer.php b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserCountryPreviewRenderer.php new file mode 100644 index 00000000..35ccbccb --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserCountryPreviewRenderer.php @@ -0,0 +1,20 @@ +data['tx_eptheme_context_country']; + $images = $this->getImages($countryUid, 'tx_epproducts_domain_model_country', 'teaser_images'); + return [ + 'images' => $images, + 'country' => BackendUtility::getRecord('tx_epproducts_domain_model_country', $countryUid), + ]; + } +} diff --git a/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserHotelPreviewRenderer.php b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserHotelPreviewRenderer.php new file mode 100644 index 00000000..43d95d50 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserHotelPreviewRenderer.php @@ -0,0 +1,20 @@ +data['tx_eptheme_context_hotel']; + $images = $this->getImages($uid, 'tx_epproducts_domain_model_hotel', 'teaser_images'); + return [ + 'images' => $images, + 'hotel' => BackendUtility::getRecord('tx_epproducts_domain_model_hotel', $uid), + ]; + } +} diff --git a/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserProductPreviewRenderer.php b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserProductPreviewRenderer.php new file mode 100644 index 00000000..24ae8917 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserProductPreviewRenderer.php @@ -0,0 +1,24 @@ +data['tx_eptheme_context_product']; + $hotelUid = $this->data['tx_eptheme_context_hotel']; + $images = $this->getImages($productUid, 'tx_epproducts_domain_model_product', 'teaser_images'); + $product = BackendUtility::getRecord('tx_epproducts_domain_model_product', $productUid); + $hotel = $hotelUid ? BackendUtility::getRecord('tx_epproducts_domain_model_hotel', $hotelUid) : null; + return [ + 'images' => $images, + 'product' => $product, + 'hotel' => $hotel, + ]; + } +} diff --git a/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserRegionPreviewRenderer.php b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserRegionPreviewRenderer.php new file mode 100644 index 00000000..9d221b19 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/Hooks/PageLayoutView/TeaserRegionPreviewRenderer.php @@ -0,0 +1,20 @@ +data['tx_eptheme_context_region']; + $images = $this->getImages($uid, 'tx_epproducts_domain_model_region', 'teaser_images'); + return [ + 'images' => $images, + 'region' => BackendUtility::getRecord('tx_epproducts_domain_model_region', $uid), + ]; + } +} diff --git a/public/typo3conf/ext/ep_theme/Configuration/TCA/Overrides/tt_content.php b/public/typo3conf/ext/ep_theme/Configuration/TCA/Overrides/tt_content.php index 10353da4..cd4c991c 100644 --- a/public/typo3conf/ext/ep_theme/Configuration/TCA/Overrides/tt_content.php +++ b/public/typo3conf/ext/ep_theme/Configuration/TCA/Overrides/tt_content.php @@ -16,6 +16,7 @@ call_user_func(function () { 'items' => [ ['Keine Zuordnung', 0], ], + 'default' => 0, 'minitems' => 0, 'maxitems' => 1, ] @@ -31,6 +32,7 @@ call_user_func(function () { 'items' => [ ['Keine Zuordnung', 0], ], + 'default' => 0, 'minitems' => 0, 'maxitems' => 1, ] @@ -46,6 +48,7 @@ call_user_func(function () { 'items' => [ ['Keine Zuordnung', 0], ], + 'default' => 0, 'minitems' => 0, 'maxitems' => 1, ] @@ -61,6 +64,7 @@ call_user_func(function () { 'items' => [ ['Keine Zuordnung', 0], ], + 'default' => 0, 'minitems' => 0, 'maxitems' => 1, ] @@ -76,6 +80,7 @@ call_user_func(function () { 'items' => [ ['Keine Zuordnung', 0], ], + 'default' => 0, 'minitems' => 0, 'maxitems' => 1, ] @@ -91,6 +96,7 @@ call_user_func(function () { 'items' => [ ['Keine Zuordnung', 0], ], + 'default' => 0, 'minitems' => 0, 'maxitems' => 1, ] @@ -101,7 +107,7 @@ call_user_func(function () { 'config' => [ 'type' => 'input', 'size' => 12, - 'eval' => 'date', + 'eval' => 'date,int', 'renderType' => 'inputDateTime', ] ], @@ -111,7 +117,7 @@ call_user_func(function () { 'config' => [ 'type' => 'input', 'size' => 12, - 'eval' => 'date', + 'eval' => 'date,int', 'renderType' => 'inputDateTime', ] ], diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Disrupter.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Disrupter.html new file mode 100644 index 00000000..e97e2f9e --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Disrupter.html @@ -0,0 +1,11 @@ +{namespace be=TYPO3\CMS\Backend\ViewHelpers} +
+
+

+ Störer +

+ + {content.headline} + +
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Disturber.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Disturber.html new file mode 100644 index 00000000..960ae76b --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Disturber.html @@ -0,0 +1,24 @@ +{namespace be=TYPO3\CMS\Backend\ViewHelpers} +
+
+

+ Störer +

+ + + + groß + > + + Event klein + + + Event groß + + + klein + + + +
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Gmap.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Gmap.html new file mode 100644 index 00000000..dcb9ca08 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Gmap.html @@ -0,0 +1,11 @@ +{namespace be=TYPO3\CMS\Backend\ViewHelpers} +
+
+

+ OSM Karte +

+ + {content.name} ({content.latitude}, {content.longitude}) + +
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Lineup.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Lineup.html new file mode 100644 index 00000000..d91851c9 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/Lineup.html @@ -0,0 +1,15 @@ +{namespace be=TYPO3\CMS\Backend\ViewHelpers} +
+
+

+ Lineup +

+
    + +
  • + {row.name} +
  • +
    +
+
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserCity.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserCity.html new file mode 100644 index 00000000..b9a1206b --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserCity.html @@ -0,0 +1,23 @@ +{namespace be=TYPO3\CMS\Backend\ViewHelpers} +
+
+

+ Teaser Ort +

+

+ + + + + + + + +

+ + {city.name} + +
+ {city.teaser -> f:format.html()} +
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserConcept.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserConcept.html new file mode 100644 index 00000000..cb8d8447 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserConcept.html @@ -0,0 +1,23 @@ +{namespace be=TYPO3\CMS\Backend\ViewHelpers} +
+
+

+ Teaser Konzept +

+

+ + + + + + + + +

+ + {concept.name} + +
+ {concept.teaser -> f:format.html()} +
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserCountry.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserCountry.html new file mode 100644 index 00000000..126aa0e4 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserCountry.html @@ -0,0 +1,23 @@ +{namespace be=TYPO3\CMS\Backend\ViewHelpers} +
+
+

+ Teaser Land +

+

+ + + + + + + + +

+ + {country.name} + +
+ {country.teaser -> f:format.html()} +
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserHotel.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserHotel.html new file mode 100644 index 00000000..731bdff0 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserHotel.html @@ -0,0 +1,23 @@ +{namespace be=TYPO3\CMS\Backend\ViewHelpers} +
+
+

+ Teaser Hotel +

+

+ + + + + + + + +

+ + {hotel.name} + +
+ {hotel.teaser -> f:format.html()} +
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserProduct.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserProduct.html new file mode 100644 index 00000000..40feb7c3 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserProduct.html @@ -0,0 +1,23 @@ +{namespace be=TYPO3\CMS\Backend\ViewHelpers} +
+
+

+ Teaser Produkt +

+

+ + + + + + + + +

+ + {product.name} + +
+ {product.teaser -> f:format.html()} +
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserRegion.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserRegion.html new file mode 100644 index 00000000..8ad9aa6e --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/PreviewRenderer/TeaserRegion.html @@ -0,0 +1,23 @@ +{namespace be=TYPO3\CMS\Backend\ViewHelpers} +
+
+

+ Teaser Gebiet +

+

+ + + + + + + + +

+ + {region.name} + +
+ {region.teaser -> f:format.html()} +
+
diff --git a/public/typo3conf/ext/ep_theme/ext_localconf.php b/public/typo3conf/ext/ep_theme/ext_localconf.php index 05574e63..df8e0b05 100644 --- a/public/typo3conf/ext/ep_theme/ext_localconf.php +++ b/public/typo3conf/ext/ep_theme/ext_localconf.php @@ -14,8 +14,28 @@ $GLOBALS['TYPO3_CONF_VARS']['LOG']['EP']['EpTheme']['Service']['BookingApiServic $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['ep_theme'] = \EP\EpTheme\Hook\Tcemain::class; -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['ep_theme'] = - \EP\EpTheme\Hook\PageLayoutView::class; + +$layout = 'cms/layout/class.tx_cms_layout.php'; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['teaser_country'] = + \EP\EpTheme\Hooks\PageLayoutView\TeaserCountryPreviewRenderer::class; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['teaser_region'] = + \EP\EpTheme\Hooks\PageLayoutView\TeaserRegionPreviewRenderer::class; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['teaser_city'] = + \EP\EpTheme\Hooks\PageLayoutView\TeaserCityPreviewRenderer::class; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['teaser_hotel'] = + \EP\EpTheme\Hooks\PageLayoutView\TeaserHotelPreviewRenderer::class; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['teaser_concept'] = + \EP\EpTheme\Hooks\PageLayoutView\TeaserConceptPreviewRenderer::class; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['teaser_product'] = + \EP\EpTheme\Hooks\PageLayoutView\TeaserProductPreviewRenderer::class; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['gmap'] = + \EP\EpTheme\Hooks\PageLayoutView\GmapPreviewRenderer::class; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['disturber'] = + \EP\EpTheme\Hooks\PageLayoutView\DisturberPreviewRenderer::class; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['disrupter'] = + \EP\EpTheme\Hooks\PageLayoutView\DisrupterPreviewRenderer::class; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][$layout]['tt_content_drawItem']['lineup'] = + \EP\EpTheme\Hooks\PageLayoutView\LineupPreviewRenderer::class; $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] = 'tx_eptheme_slides';