From a5d15d8d3207f4f48caa17b2dae36db88eb8a02c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Wed, 27 Oct 2021 15:09:16 +0200 Subject: [PATCH] WIP Migrate event subsite styles --- .../ViewHelpers/ThemeClassesViewHelper.php | 66 +++++++++++++++++++ .../Extensions/FluidStyledContent.typoscript | 2 + .../Private/Partials/Disrupter/Large.html | 7 +- .../Private/Partials/Disrupter/Small.html | 5 +- .../Private/Partials/Disturber/Large.html | 7 +- .../Private/Partials/Disturber/Small.html | 5 +- .../Private/Partials/EventDisturber.html | 5 +- .../Resources/Private/Partials/Mainnav.html | 4 +- .../Templates/AjaxTable/EventPricetable.html | 4 +- .../Templates/FluidStyledContent/Lineup.html | 10 +-- 10 files changed, 95 insertions(+), 20 deletions(-) create mode 100644 public/typo3conf/ext/ep_theme/Classes/ViewHelpers/ThemeClassesViewHelper.php diff --git a/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/ThemeClassesViewHelper.php b/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/ThemeClassesViewHelper.php new file mode 100644 index 00000000..b61219db --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/ThemeClassesViewHelper.php @@ -0,0 +1,66 @@ +, 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 TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; +use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; +use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; + +class ThemeClassesViewHelper extends AbstractViewHelper +{ + use CompileWithRenderStatic; + + public function initializeArguments() + { + parent::initializeArguments(); + + $this->registerArgument('key', 'string', 'The theme key', false, 'ep'); + $this->registerArgument('classes', 'array', 'The classes to apply per theme key', true); + } + + /** + * @param array $arguments + * @param \Closure $renderChildrenClosure + * @param RenderingContextInterface $renderingContext + * @return mixed + */ + public static function renderStatic( + array $arguments, + \Closure $renderChildrenClosure, + RenderingContextInterface $renderingContext + ) + { + $themeKey = $arguments['key']; + + if (!array_key_exists($themeKey, $arguments['classes'])) { + return ''; + } + + return $arguments['classes'][$themeKey]; + } +} diff --git a/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/FluidStyledContent.typoscript b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/FluidStyledContent.typoscript index d6ba747d..7524ba1f 100644 --- a/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/FluidStyledContent.typoscript +++ b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/FluidStyledContent.typoscript @@ -5,4 +5,6 @@ lib.contentElement { templateRootPaths.20 = EXT:ep_theme/Resources/Private/Templates/FluidStyledContent partialRootPaths.20 = EXT:ep_theme/Resources/Private/Partials settings < plugin.tx_eptheme.settings + settings.themekey = {$plugin.tx_eptheme.settings.themekey} } + diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Large.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Large.html index 967e74ac..9bf5d8a9 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Large.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Large.html @@ -1,10 +1,11 @@ + xmlns:f="http://typo3.org/ns/fluid/ViewHelpers" + xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers">
-
+
+ class="absolute bottom-0 left-1/2 transform -translate-x-1/2 -mb-8 rounded-full py-4 px-6 flex items-center space-x-2 {ep:themeClasses(classes: '{ep: \'bg-ep-secondary\', sbw: \'bg-sbw-secondary\', snz: \'bg-snz-secondary\', uch: \'bg-uch-secondary\'}', key: settings.themekey)}"> diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Small.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Small.html index 1fe7c9aa..91939007 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Small.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Small.html @@ -1,9 +1,10 @@ + xmlns:f="http://typo3.org/ns/fluid/ViewHelpers" + xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers">
-
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html index 7187abad..7b162b13 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html @@ -1,10 +1,11 @@ + xmlns:f="http://typo3.org/ns/fluid/ViewHelpers" + xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers">
-
+
+ class="absolute bottom-0 left-1/2 transform -translate-x-1/2 -mb-8 rounded-full py-4 px-6 flex items-center space-x-2 {ep:themeClasses(classes: '{ep: \'bg-ep-secondary\', sbw: \'bg-sbw-secondary\', snz: \'bg-snz-secondary\', uch: \'bg-uch-secondary\'}', key: settings.themekey)}"> diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Small.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Small.html index 58918563..42675c0c 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Small.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Small.html @@ -1,9 +1,10 @@ + xmlns:f="http://typo3.org/ns/fluid/ViewHelpers" + xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers">
-
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/EventDisturber.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/EventDisturber.html index 76fc0689..246f6471 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/EventDisturber.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/EventDisturber.html @@ -1,10 +1,11 @@ + xmlns:f="http://typo3.org/ns/fluid/ViewHelpers" + xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers">