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">