Skip to content

Commit

Permalink
Add feature toggles for renderers
Browse files Browse the repository at this point in the history
Resolves websedit#26
  • Loading branch information
Silvia Bigler committed Sep 27, 2023
1 parent 43cdb3b commit b748778
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit b748778

Please sign in to comment.