[BUGFIX] Add documentation in review controller
authorTolleiv Nietsch <info@tolleiv.de>
Wed, 6 Jul 2011 17:52:56 +0000 (19:52 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Fri, 8 Jul 2011 09:56:53 +0000 (11:56 +0200)
The decisions made for the controller aren't clear
from just looking at the code. The added comment and the
small cleanup hopefully make it clear now.

Change-Id: Ic22516bf1198d1f1c162056227a25d818aed18c2
Resolves: #26900
Releases: 4.6

typo3/sysext/workspaces/Classes/Controller/ReviewController.php

index 380d4f7..45e5768 100644 (file)
@@ -44,11 +44,15 @@ class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller
                $activeWorkspace = $GLOBALS['BE_USER']->workspace;
                $performWorkspaceSwitch = FALSE;
 
+                       /**
+                        * Only admins see multiple tabs, we decided to use it this
+                        * way for usability reasons. Regular users might be confused
+                        * by switching workspaces with the tabs in a module.
+                        */
                if (!$GLOBALS['BE_USER']->isAdmin()) {
                        $wsCur = array($activeWorkspace => TRUE);
                        $wsList = array_intersect_key($wsList, $wsCur);
                } else {
-                       $wsList = $wsService->getAvailableWorkspaces();
                        if (strlen(t3lib_div::_GP('workspace'))) {
                                $switchWs = (int) t3lib_div::_GP('workspace');
                                if (in_array($switchWs, array_keys($wsList)) && $activeWorkspace != $switchWs) {