workspace !== 0) { $viewScript = (string)GeneralUtility::makeInstance(PreviewUriBuilder::class)->buildUriForWorkspaceSplitPreview((int)$pageUid); $viewScript .= $additionalGetVars ?: ''; } } /** * Use that hook to show an info message in case someone starts editing * a staged element * * @param array $params * @return bool */ public function makeEditForm_accessCheck($params) { if ($GLOBALS['BE_USER']->workspace !== 0 && BackendUtility::isTableWorkspaceEnabled($params['table'])) { $record = BackendUtility::getRecordWSOL($params['table'], $params['uid']); if (abs($record['t3ver_stage']) > StagesService::STAGE_EDIT_ID) { $stages = GeneralUtility::makeInstance(StagesService::class); $stageName = $stages->getStageTitle($record['t3ver_stage']); $editingName = $stages->getStageTitle(StagesService::STAGE_EDIT_ID); $message = $this->getLanguageService()->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:info.elementAlreadyModified'); $flashMessage = GeneralUtility::makeInstance(FlashMessage::class, sprintf($message, $stageName, $editingName), '', FlashMessage::INFO, true); /** @var FlashMessageService $flashMessageService */ $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class); /** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue $defaultFlashMessageQueue */ $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier(); $defaultFlashMessageQueue->enqueue($flashMessage); } } return $params['hasAccess']; } /** * @return LanguageService|null */ protected function getLanguageService(): ?LanguageService { return $GLOBALS['LANG'] ?? null; } }