[FEATURE] Option to disable Mass Actions
authorBart Dubelaar <bartdubelaar@gmail.com>
Mon, 12 Dec 2011 14:57:23 +0000 (15:57 +0100)
committerTolleiv Nietsch <info@tolleiv.de>
Sun, 12 Feb 2012 18:31:15 +0000 (19:31 +0100)
Adds an option to the user TSConfig to disable the Mass Actions menu.

Change-Id: I2530120564699912506ad8878f7f9653edb77e7c
Resolves: #32476
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7232
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
typo3/sysext/workspaces/Classes/ExtDirect/MassActionHandler.php

index 5d2665f..5940378 100644 (file)
@@ -52,9 +52,9 @@ class Tx_Workspaces_ExtDirect_MassActionHandler extends Tx_Workspaces_ExtDirect_
        public function getMassStageActions($parameter) {
                $actions = array();
                $currentWorkspace = $this->getCurrentWorkspace();
-
+               $massActionsEnabled = $GLOBALS['BE_USER']->getTSConfigVal('options.workspaces.enableMassActions') !== '0';
                        // in case we're working within "All Workspaces" we can't provide Mass Actions
-               if ($currentWorkspace != Tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES) {
+               if (($currentWorkspace != Tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES) && $massActionsEnabled) {
                        $publishAccess = $GLOBALS['BE_USER']->workspacePublishAccess($currentWorkspace);
                        if ($publishAccess && !($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1)) {
                                $actions[] = array('action' => 'publish', 'title' => $GLOBALS['LANG']->sL($this->pathToLocallang . ':label_doaction_publish')