Bug #11141 ยป 11141.patch
Classes/Controller/ReviewController.php (working copy) | ||
---|---|---|
$wsList = $wsService->getAvailableWorkspaces();
|
||
$activeWorkspace = $GLOBALS['BE_USER']->workspace;
|
||
$performWorkspaceSwitch = FALSE;
|
||
if (!$GLOBALS['BE_USER']->isAdmin()) {
|
||
$wsCur = array($activeWorkspace => true);
|
||
... | ... | |
$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);
|
||
}
|
||
Resources/Private/Templates/Review/Index.html (working copy) | ||
---|---|---|
<f:layout name="module" />
|
||
<f:section name="main">
|
||
<f:if condition="{performWorkspaceSwitch}">
|
||
<script type="text/javascript">
|
||
top.TYPO3.ModuleMenu.Store.load();
|
||
top.TYPO3BackendWorkspaceMenu.performWorkspaceSwitch({activeWorkspaceUid}, "{activeWorkspaceTitle}");
|
||
</script>
|
||
</f:if>
|
||
<f:if condition="{showGrid}">
|
||
<f:then><div id="workspacegrid"></div>
|
||
</f:then>
|
Resources/Public/JavaScript/workspacemenu.js (working copy) | ||
---|---|---|
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', '<span id="typo3-topbar-workspaces-title">@' + top.TYPO3.Workspaces.workspaceTitle + '</span>');
|
||
} 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();
|
||
... | ... | |
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', '<span id="typo3-topbar-workspaces-title">@' + top.TYPO3.Workspaces.workspaceTitle + '</span>');
|
||
} 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');
|
||
}
|
||
});
|