2 namespace TYPO3\CMS\Workspaces\Service;
34 $currentAdminStatus =
$GLOBALS[
'BE_USER']->user[
'admin'];
35 $GLOBALS[
'BE_USER']->user[
'admin'] = 1;
37 $workspaces =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
38 'uid,swap_modes,publish_time,unpublish_time',
42 ((publish_time!=0 AND publish_time<=' . (
int)
$GLOBALS[
'EXEC_TIME'] .
')
45 $workspaceService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Workspaces\Service\WorkspaceService::class);
46 foreach ($workspaces as $rec) {
48 $fieldArray = $rec[
'publish_time'] != 0 ? array(
'publish_time' => 0) : array(
'unpublish_time' => 0);
49 $GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
'sys_workspace',
'uid=' . (
int)$rec[
'uid'], $fieldArray);
51 $cmd = $workspaceService->getCmdArrayForPublishWS($rec[
'uid'], $rec[
'swap_modes'] == 1);
54 $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
55 $tce->stripslashes_values = 0;
56 $tce->start(array(), $cmd);
57 $tce->process_cmdmap();
60 $GLOBALS[
'BE_USER']->user[
'admin'] = $currentAdminStatus;