44 parent::initializeAction();
47 $this->
template->setExtDirectStateProvider();
49 $GLOBALS[
'TBE_STYLES'][
'extJS'][
'theme'] = $resourcePath;
50 $this->pageRenderer->loadExtJS();
51 $this->pageRenderer->enableExtJSQuickTips();
53 $this->pageRenderer->addExtDirectCode(array(
55 'TYPO3.ExtDirectStateProvider' 57 $states =
$GLOBALS[
'BE_USER']->uc[
'moduleData'][
'Workspaces'][
'States'];
58 $this->pageRenderer->addInlineSetting(
'Workspaces',
'States', $states);
59 $this->pageRenderer->addJsFile($this->backPath .
'sysext/backend/Resources/Public/JavaScript/notifications.js');
60 $this->pageRenderer->addJsFile($this->backPath .
'sysext/backend/Resources/Public/JavaScript/flashmessages.js');
61 $this->pageRenderer->addJsFile($this->backPath .
'sysext/backend/Resources/Public/JavaScript/iframepanel.js');
64 'Ext.ux.plugins.TabStripContainer.js',
69 foreach ($jsFiles as $jsFile) {
70 $this->pageRenderer->addJsFile($resourcePathJavaScript . $jsFile);
74 $this->pageRenderer->addJsInlineCode(
'workspace-inline-code', $this->
generateJavascript());
85 public function indexAction($previewWS = NULL) {
89 unset($queryParameters[
'tx_workspaces_web_workspacesworkspaces']);
90 unset($queryParameters[
'M']);
91 unset($queryParameters[
'id']);
96 $workspaceItemsArray = $this->workspaceService->selectVersionsInWorkspace($this->stageService->getWorkspaceId(), ($filter = 1), ($stage = -99),
$this->pageId, ($recursionLevel = 0), ($selectionType =
'tables_modify'));
97 list(, $nextStage) = $this->stageService->getNextStageForElementCollection($workspaceItemsArray);
98 list(, $previousStage) = $this->stageService->getPreviousStageForElementCollection($workspaceItemsArray);
101 $wsList = $wsService->getAvailableWorkspaces();
102 $activeWorkspace =
$GLOBALS[
'BE_USER']->workspace;
103 if (!is_null($previewWS)) {
104 if (in_array($previewWS, array_keys($wsList)) && $activeWorkspace != $previewWS) {
105 $activeWorkspace = $previewWS;
106 $GLOBALS[
'BE_USER']->setWorkspace($activeWorkspace);
111 $uriBuilder = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
113 $wsSettingsUri =
$uriBuilder->uriFor(
'singleIndex', array(),
'TYPO3\\CMS\\Workspaces\\Controller\\ReviewController',
'workspaces',
'web_workspacesworkspaces');
114 $wsSettingsParams =
'&tx_workspaces_web_workspacesworkspaces[controller]=Review';
115 $wsSettingsUrl = $wsSettingsPath . $wsSettingsUri . $wsSettingsParams;
116 $viewDomain = BackendUtility::getViewDomain($this->pageId);
117 $wsBaseUrl = $viewDomain .
'/index.php?id=' . $this->pageId . $queryString;
120 if (\
TYPO3\CMS\Workspaces\Service\WorkspaceService::isNewPage($this->pageId)) {
121 $wsNewPageUri =
$uriBuilder->uriFor(
'newPage', array(),
'TYPO3\\CMS\\Workspaces\\Controller\\PreviewController',
'workspaces',
'web_workspacesworkspaces');
122 $wsNewPageParams =
'&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
123 $this->view->assign(
'liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams .
'&ADMCMD_prev=IGNORE');
125 $this->view->assign(
'liveUrl', $wsBaseUrl .
'&ADMCMD_noBeUser=1&ADMCMD_prev=IGNORE');
127 $this->view->assign(
'wsUrl', $wsBaseUrl .
'&ADMCMD_prev=IGNORE&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=' .
$GLOBALS[
'BE_USER']->workspace);
128 $this->view->assign(
'wsSettingsUrl', $wsSettingsUrl);
132 $allPreviewModes = array(
'slider',
'vbox',
'hbox');
133 if (!array_intersect($splitPreviewModes, $allPreviewModes)) {
134 $splitPreviewModes = $allPreviewModes;
136 $this->pageRenderer->addInlineSetting(
'Workspaces',
'SplitPreviewModes', $splitPreviewModes);
138 $this->pageRenderer->addInlineSetting(
'Workspaces',
'disableNextStageButton', $this->
isInvalidStage($nextStage));
139 $this->pageRenderer->addInlineSetting(
'Workspaces',
'disablePreviousStageButton', $this->
isInvalidStage($previousStage));
140 $this->pageRenderer->addInlineSetting(
'Workspaces',
'disableDiscardStageButton', $this->
isInvalidStage($nextStage) && $this->
isInvalidStage($previousStage));
142 $this->pageRenderer->addJsFile($resourcePath .
'Typo3Lang.js');
143 $this->pageRenderer->addJsInlineCode(
'workspaces.preview.lll',
' 148 livePreviewDetail: ' . Utility\
GeneralUtility::quoteJSvalue(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.livePreviewDetail', TRUE)) .
', 149 workspacePreview: ' . Utility\
GeneralUtility::quoteJSvalue(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.workspacePreview', TRUE)) .
', 150 workspacePreviewDetail: ' . Utility\
GeneralUtility::quoteJSvalue(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.workspacePreviewDetail', TRUE)) .
', 157 };TYPO3.l10n.initialize(); 160 $this->pageRenderer->addJsFile($resourcePath .
'JavaScript/preview.js');
171 return !(is_array($stageArray) && count($stageArray) > 0);
177 public function newPageAction() {
178 $flashMessage =
GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
$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);
182 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
183 $defaultFlashMessageQueue->enqueue($flashMessage);
196 $newPageModule = trim(
$GLOBALS[
'BE_USER']->getTSConfigVal(
'options.overridePageModule'));
198 if (!
$GLOBALS[
'BE_USER']->check(
'modules', $pageModule)) {
202 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'loginSecurityLevel']) {
203 $loginSecurityLevel =
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'loginSecurityLevel'];
205 $loginSecurityLevel =
'superchallenged';
207 $t3Configuration = array(
209 'PATH_typo3' => $pathTYPO3,
210 'PATH_typo3_enc' => rawurlencode($pathTYPO3),
211 'username' => htmlspecialchars(
$GLOBALS[
'BE_USER']->user[
'username']),
213 'securityLevel' => $loginSecurityLevel,
214 'TYPO3_mainDir' => TYPO3_mainDir,
215 'pageModule' => $pageModule,
216 'inWorkspace' =>
$GLOBALS[
'BE_USER']->workspace !== 0 ? 1 : 0,
217 'workspaceFrontendPreviewEnabled' =>
$GLOBALS[
'BE_USER']->user[
'workspace_preview'] ? 1 : 0,
218 'veriCode' =>
$GLOBALS[
'BE_USER']->veriCode(),
219 'denyFileTypes' => PHP_EXTENSIONS_DEFAULT,
220 'moduleMenuWidth' => $this->menuWidth - 1,
221 'topBarHeight' => isset(
$GLOBALS[
'TBE_STYLES'][
'dims'][
'topFrameH']) ? (
int)
$GLOBALS[
'TBE_STYLES'][
'dims'][
'topFrameH'] : 30,
222 'showRefreshLoginPopup' => isset($GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'showRefreshLoginPopup']) ? (
int)$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'showRefreshLoginPopup'] : FALSE,
224 'debugInWindow' => $GLOBALS[
'BE_USER']->uc[
'debugInWindow'] ? 1 : 0,
225 'ContextHelpWindows' => array(
231 'waitTitle' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_logging_in'),
232 'refresh_login_failed' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_failed'),
233 'refresh_login_failed_message' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_failed_message'),
234 'refresh_login_title' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_title'),
235 'login_expired' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.login_expired'),
236 'refresh_login_username' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_username'),
237 'refresh_login_password' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_password'),
238 'refresh_login_emptyPassword' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_emptyPassword'),
239 'refresh_login_button' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_button'),
240 'refresh_logout_button' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_logout_button'),
241 'please_wait' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.please_wait'),
242 'loadingIndicator' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:loadingIndicator'),
243 'be_locked' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.be_locked'),
244 'refresh_login_countdown_singular' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_countdown_singular'),
245 'refresh_login_countdown' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_countdown'),
246 'login_about_to_expire' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.login_about_to_expire'),
247 'login_about_to_expire_title' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.login_about_to_expire_title'),
248 'refresh_login_refresh_button' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_refresh_button'),
249 'refresh_direct_logout_button' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.refresh_direct_logout_button'),
250 'tabs_closeAll' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:tabs.closeAll'),
251 'tabs_closeOther' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:tabs.closeOther'),
252 'tabs_close' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:tabs.close'),
253 'tabs_openInBrowserWindow' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:tabs.openInBrowserWindow'),
254 'donateWindow_title' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:donateWindow.title'),
255 'donateWindow_message' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:donateWindow.message'),
256 'donateWindow_button_donate' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:donateWindow.button_donate'),
257 'donateWindow_button_disable' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:donateWindow.button_disable'),
258 'donateWindow_button_postpone' => $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:donateWindow.button_postpone')
261 TYPO3.configuration = ' . json_encode($t3Configuration) .
'; 263 core : ' . json_encode($t3LLLcore) .
' 269 function typoSetup() { // 270 this.PATH_typo3 = TYPO3.configuration.PATH_typo3; 271 this.PATH_typo3_enc = TYPO3.configuration.PATH_typo3_enc; 272 this.username = TYPO3.configuration.username; 273 this.uniqueID = TYPO3.configuration.uniqueID; 274 this.navFrameWidth = 0; 275 this.securityLevel = TYPO3.configuration.securityLevel; 276 this.veriCode = TYPO3.configuration.veriCode; 277 this.denyFileTypes = TYPO3.configuration.denyFileTypes; 279 var TS = new typoSetup(); 280 //backwards compatibility
static getModTSconfig($id, $TSref)
static quoteJSvalue($value)
static getIndpEnv($getEnvName)
isInvalidStage($stageArray)
static makeInstance($className)
static shortMD5($input, $len=10)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
static setUpdateSignal($set='', $params='')
static isModuleSetInTBE_MODULES($modName)
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]