From 346baa02b34276c1769099f10f31e7cbb3be06fa Mon Sep 17 00:00:00 2001 From: Tolleiv Nietsch Date: Thu, 14 Jul 2011 18:26:02 +0200 Subject: [PATCH] [TASK] Move workspace preview functionality into versioning / workspace As the whole handling of the ADMCMD_preview is related to version / workspaces, the according code should go in these extensions. Change-Id: Iddb9cf435b8f9617625caefbda78738a0b8bf0fc Resolves: #27931 --- typo3/sysext/workspaces/Classes/Service/Workspaces.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/typo3/sysext/workspaces/Classes/Service/Workspaces.php b/typo3/sysext/workspaces/Classes/Service/Workspaces.php index de901e9a62e..c6d0faa3f8a 100644 --- a/typo3/sysext/workspaces/Classes/Service/Workspaces.php +++ b/typo3/sysext/workspaces/Classes/Service/Workspaces.php @@ -567,11 +567,13 @@ class tx_Workspaces_Service_Workspaces implements t3lib_Singleton { * @return string the full domain including the protocol http:// or https://, but without the trailing '/' */ public function generateWorkspacePreviewLink($uid) { - $timeToLiveHours = intval($GLOBALS['BE_USER']->getTSConfigVal('options.workspaces.previewLinkTTLHours')); - $timeToLiveHours = ($timeToLiveHours ? $timeToLiveHours : 24*2) * 3600; + $previewObject = t3lib_div::makeInstance('Tx_Version_Preview'); + $timeToLiveHours = $previewObject->getPreviewLinkLifetime(); + $previewKeyword = $previewObject->compilePreviewKeyword('', $GLOBALS['BE_USER']->user['uid'], ($timeToLiveHours*3600), $this->getCurrentWorkspace()); + $linkParams = array( - 'ADMCMD_prev' => t3lib_BEfunc::compilePreviewKeyword('', $GLOBALS['BE_USER']->user['uid'], $timeToLiveHours, $this->getCurrentWorkspace()), - 'id' => $uid + 'ADMCMD_prev' => $previewKeyword, + 'id' => $uid ); return t3lib_BEfunc::getViewDomain($uid) . '/index.php?' . t3lib_div::implodeArrayForUrl('', $linkParams); } -- 2.20.1