2 namespace TYPO3\CMS\Workspaces\Controller;
44 parent::initializeView($view);
46 $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
56 parent::initializeAction();
59 $this->pageRenderer->addJsFile(
'sysext/backend/Resources/Public/JavaScript/ExtDirect.StateProvider.js');
61 $GLOBALS[
'TBE_STYLES'][
'extJS'][
'theme'] = $resourcePath;
62 $this->pageRenderer->loadExtJS();
64 $this->pageRenderer->addExtDirectCode(array(
66 'TYPO3.ExtDirectStateProvider'
68 $states =
$GLOBALS[
'BE_USER']->uc[
'moduleData'][
'Workspaces'][
'States'];
69 $this->pageRenderer->addInlineSetting(
'Workspaces',
'States', $states);
70 $this->pageRenderer->addJsFile(
'sysext/backend/Resources/Public/JavaScript/notifications.js');
71 $this->pageRenderer->addJsFile(
'sysext/backend/Resources/Public/JavaScript/iframepanel.js');
74 'Ext.ux.plugins.TabStripContainer.js',
79 foreach ($jsFiles as $jsFile) {
80 $this->pageRenderer->addJsFile($resourcePathJavaScript . $jsFile);
82 $this->pageRenderer->addInlineSetting(
'FormEngine',
'moduleUrl', BackendUtility::getModuleUrl(
'record_edit'));
83 $this->pageRenderer->addInlineSetting(
'RecordHistory',
'moduleUrl', BackendUtility::getModuleUrl(
'record_history'));
85 $this->pageRenderer->addJsInlineCode(
'workspace-inline-code', $this->
generateJavascript());
96 public function indexAction($previewWS = null)
101 unset($queryParameters[
'tx_workspaces_web_workspacesworkspaces']);
102 unset($queryParameters[
'M']);
103 unset($queryParameters[
'id']);
108 $workspaceItemsArray = $this->workspaceService->selectVersionsInWorkspace($this->stageService->getWorkspaceId(), ($filter = 1), ($stage = -99),
$this->pageId, ($recursionLevel = 0), ($selectionType =
'tables_modify'));
109 list(, $nextStage) = $this->stageService->getNextStageForElementCollection($workspaceItemsArray);
110 list(, $previousStage) = $this->stageService->getPreviousStageForElementCollection($workspaceItemsArray);
113 $wsList = $wsService->getAvailableWorkspaces();
114 $activeWorkspace =
$GLOBALS[
'BE_USER']->workspace;
115 if (!is_null($previewWS)) {
116 if (in_array($previewWS, array_keys($wsList)) && $activeWorkspace != $previewWS) {
117 $activeWorkspace = $previewWS;
118 $GLOBALS[
'BE_USER']->setWorkspace($activeWorkspace);
123 $uriBuilder = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
125 $wsSettingsUri =
$uriBuilder->uriFor(
'singleIndex', array(), \TYPO3\CMS\Workspaces\Controller\ReviewController::class,
'workspaces',
'web_workspacesworkspaces');
126 $wsSettingsParams =
'&tx_workspaces_web_workspacesworkspaces[controller]=Review';
127 $wsSettingsUrl = $wsSettingsPath . $wsSettingsUri . $wsSettingsParams;
128 $viewDomain = BackendUtility::getViewDomain($this->pageId);
129 $wsBaseUrl = $viewDomain .
'/index.php?id=' . $this->pageId . $queryString;
133 $wsNewPageUri =
$uriBuilder->uriFor(
'newPage', array(), \TYPO3\CMS\Workspaces\Controller\PreviewController::class,
'workspaces',
'web_workspacesworkspaces');
134 $wsNewPageParams =
'&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
135 $this->view->assign(
'liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams);
137 $this->view->assign(
'liveUrl', $wsBaseUrl .
'&ADMCMD_noBeUser=1');
139 $this->view->assign(
'wsUrl', $wsBaseUrl .
'&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=' .
$GLOBALS[
'BE_USER']->workspace);
140 $this->view->assign(
'wsSettingsUrl', $wsSettingsUrl);
144 $allPreviewModes = array(
'slider',
'vbox',
'hbox');
145 if (!array_intersect($splitPreviewModes, $allPreviewModes)) {
146 $splitPreviewModes = $allPreviewModes;
148 $this->pageRenderer->addInlineSetting(
'Workspaces',
'SplitPreviewModes', $splitPreviewModes);
150 $this->pageRenderer->addInlineSetting(
'Workspaces',
'disableNextStageButton', $this->
isInvalidStage($nextStage));
151 $this->pageRenderer->addInlineSetting(
'Workspaces',
'disablePreviousStageButton', $this->
isInvalidStage($previousStage));
152 $this->pageRenderer->addInlineSetting(
'Workspaces',
'disableDiscardStageButton', $this->
isInvalidStage($nextStage) && $this->
isInvalidStage($previousStage));
154 $this->pageRenderer->addJsFile($resourcePath .
'Typo3Lang.js');
155 $this->pageRenderer->addJsInlineCode(
'workspaces.preview.lll',
'
162 workspacePreviewDetail: ' .
GeneralUtility::quoteJSvalue(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.workspacePreviewDetail',
true)) .
',
169 };TYPO3.l10n.initialize();
172 $this->pageRenderer->addJsFile($resourcePath .
'JavaScript/preview.js');
183 return !(is_array($stageArray) && !empty($stageArray));
189 public function newPageAction()
191 $flashMessage =
GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class,
$GLOBALS[
'LANG']->sL(
'LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:info.newpage.detail'),
$GLOBALS[
'LANG']->sL(
'LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:info.newpage'), \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
195 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
196 $defaultFlashMessageQueue->enqueue($flashMessage);
210 $newPageModule = trim(
$GLOBALS[
'BE_USER']->getTSConfigVal(
'options.overridePageModule'));
212 if (!
$GLOBALS[
'BE_USER']->check(
'modules', $pageModule)) {
215 $t3Configuration = array(
217 'PATH_typo3' => $pathTYPO3,
218 'PATH_typo3_enc' => rawurlencode($pathTYPO3),
219 'username' => htmlspecialchars(
$GLOBALS[
'BE_USER']->user[
'username']),
221 'securityLevel' => trim(
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'loginSecurityLevel']) ?:
'normal',
222 'TYPO3_mainDir' => TYPO3_mainDir,
223 'pageModule' => $pageModule,
224 'inWorkspace' =>
$GLOBALS[
'BE_USER']->workspace !== 0,
225 'workspaceFrontendPreviewEnabled' =>
$GLOBALS[
'BE_USER']->user[
'workspace_preview'] ? 1 : 0,
226 'veriCode' =>
$GLOBALS[
'BE_USER']->veriCode(),
227 'denyFileTypes' => PHP_EXTENSIONS_DEFAULT,
228 'moduleMenuWidth' => $this->menuWidth - 1,
229 'topBarHeight' => isset(
$GLOBALS[
'TBE_STYLES'][
'dims'][
'topFrameH']) ? (
int)
$GLOBALS[
'TBE_STYLES'][
'dims'][
'topFrameH'] : 30,
230 'showRefreshLoginPopup' => isset($GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'showRefreshLoginPopup']) ? (
int)$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'showRefreshLoginPopup'] :
false,
232 'debugInWindow' => $GLOBALS[
'BE_USER']->uc[
'debugInWindow'] ? 1 : 0,
233 'ContextHelpWindows' => array(
239 'waitTitle' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_logging_in'),
240 'refresh_login_failed' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_failed'),
241 'refresh_login_failed_message' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_failed_message'),
242 'refresh_login_title' => sprintf($GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_title'), htmlspecialchars($GLOBALS[
'BE_USER']->user[
'username'])),
243 'login_expired' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.login_expired'),
244 'refresh_login_username' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_username'),
245 'refresh_login_password' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_password'),
246 'refresh_login_emptyPassword' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_emptyPassword'),
247 'refresh_login_button' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_button'),
248 'refresh_logout_button' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_logout_button'),
249 'refresh_exit_button' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_exit_button'),
250 'please_wait' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.please_wait'),
251 'loadingIndicator' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:loadingIndicator'),
252 'be_locked' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.be_locked'),
253 'refresh_login_countdown_singular' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_countdown_singular'),
254 'refresh_login_countdown' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_countdown'),
255 'login_about_to_expire' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.login_about_to_expire'),
256 'login_about_to_expire_title' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.login_about_to_expire_title'),
257 'refresh_login_refresh_button' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_refresh_button'),
258 'refresh_direct_logout_button' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_direct_logout_button'),
259 'tabs_closeAll' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:tabs.closeAll'),
260 'tabs_closeOther' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:tabs.closeOther'),
261 'tabs_close' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:tabs.close'),
262 'tabs_openInBrowserWindow' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:tabs.openInBrowserWindow'),
263 'donateWindow_title' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:donateWindow.title'),
264 'donateWindow_message' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:donateWindow.message'),
265 'donateWindow_button_donate' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:donateWindow.button_donate'),
266 'donateWindow_button_disable' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:donateWindow.button_disable'),
267 'donateWindow_button_postpone' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:donateWindow.button_postpone')
270 TYPO3.configuration = ' . json_encode($t3Configuration) .
';
272 core : ' . json_encode($t3LLLcore) .
'
278 function typoSetup() { //
279 this.PATH_typo3 = TYPO3.configuration.PATH_typo3;
280 this.PATH_typo3_enc = TYPO3.configuration.PATH_typo3_enc;
281 this.username = TYPO3.configuration.username;
282 this.uniqueID = TYPO3.configuration.uniqueID;
283 this.securityLevel = TYPO3.configuration.securityLevel;
284 this.veriCode = TYPO3.configuration.veriCode;
285 this.denyFileTypes = TYPO3.configuration.denyFileTypes;
287 var TS = new typoSetup();
288 //backwards compatibility