Index: Classes/Controller/ReviewController.php =================================================================== --- Classes/Controller/ReviewController.php (revision 3359) +++ Classes/Controller/ReviewController.php (working copy) @@ -42,6 +42,7 @@ $wsList = $wsService->getAvailableWorkspaces(); $activeWorkspace = $GLOBALS['BE_USER']->workspace; + $performWorkspaceSwitch = FALSE; if (!$GLOBALS['BE_USER']->isAdmin()) { $wsCur = array($activeWorkspace => true); @@ -50,15 +51,20 @@ $wsList = $wsService->getAvailableWorkspaces(); if (strlen(t3lib_div::_GP('workspace'))) { $switchWs = (int) t3lib_div::_GP('workspace'); - if (in_array($switchWs, array_keys($wsList))) { + if (in_array($switchWs, array_keys($wsList)) && $activeWorkspace != $switchWs) { $activeWorkspace = $switchWs; + $GLOBALS['BE_USER']->setWorkspace($activeWorkspace); + $performWorkspaceSwitch = TRUE; + t3lib_BEfunc::setUpdateSignal('updatePageTree'); } elseif ($switchWs == tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES) { - $activeWorkspace = tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES; + $this->redirect('fullIndex'); } } } + $this->view->assign('performWorkspaceSwitch', $performWorkspaceSwitch); $this->view->assign('workspaceList', $wsList); $this->view->assign('activeWorkspaceUid', $activeWorkspace); + $this->view->assign('activeWorkspaceTitle', tx_Workspaces_Service_Workspaces::getWorkspaceTitle($activeWorkspace)); $GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', $activeWorkspace); } Index: Resources/Private/Templates/Review/Index.html =================================================================== --- Resources/Private/Templates/Review/Index.html (revision 3359) +++ Resources/Private/Templates/Review/Index.html (working copy) @@ -1,6 +1,14 @@ + + + + +
Index: Resources/Public/JavaScript/workspacemenu.js =================================================================== --- Resources/Public/JavaScript/workspacemenu.js (revision 3359) +++ Resources/Public/JavaScript/workspacemenu.js (working copy) @@ -150,35 +150,9 @@ if (!response.id) { response.id = 0; } - if(response.title) { - top.TYPO3.Workspaces.workspaceTitle = response.title; - } - top.TYPO3.configuration.inWorkspace = response.id === 0 ? 0 : 1; - if (top.TYPO3.configuration.inWorkspace == 1) { - Ext.getBody().addClass('typo3-in-workspace'); - if (Ext.get('typo3-topbar-workspaces-title')) { - Ext.get('typo3-topbar-workspaces-title').remove(); - } - Ext.select('#username a').insertHtml('beforeEnd', '@' + top.TYPO3.Workspaces.workspaceTitle + ''); - } else { - Ext.getBody().removeClass('typo3-in-workspace'); - Ext.select('#typo3-topbar-workspaces-title').remove(); - } - TYPO3BackendWorkspaceMenu.positionMenu(); + this.performWorkspaceSwitch(response.id, response.title); - // first remove all checks, then set the check in front of the selected workspace - var stateActiveClass = 't3-icon t3-icon-status t3-icon-status-status t3-icon-status-checked'; - var stateInactiveClass = 't3-icon t3-icon-empty t3-icon-empty-empty t3-icon-empty'; - - // remove "selected" class and checkmark - $$('#workspace-selector-menu li.selected span.t3-icon-status-checked')[0].removeClassName(stateActiveClass).addClassName(stateInactiveClass); - $$('#workspace-selector-menu li.selected')[0].removeClassName('selected'); - - // add "selected" class and checkmark - clickedElement.previous().removeClassName(stateInactiveClass).addClassName(stateActiveClass); - clickedElement.up().addClassName('selected'); - // when in web module reload, otherwise send the user to the web module if (currentModuleLoaded.startsWith('web_')) { top.TYPO3.ModuleMenu.App.reloadFrames(); @@ -192,7 +166,36 @@ TYPO3ModuleMenu.refreshMenu(); }); - this.toggleMenu(event); + TYPO3BackendWorkspaceMenu.toggleMenu(event); + }, + + performWorkspaceSwitch: function(id, title) { + top.TYPO3.Workspaces.workspaceTitle = title; + top.TYPO3.configuration.inWorkspace = id === 0 ? 0 : 1; + if (top.TYPO3.configuration.inWorkspace == 1) { + Ext.getBody().addClass('typo3-in-workspace'); + if (Ext.get('typo3-topbar-workspaces-title')) { + Ext.get('typo3-topbar-workspaces-title').remove(); + } + Ext.select('#username a').insertHtml('beforeEnd', '@' + top.TYPO3.Workspaces.workspaceTitle + ''); + } else { + Ext.getBody().removeClass('typo3-in-workspace'); + Ext.select('#typo3-topbar-workspaces-title').remove(); + } + + TYPO3BackendWorkspaceMenu.positionMenu(); + + // first remove all checks, then set the check in front of the selected workspace + var stateActiveClass = 't3-icon t3-icon-status t3-icon-status-status t3-icon-status-checked'; + var stateInactiveClass = 't3-icon t3-icon-empty t3-icon-empty-empty t3-icon-empty'; + + // remove "selected" class and checkmark + $$('#workspace-selector-menu li.selected span.t3-icon-status-checked')[0].removeClassName(stateActiveClass).addClassName(stateInactiveClass); + $$('#workspace-selector-menu li.selected')[0].removeClassName('selected'); + + // add "selected" class and checkmark + $$('#ws-' + id)[0].previous().removeClassName(stateInactiveClass).addClassName(stateActiveClass); + $$('#ws-' + id)[0].up().addClassName('selected'); } });