diff --git a/Classes/Event/Listener/RenderTranslatedFlagInFrontendPreviewMode.php b/Classes/Event/Listener/RenderTranslatedFlagInFrontendPreviewMode.php index eaffb0b0..d91f48c5 100644 --- a/Classes/Event/Listener/RenderTranslatedFlagInFrontendPreviewMode.php +++ b/Classes/Event/Listener/RenderTranslatedFlagInFrontendPreviewMode.php @@ -7,13 +7,11 @@ use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; use TYPO3\CMS\Frontend\Event\AfterCacheableContentIsGeneratedEvent; -use WebVision\Deepltranslate\Core\Hooks\DeeplPreviewFlagGeneratePageHook; /** * Event listener to render the frontend preview flag information. * - * TYPO3 v12+ only and this is the counter-part of the {@see DeeplPreviewFlagGeneratePageHook} for older TYPO3 versions. - * https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-97862-HooksRelatedToGeneratingPageContentRemoved.html + * @internal for `deepltranslate-core` internal usage and not part of public API. */ final class RenderTranslatedFlagInFrontendPreviewMode { diff --git a/Classes/Hooks/DeeplPreviewFlagGeneratePageHook.php b/Classes/Hooks/DeeplPreviewFlagGeneratePageHook.php deleted file mode 100644 index 90b73233..00000000 --- a/Classes/Hooks/DeeplPreviewFlagGeneratePageHook.php +++ /dev/null @@ -1,59 +0,0 @@ -getContext()->hasAspect('frontend.preview') - && $controller->getContext()->getPropertyFromAspect('frontend.preview', 'isPreview'); - if ( - !$isInPreviewMode - || $controller->getContext()->getPropertyFromAspect('workspace', 'isOffline', false) - || ($controller->config['config']['disablePreviewNotification'] ?? false) - || ( - isset($controller->page['tx_wvdeepltranslate_translated_time']) - && $controller->page['tx_wvdeepltranslate_translated_time'] === 0 - ) - ) { - return; - } - - $messagePreviewLabel = $controller->config['config']['deepl_message_preview'] ?? ''; - if ($messagePreviewLabel === '') { - $messagePreviewLabel = 'Translated with DeepL'; - } - - $styles = []; - $styles[] = 'position: fixed'; - $styles[] = 'top: 65px'; - $styles[] = 'right: 15px'; - $styles[] = 'padding: 8px 18px'; - $styles[] = 'background: #006494'; - $styles[] = 'border: 1px solid #006494'; - $styles[] = 'font-family: sans-serif'; - $styles[] = 'font-size: 14px'; - $styles[] = 'font-weight: bold'; - $styles[] = 'color: #fff'; - $styles[] = 'z-index: 20000'; - $styles[] = 'user-select: none'; - $styles[] = 'pointer-events: none'; - $styles[] = 'text-align: center'; - $styles[] = 'border-radius: 2px'; - $message = '