[!!!][TASK] Use move placeholders as default in workspaces
[Packages/TYPO3.CMS.git] / typo3 / sysext / version / ext_localconf.php
index 017fb58..e43691f 100644 (file)
@@ -1,22 +1,19 @@
 <?php
+defined('TYPO3_MODE') or die();
 
-if (!defined ('TYPO3_MODE')) {
-       die ('Access denied.');
-}
-
-       // register the hook to actually do the work within TCEmain
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['version'] = t3lib_extMgm::extPath('version', 'class.tx_version_tcemain.php:&tx_version_tcemain');
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass']['version'] = t3lib_extMgm::extPath('version', 'class.tx_version_tcemain.php:&tx_version_tcemain');
+// register the hook to actually do the work within TCEmain
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['version'] = \TYPO3\CMS\Version\Hook\DataHandlerHook::class;
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass']['version'] = \TYPO3\CMS\Version\Hook\DataHandlerHook::class;
 
-if (TYPO3_MODE == 'BE') {
+// Register hook to check for the preview mode in the FE
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB']['version_preview'] = \TYPO3\CMS\Version\Hook\PreviewHook::class . '->checkForPreview';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['postBeUser']['version_preview'] = \TYPO3\CMS\Version\Hook\PreviewHook::class . '->initializePreviewUser';
 
-       // add default notification options to every page
-t3lib_extMgm::addPageTSconfig('
-       tx_version.workspaces.stageNotificationEmail.subject = LLL:EXT:version/Resources/Private/Language/locallang_emails.xml:subject
-       tx_version.workspaces.stageNotificationEmail.message = LLL:EXT:version/Resources/Private/Language/locallang_emails.xml:message
+if (TYPO3_MODE === 'BE') {
+    // add default notification options to every page
+    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSconfig('
+       tx_version.workspaces.stageNotificationEmail.subject = LLL:EXT:version/Resources/Private/Language/locallang_emails.xlf:subject
+       tx_version.workspaces.stageNotificationEmail.message = LLL:EXT:version/Resources/Private/Language/locallang_emails.xlf:message
        # tx_version.workspaces.stageNotificationEmail.additionalHeaders =
 ');
 }
-
-
-?>