From b748778803da88bc7a4f3a581e69df32b2cc819e Mon Sep 17 00:00:00 2001 From: Silvia Bigler Date: Wed, 27 Sep 2023 09:18:23 +0200 Subject: [PATCH] Add feature toggles for renderers Resolves #26 --- ext_localconf.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ext_localconf.php b/ext_localconf.php index 9f25918..9adf05a 100755 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -3,9 +3,15 @@ call_user_func( function () { + $GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['we_cookie_consent.YoutubeRenderer'] ??= true; + $GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['we_cookie_consent.VimeoRenderer'] ??= true; $rendererRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Rendering\RendererRegistry::class); - $rendererRegistry->registerRendererClass(\Websedit\WeCookieConsent\Resource\Rendering\YouTubeRenderer::class); - $rendererRegistry->registerRendererClass(\Websedit\WeCookieConsent\Resource\Rendering\VimeoRenderer::class); + if($GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['we_cookie_consent.YoutubeRenderer']) { + $rendererRegistry->registerRendererClass(\Websedit\WeCookieConsent\Resource\Rendering\YouTubeRenderer::class); + } + if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['we_cookie_consent.VimeoRenderer']) { + $rendererRegistry->registerRendererClass(\Websedit\WeCookieConsent\Resource\Rendering\VimeoRenderer::class); + } \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'WeCookieConsent',