[TASK] Cleanup EXT:workspaces 09/31009/4
authorWouter Wolters <typo3@wouterwolters.nl>
Sat, 21 Jun 2014 17:14:43 +0000 (19:14 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 22 Jun 2014 19:53:07 +0000 (21:53 +0200)
* Update phpDoc where needed
* Import use statements where possible
* Make use of use statements if they are there already

Resolves: #59789
Releases: 6.3
Change-Id: I2c7baa6ac9b3a085b3fed83da559fddfdbf4c950
Reviewed-on: https://review.typo3.org/31009
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
19 files changed:
typo3/sysext/workspaces/Classes/ColumnDataProviderInterface.php
typo3/sysext/workspaces/Classes/Controller/PreviewController.php
typo3/sysext/workspaces/Classes/Controller/ReviewController.php
typo3/sysext/workspaces/Classes/Domain/Model/CombinedRecord.php
typo3/sysext/workspaces/Classes/ExtDirect/ActionHandler.php
typo3/sysext/workspaces/Classes/ExtDirect/ExtDirectServer.php
typo3/sysext/workspaces/Classes/ExtDirect/MassActionHandler.php
typo3/sysext/workspaces/Classes/ExtDirect/PagetreeCollectionsProcessor.php
typo3/sysext/workspaces/Classes/ExtDirect/ToolbarMenu.php
typo3/sysext/workspaces/Classes/Hook/BackendUtilityHook.php
typo3/sysext/workspaces/Classes/Hook/TypoScriptFrontendControllerHook.php
typo3/sysext/workspaces/Classes/Service/AdditionalColumnService.php
typo3/sysext/workspaces/Classes/Service/AdditionalResourceService.php
typo3/sysext/workspaces/Classes/Service/AutoPublishService.php
typo3/sysext/workspaces/Classes/Service/GridDataService.php
typo3/sysext/workspaces/Classes/Service/StagesService.php
typo3/sysext/workspaces/Classes/Service/WorkspaceService.php
typo3/sysext/workspaces/Classes/Task/AutoPublishTask.php
typo3/sysext/workspaces/Classes/Task/CleanupPreviewLinkTask.php

index 2a9fb2d..8bb4016 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Workspaces;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * Interface for (additional) columns.
  *
@@ -32,4 +33,3 @@ interface ColumnDataProviderInterface {
        public function getData(\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord $combinedRecord);
 
 }
-?>
\ No newline at end of file
index 6d0d4e4..05c7bbb 100644 (file)
@@ -15,7 +15,7 @@ namespace TYPO3\CMS\Workspaces\Controller;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Core\Utility;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -23,7 +23,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  *
  * @author Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
  */
-class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractController {
+class PreviewController extends AbstractController {
 
        /**
         * @var \TYPO3\CMS\Workspaces\Service\StagesService
@@ -45,7 +45,7 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
                $this->stageService = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
                $this->workspaceService = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
                $this->template->setExtDirectStateProvider();
-               $resourcePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/StyleSheet/preview.css';
+               $resourcePath = ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/StyleSheet/preview.css';
                $GLOBALS['TBE_STYLES']['extJS']['theme'] = $resourcePath;
                $this->pageRenderer->loadExtJS();
                $this->pageRenderer->enableExtJSQuickTips();
@@ -59,7 +59,7 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
                $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/notifications.js');
                $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/flashmessages.js');
                $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/iframepanel.js');
-               $resourcePathJavaScript = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/JavaScript/';
+               $resourcePathJavaScript = ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/JavaScript/';
                $jsFiles = array(
                        'Ext.ux.plugins.TabStripContainer.js',
                        'Store/mainstore.js',
@@ -138,25 +138,25 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
                $this->pageRenderer->addInlineSetting('Workspaces', 'disableNextStageButton', $this->isInvalidStage($nextStage));
                $this->pageRenderer->addInlineSetting('Workspaces', 'disablePreviousStageButton', $this->isInvalidStage($previousStage));
                $this->pageRenderer->addInlineSetting('Workspaces', 'disableDiscardStageButton', $this->isInvalidStage($nextStage) && $this->isInvalidStage($previousStage));
-               $resourcePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('lang') . 'Resources/Public/JavaScript/';
+               $resourcePath = ExtensionManagementUtility::extRelPath('lang') . 'Resources/Public/JavaScript/';
                $this->pageRenderer->addJsFile($resourcePath . 'Typo3Lang.js');
                $this->pageRenderer->addJsInlineCode('workspaces.preview.lll', '
                TYPO3.lang = {
-                       visualPreview: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.visualPreview', TRUE)) . ',
-                       listView: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.listView', TRUE)) . ',
-                       livePreview: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.livePreview', TRUE)) . ',
-                       livePreviewDetail: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.livePreviewDetail', TRUE)) . ',
-                       workspacePreview: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.workspacePreview', TRUE)) . ',
-                       workspacePreviewDetail: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.workspacePreviewDetail', TRUE)) . ',
-                       modeSlider: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.modeSlider', TRUE)) . ',
-                       modeVbox: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.modeVbox', TRUE)) . ',
-                       modeHbox: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.modeHbox', TRUE)) . ',
-                       discard: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:label_doaction_discard', TRUE)) . ',
-                       nextStage: ' . Utility\GeneralUtility::quoteJSvalue($nextStage['title']) . ',
-                       previousStage: ' . Utility\GeneralUtility::quoteJSvalue($previousStage['title']) . '
+                       visualPreview: ' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.visualPreview', TRUE)) . ',
+                       listView: ' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.listView', TRUE)) . ',
+                       livePreview: ' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.livePreview', TRUE)) . ',
+                       livePreviewDetail: ' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.livePreviewDetail', TRUE)) . ',
+                       workspacePreview: ' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.workspacePreview', TRUE)) . ',
+                       workspacePreviewDetail: ' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.workspacePreviewDetail', TRUE)) . ',
+                       modeSlider: ' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.modeSlider', TRUE)) . ',
+                       modeVbox: ' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.modeVbox', TRUE)) . ',
+                       modeHbox: ' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:preview.modeHbox', TRUE)) . ',
+                       discard: ' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:label_doaction_discard', TRUE)) . ',
+                       nextStage: ' . GeneralUtility::quoteJSvalue($nextStage['title']) . ',
+                       previousStage: ' . GeneralUtility::quoteJSvalue($previousStage['title']) . '
                };TYPO3.l10n.initialize();
 ');
-               $resourcePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/';
+               $resourcePath = ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/';
                $this->pageRenderer->addJsFile($resourcePath . 'JavaScript/preview.js');
        }
 
@@ -165,7 +165,6 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
         *
         * @param array $stageArray
         * @return boolean
-        * @author Michael Klapper <development@morphodo.com>
         */
        protected function isInvalidStage($stageArray) {
                return !(is_array($stageArray) && count($stageArray) > 0);
@@ -188,7 +187,7 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
         * and since we're loading a backend module outside of the actual backend
         * this copies parts of the backend.php
         *
-        * @return      string
+        * @return string
         */
        protected function generateJavascript() {
                $pathTYPO3 = GeneralUtility::dirname(GeneralUtility::getIndpEnv('SCRIPT_NAME')) . '/';
@@ -220,7 +219,7 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
                        'moduleMenuWidth' => $this->menuWidth - 1,
                        'topBarHeight' => isset($GLOBALS['TBE_STYLES']['dims']['topFrameH']) ? (int)$GLOBALS['TBE_STYLES']['dims']['topFrameH'] : 30,
                        'showRefreshLoginPopup' => isset($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) ? (int)$GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup'] : FALSE,
-                       'listModulePath' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('recordlist') . 'mod1/',
+                       'listModulePath' => ExtensionManagementUtility::extRelPath('recordlist') . 'mod1/',
                        'debugInWindow' => $GLOBALS['BE_USER']->uc['debugInWindow'] ? 1 : 0,
                        'ContextHelpWindows' => array(
                                'width' => 600,
@@ -257,7 +256,7 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
                        'donateWindow_button_disable' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:donateWindow.button_disable'),
                        'donateWindow_button_postpone' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:donateWindow.button_postpone')
                );
-               $js = '
+               return '
                TYPO3.configuration = ' . json_encode($t3Configuration) . ';
                TYPO3.LLL = {
                        core : ' . json_encode($t3LLLcore) . '
@@ -279,7 +278,6 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
                var TS = new typoSetup();
                        //backwards compatibility
                ';
-               return $js;
        }
 
 }
index 401e459..9721b96 100644 (file)
@@ -15,13 +15,15 @@ namespace TYPO3\CMS\Workspaces\Controller;
  */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Workspaces\Service\WorkspaceService;
 
 /**
  * Review controller.
  *
  * @author Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
  */
-class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractController {
+class ReviewController extends AbstractController {
 
        /**
         * Renders the review module user dependent with all workspaces.
@@ -51,8 +53,8 @@ class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControll
                                        $activeWorkspace = $switchWs;
                                        $GLOBALS['BE_USER']->setWorkspace($activeWorkspace);
                                        $performWorkspaceSwitch = TRUE;
-                                       \TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updatePageTree');
-                               } elseif ($switchWs == \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES) {
+                                       BackendUtility::setUpdateSignal('updatePageTree');
+                               } elseif ($switchWs == WorkspaceService::SELECT_ALL_WORKSPACES) {
                                        $this->redirect('fullIndex');
                                }
                        }
@@ -64,7 +66,7 @@ class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControll
                $this->view->assign('performWorkspaceSwitch', $performWorkspaceSwitch);
                $this->view->assign('workspaceList', $wsList);
                $this->view->assign('activeWorkspaceUid', $activeWorkspace);
-               $this->view->assign('activeWorkspaceTitle', \TYPO3\CMS\Workspaces\Service\WorkspaceService::getWorkspaceTitle($activeWorkspace));
+               $this->view->assign('activeWorkspaceTitle', WorkspaceService::getWorkspaceTitle($activeWorkspace));
                $this->view->assign('showPreviewLink', $wsService->canCreatePreviewLink(GeneralUtility::_GP('id'), $activeWorkspace));
                $GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', $activeWorkspace);
        }
@@ -76,7 +78,7 @@ class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControll
         * @return void
         */
        public function fullIndexAction() {
-               $wsService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
+               $wsService = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
                $wsList = $wsService->getAvailableWorkspaces();
 
                if (!$GLOBALS['BE_USER']->isAdmin()) {
@@ -85,17 +87,17 @@ class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControll
                        $wsList = array_intersect_key($wsList, $wsCur);
                }
 
-               $this->pageRenderer->addInlineSetting('Workspaces', 'workspaceTabs', $this->prepareWorkspaceTabs($wsList, \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES));
-               $this->pageRenderer->addInlineSetting('Workspaces', 'activeWorkspaceId', \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES);
+               $this->pageRenderer->addInlineSetting('Workspaces', 'workspaceTabs', $this->prepareWorkspaceTabs($wsList, WorkspaceService::SELECT_ALL_WORKSPACES));
+               $this->pageRenderer->addInlineSetting('Workspaces', 'activeWorkspaceId', WorkspaceService::SELECT_ALL_WORKSPACES);
                $this->pageRenderer->addInlineSetting('Workspaces', 'PATH_typo3', GeneralUtility::getIndpEnv('TYPO3_SITE_PATH') . TYPO3_mainDir);
                $this->view->assign('pageUid', GeneralUtility::_GP('id'));
                $this->view->assign('showGrid', TRUE);
                $this->view->assign('showLegend', TRUE);
                $this->view->assign('showAllWorkspaceTab', TRUE);
                $this->view->assign('workspaceList', $wsList);
-               $this->view->assign('activeWorkspaceUid', \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES);
+               $this->view->assign('activeWorkspaceUid', WorkspaceService::SELECT_ALL_WORKSPACES);
                $this->view->assign('showPreviewLink', FALSE);
-               $GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES);
+               $GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', WorkspaceService::SELECT_ALL_WORKSPACES);
                // set flag for javascript
                $this->pageRenderer->addInlineSetting('Workspaces', 'allView', '1');
        }
@@ -128,7 +130,7 @@ class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControll
        protected function initializeAction() {
                parent::initializeAction();
                $this->template->setExtDirectStateProvider();
-               if (\TYPO3\CMS\Workspaces\Service\WorkspaceService::isOldStyleWorkspaceUsed()) {
+               if (WorkspaceService::isOldStyleWorkspaceUsed()) {
                        $flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:warning.oldStyleWorkspaceInUser'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
                        /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
                        $flashMessageService = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
@@ -155,9 +157,9 @@ class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControll
                $this->pageRenderer->addCssFile($resourcePath . 'gridfilters/css/RangeMenu.css');
 
                $filters = array(
-                       $resourcePath. 'gridfilters/menu/RangeMenu.js',
-                       $resourcePath. 'gridfilters/menu/ListMenu.js',
-                       $resourcePath .'gridfilters/GridFilters.js',
+                       $resourcePath . 'gridfilters/menu/RangeMenu.js',
+                       $resourcePath . 'gridfilters/menu/ListMenu.js',
+                       $resourcePath . 'gridfilters/GridFilters.js',
                        $resourcePath . 'gridfilters/filter/Filter.js',
                        $resourcePath . 'gridfilters/filter/StringFilter.js',
                        $resourcePath . 'gridfilters/filter/DateFilter.js',
@@ -188,7 +190,7 @@ class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControll
                foreach ($javaScriptFiles as $javaScriptFile) {
                        $this->pageRenderer->addJsFile($javaScriptFile);
                }
-               $this->pageRenderer->addInlineSetting('RecordHistory', 'moduleUrl', \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('record_history'));
+               $this->pageRenderer->addInlineSetting('RecordHistory', 'moduleUrl', BackendUtility::getModuleUrl('record_history'));
        }
 
        /**
@@ -201,7 +203,7 @@ class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControll
        protected function prepareWorkspaceTabs(array $workspaceList, $activeWorkspace) {
                $tabs = array();
 
-               if ($activeWorkspace !== \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES) {
+               if ($activeWorkspace !== WorkspaceService::SELECT_ALL_WORKSPACES) {
                        $tabs[] = array(
                                'title' => $workspaceList[$activeWorkspace],
                                'itemId' => 'workspace-' . $activeWorkspace,
@@ -212,9 +214,9 @@ class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControll
 
                $tabs[] = array(
                        'title' => 'All workspaces',
-                       'itemId' => 'workspace-' . \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES,
-                       'workspaceId' => \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES,
-                       'triggerUrl' => $this->getModuleUri(\TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES),
+                       'itemId' => 'workspace-' . WorkspaceService::SELECT_ALL_WORKSPACES,
+                       'workspaceId' => WorkspaceService::SELECT_ALL_WORKSPACES,
+                       'triggerUrl' => $this->getModuleUri(WorkspaceService::SELECT_ALL_WORKSPACES),
                );
 
                foreach ($workspaceList as $workspaceId => $workspaceTitle) {
@@ -245,11 +247,11 @@ class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControll
                );
                // The "all workspaces" tab is handled in fullIndexAction
                // which is required as additional GET parameter in the URI then
-               if ($workspaceId === \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES) {
+               if ($workspaceId === WorkspaceService::SELECT_ALL_WORKSPACES) {
                        $this->uriBuilder->reset()->uriFor('fullIndex');
                        $parameters = array_merge($parameters, $this->uriBuilder->getArguments());
                }
-               return \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_WorkspacesWorkspaces', $parameters);
+               return BackendUtility::getModuleUrl('web_WorkspacesWorkspaces', $parameters);
        }
 
 }
index 0491a41..e8b99e0 100644 (file)
@@ -44,8 +44,8 @@ class CombinedRecord {
         * @return \TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord
         */
        static public function create($table, $liveId, $versionId) {
-               $liveRecord = \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord::create($table, $liveId);
-               $versionRecord = \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord::create($table, $versionId);
+               $liveRecord = DatabaseRecord::create($table, $liveId);
+               $versionRecord = DatabaseRecord::create($table, $versionId);
                return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Domain\\Model\\CombinedRecord', $table, $liveRecord, $versionRecord);
        }
 
@@ -58,8 +58,8 @@ class CombinedRecord {
         * @return \TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord
         */
        static public function createFromArrays($table, array $liveRow, array $versionRow) {
-               $liveRecord = \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord::createFromArray($table, $liveRow);
-               $versionRecord = \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord::createFromArray($table, $versionRow);
+               $liveRecord = DatabaseRecord::createFromArray($table, $liveRow);
+               $versionRecord = DatabaseRecord::createFromArray($table, $versionRow);
                return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Domain\\Model\\CombinedRecord', $table, $liveRecord, $versionRecord);
        }
 
@@ -70,7 +70,7 @@ class CombinedRecord {
         * @param \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $liveRecord
         * @param \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $versionRecord
         */
-       public function __construct($table, \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $liveRecord, \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $versionRecord) {
+       public function __construct($table, DatabaseRecord $liveRecord, DatabaseRecord $versionRecord) {
                $this->setTable($table);
                $this->setLiveRecord($liveRecord);
                $this->setVersionRecord($versionRecord);
@@ -110,7 +110,7 @@ class CombinedRecord {
         * @param \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $liveRecord
         * @return void
         */
-       public function setLiveRecord(\TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $liveRecord) {
+       public function setLiveRecord(DatabaseRecord $liveRecord) {
                $this->liveRecord = $liveRecord;
        }
 
@@ -129,7 +129,7 @@ class CombinedRecord {
         * @param \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $versionRecord
         * @return void
         */
-       public function setVersionRecord(\TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $versionRecord) {
+       public function setVersionRecord(DatabaseRecord $versionRecord) {
                $this->versionRecord = $versionRecord;
        }
 
index a52365e..e34aff4 100644 (file)
@@ -16,16 +16,17 @@ namespace TYPO3\CMS\Workspaces\ExtDirect;
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Workspaces\Service\StagesService;
 
 /**
  * ExtDirect action handler
  *
  * @author Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
  */
-class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
+class ActionHandler extends AbstractHandler {
 
        /**
-        * @var \TYPO3\CMS\Workspaces\Service\StagesService
+        * @var StagesService
         */
        protected $stageService;
 
@@ -188,7 +189,7 @@ class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                if (is_array($elementRecord)) {
                        $stageId = $elementRecord['t3ver_stage'];
                        if ($this->getStageService()->isValid($stageId)) {
-                               if ($stageId !== \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_EDIT_ID) {
+                               if ($stageId !== StagesService::STAGE_EDIT_ID) {
                                        $prevStage = $this->getStageService()->getPrevStage($stageId);
                                        $result = $this->getSentToStageWindow($prevStage['uid']);
                                        $result['affects'] = array(
@@ -253,7 +254,7 @@ class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                }
                // the notification mode can be configured in the workspace stage record
                $notification_mode = (int)$this->getStageService()->getNotificationMode($stageId);
-               if ($notification_mode === \TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_ALL || $notification_mode === \TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_ALL_STRICT) {
+               if ($notification_mode === StagesService::MODE_NOTIFY_ALL || $notification_mode === StagesService::MODE_NOTIFY_ALL_STRICT) {
                        // get the default recipients from the stage configuration
                        // the default recipients needs to be added in some cases of the notification_mode
                        $default_recipients = $this->getStageService()->getResponsibleBeUser($stageId, TRUE);
@@ -300,7 +301,7 @@ class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                $cmdMapArray = array();
                /** @var $workspaceService \TYPO3\CMS\Workspaces\Service\WorkspaceService */
                $workspaceService = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
-               /** @var $stageService \TYPO3\CMS\Workspaces\Service\StagesService */
+               /** @var $stageService StagesService */
                $stageService = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
                $workspaceItemsArray = $workspaceService->selectVersionsInWorkspace($stageService->getWorkspaceId(), ($filter = 1), ($stage = -99), $pageId, ($recursionLevel = 0), ($selectionType = 'tables_modify'));
                foreach ($workspaceItemsArray as $tableName => $items) {
@@ -343,7 +344,7 @@ class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                foreach ($parameters->affects as $tableName => $items) {
                        foreach ($items as $item) {
                                // Publishing uses live id in command map
-                               if ($stageId == \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_EXECUTE_ID) {
+                               if ($stageId == StagesService::STAGE_PUBLISH_EXECUTE_ID) {
                                        $cmdMapArray[$tableName][$item->t3ver_oid]['version']['action'] = 'swap';
                                        $cmdMapArray[$tableName][$item->t3ver_oid]['version']['swapWith'] = $item->uid;
                                        $cmdMapArray[$tableName][$item->t3ver_oid]['version']['comment'] = $comment;
@@ -405,7 +406,7 @@ class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                $currentWorkspace = $this->setTemporaryWorkspace($elementRecord['t3ver_wsid']);
 
                $recipients = $this->getRecipientList($parameters->receipients, $parameters->additional, $setStageId);
-               if ($setStageId == \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_EXECUTE_ID) {
+               if ($setStageId == StagesService::STAGE_PUBLISH_EXECUTE_ID) {
                        $cmdArray[$table][$t3ver_oid]['version']['action'] = 'swap';
                        $cmdArray[$table][$t3ver_oid]['version']['swapWith'] = $uid;
                        $cmdArray[$table][$t3ver_oid]['version']['comment'] = $comments;
@@ -491,7 +492,7 @@ class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                $elements = $parameters->affects->elements;
                $recipients = $this->getRecipientList($parameters->receipients, $parameters->additional, $setStageId);
                foreach ($elements as $key => $element) {
-                       if ($setStageId == \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_EXECUTE_ID) {
+                       if ($setStageId == StagesService::STAGE_PUBLISH_EXECUTE_ID) {
                                $cmdArray[$element->table][$element->t3ver_oid]['version']['action'] = 'swap';
                                $cmdArray[$element->table][$element->t3ver_oid]['version']['swapWith'] = $element->uid;
                                $cmdArray[$element->table][$element->t3ver_oid]['version']['comment'] = $comments;
@@ -531,14 +532,14 @@ class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                        )
                );
                switch ($nextStageId) {
-                       case \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_EXECUTE_ID:
+                       case StagesService::STAGE_PUBLISH_EXECUTE_ID:
 
-                       case \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_ID:
+                       case StagesService::STAGE_PUBLISH_ID:
                                if (!empty($workspaceRec['publish_allow_notificaton_settings'])) {
                                        $showNotificationFields = TRUE;
                                }
                                break;
-                       case \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_EDIT_ID:
+                       case StagesService::STAGE_EDIT_ID:
                                if (!empty($workspaceRec['edit_allow_notificaton_settings'])) {
                                        $showNotificationFields = TRUE;
                                }
@@ -595,10 +596,10 @@ class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                                $name = $user['realName'] ? $user['realName'] : $user['username'];
                                // the notification mode can be configured in the workspace stage record
                                $notification_mode = (int)$this->getStageService()->getNotificationMode($stage);
-                               if ($notification_mode === \TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_SOMEONE) {
+                               if ($notification_mode === StagesService::MODE_NOTIFY_SOMEONE) {
                                        // all responsible users are checked per default, as in versions before
                                        $checked = TRUE;
-                               } elseif ($notification_mode === \TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_ALL) {
+                               } elseif ($notification_mode === StagesService::MODE_NOTIFY_ALL) {
                                        // the default users are checked only
                                        if (!empty($default_recipients[$id])) {
                                                $checked = TRUE;
@@ -606,7 +607,7 @@ class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                                        } else {
                                                $checked = FALSE;
                                        }
-                               } elseif ($notification_mode === \TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_ALL_STRICT) {
+                               } elseif ($notification_mode === StagesService::MODE_NOTIFY_ALL_STRICT) {
                                        // all responsible users are checked
                                        $checked = TRUE;
                                        $disabled = TRUE;
@@ -636,7 +637,7 @@ class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
        /**
         * Gets an instance of the Stage service.
         *
-        * @return \TYPO3\CMS\Workspaces\Service\StagesService
+        * @return StagesService
         */
        protected function getStageService() {
                if (!isset($this->stageService)) {
index 1cd5024..a0fc6b4 100644 (file)
@@ -15,13 +15,14 @@ namespace TYPO3\CMS\Workspaces\ExtDirect;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * ExtDirect server
  *
  * @author Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
  */
-class ExtDirectServer extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
+class ExtDirectServer extends AbstractHandler {
 
        /**
         * @var \TYPO3\CMS\Workspaces\Service\GridDataService
@@ -73,7 +74,7 @@ class ExtDirectServer extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
         */
        public function getHistory($parameters) {
                /** @var $historyService \TYPO3\CMS\Workspaces\Service\HistoryService */
-               $historyService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\HistoryService');
+               $historyService = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\HistoryService');
                $history = $historyService->getHistory($parameters->table, $parameters->liveId);
                return array(
                        'data' => $history,
@@ -110,9 +111,9 @@ class ExtDirectServer extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                $diffReturnArray = array();
                $liveReturnArray = array();
                /** @var $t3lib_diff \TYPO3\CMS\Core\Utility\DiffUtility */
-               $t3lib_diff = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\DiffUtility');
+               $t3lib_diff = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\DiffUtility');
                /** @var $parseObj \TYPO3\CMS\Core\Html\RteHtmlParser */
-               $parseObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Html\\RteHtmlParser');
+               $parseObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Html\\RteHtmlParser');
                $liveRecord = BackendUtility::getRecord($parameter->table, $parameter->t3ver_oid);
                $versionRecord = BackendUtility::getRecord($parameter->table, $parameter->uid);
                $icon_Live = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($parameter->table, $liveRecord);
@@ -122,12 +123,12 @@ class ExtDirectServer extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                if ($GLOBALS['TCA'][$parameter->table]) {
                        if ($GLOBALS['TCA'][$parameter->table]['interface']['showRecordFieldList']) {
                                $fieldsOfRecords = $GLOBALS['TCA'][$parameter->table]['interface']['showRecordFieldList'];
-                               $fieldsOfRecords = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $fieldsOfRecords, TRUE);
+                               $fieldsOfRecords = GeneralUtility::trimExplode(',', $fieldsOfRecords, TRUE);
                        }
                }
                foreach ($fieldsOfRecords as $fieldName) {
                        // check for exclude fields
-                       if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['TCA'][$parameter->table]['columns'][$fieldName]['exclude'] == 0 || \TYPO3\CMS\Core\Utility\GeneralUtility::inList($GLOBALS['BE_USER']->groupData['non_exclude_fields'], $parameter->table . ':' . $fieldName)) {
+                       if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['TCA'][$parameter->table]['columns'][$fieldName]['exclude'] == 0 || GeneralUtility::inList($GLOBALS['BE_USER']->groupData['non_exclude_fields'], $parameter->table . ':' . $fieldName)) {
                                // call diff class only if there is a difference
                                if ((string)$liveRecord[$fieldName] !== (string)$versionRecord[$fieldName]) {
                                        // Select the human readable values before diff
@@ -186,7 +187,7 @@ class ExtDirectServer extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                // (this may be used by custom or dynamically-defined fields)
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['modifyDifferenceArray'])) {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['modifyDifferenceArray'] as $className) {
-                               $hookObject =& \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($className);
+                               $hookObject =& GeneralUtility::getUserObj($className);
                                $hookObject->modifyDifferenceArray($parameter, $diffReturnArray, $liveReturnArray, $t3lib_diff);
                        }
                }
@@ -218,9 +219,14 @@ class ExtDirectServer extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
         */
        public function getCommentsForRecord($uid, $table) {
                $sysLogReturnArray = array();
-               $sysLogRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('log_data,tstamp,userid', 'sys_log', 'action=6 and details_nr=30
-                               AND tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_log') . '
-                               AND recuid=' . (int)$uid, '', 'tstamp DESC');
+               $sysLogRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       'log_data,tstamp,userid',
+                       'sys_log',
+                       'action=6 and details_nr=30 AND tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_log')
+                               . ' AND recuid=' . (int)$uid,
+                       '',
+                       'tstamp DESC'
+               );
                foreach ($sysLogRows as $sysLogRow) {
                        $sysLogEntry = array();
                        $data = unserialize($sysLogRow['log_data']);
@@ -272,7 +278,7 @@ class ExtDirectServer extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
         */
        protected function getGridDataService() {
                if (!isset($this->gridDataService)) {
-                       $this->gridDataService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\GridDataService');
+                       $this->gridDataService = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\GridDataService');
                }
                return $this->gridDataService;
        }
@@ -284,7 +290,7 @@ class ExtDirectServer extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
         */
        protected function getStagesService() {
                if (!isset($this->stagesService)) {
-                       $this->stagesService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
+                       $this->stagesService = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
                }
                return $this->stagesService;
        }
index ac5b6c7..01c852e 100644 (file)
@@ -13,15 +13,17 @@ namespace TYPO3\CMS\Workspaces\ExtDirect;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * Class encapsulates all actions which are triggered for all elements within the current workspace.
  *
  * @author Kasper Skårhøj (kasperYYYY@typo3.com)
  * @author Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
  */
-class MassActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
+class MassActionHandler extends AbstractHandler {
 
        const MAX_RECORDS_TO_PROCESS = 30;
+
        /**
         * Path to the locallang file
         *
index c570a37..90f1246 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Workspaces\ExtDirect;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * Interface for classes which perform pre or post processing
  *
index d0caebf..6b76fb6 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Workspaces\ExtDirect;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * ExtDirect toolbar menu
  *
@@ -21,8 +22,11 @@ namespace TYPO3\CMS\Workspaces\ExtDirect;
 class ToolbarMenu {
 
        /**
+        * Toggle workspace preview mode
+        *
         * @param $parameter
         * @return array
+        * @todo Check where this is used.
         */
        public function toggleWorkspacePreviewMode($parameter) {
                $newState = $GLOBALS['BE_USER']->user['workspace_preview'] ? '0' : '1';
@@ -31,6 +35,8 @@ class ToolbarMenu {
        }
 
        /**
+        * Set workspace
+        *
         * @param $parameter
         * @return array
         */
index fea7924..50b471e 100644 (file)
@@ -13,6 +13,9 @@ namespace TYPO3\CMS\Workspaces\Hook;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * Befunc service
  *
@@ -26,20 +29,20 @@ class BackendUtilityHook implements \TYPO3\CMS\Core\SingletonInterface {
         * @return \TYPO3\CMS\Workspaces\Hook\BackendUtilityHook
         */
        static public function getInstance() {
-               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(__CLASS__);
+               return GeneralUtility::makeInstance(__CLASS__);
        }
 
        /**
         * Hooks into the \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick and redirects to the workspace preview
         * only if we're in a workspace and if the frontend-preview is disabled.
         *
-        * @param $pageUid
-        * @param $backPath
-        * @param $rootLine
-        * @param $anchorSection
-        * @param $viewScript
-        * @param $additionalGetVars
-        * @param $switchFocus
+        * @param int $pageUid
+        * @param string $backPath
+        * @param array $rootLine
+        * @param string $anchorSection
+        * @param string $viewScript
+        * @param string $additionalGetVars
+        * @param bool $switchFocus
         * @return void
         */
        public function preProcess(&$pageUid, $backPath, $rootLine, $anchorSection, &$viewScript, $additionalGetVars, $switchFocus) {
@@ -54,28 +57,28 @@ class BackendUtilityHook implements \TYPO3\CMS\Core\SingletonInterface {
         * @return \TYPO3\CMS\Workspaces\Service\WorkspaceService
         */
        protected function getWorkspaceService() {
-               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
+               return GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
        }
 
        /**
         * Use that hook to show a info message in case someone starts editing
         * a staged element
         *
-        * @param $params
-        * @param $form
+        * @param array $params
+        * @param \TYPO3\CMS\Backend\Controller\EditDocumentController $form
         * @return boolean
         */
        public function makeEditForm_accessCheck($params, &$form) {
                if ($GLOBALS['BE_USER']->workspace !== 0 && $GLOBALS['TCA'][$params['table']]['ctrl']['versioningWS']) {
                        $record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL($params['table'], $params['uid']);
                        if (abs($record['t3ver_stage']) > \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_EDIT_ID) {
-                               $stages = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
+                               $stages = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
                                $stageName = $stages->getStageTitle($record['t3ver_stage']);
                                $editingName = $stages->getStageTitle(\TYPO3\CMS\Workspaces\Service\StagesService::STAGE_EDIT_ID);
                                $message = $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:info.elementAlreadyModified');
-                               $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($message, $stageName, $editingName), '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO, TRUE);
+                               $flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($message, $stageName, $editingName), '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO, TRUE);
                                /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
-                               $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+                               $flashMessageService = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
                                /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
                                $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
                                $defaultFlashMessageQueue->enqueue($flashMessage);
index dc3e63c..236ab27 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Workspaces\Service;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * Service for additional columns in GridPanel
  *
index 1414c99..757c9af 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Workspaces\Service;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * Service for additional columns in GridPanel
  *
@@ -77,6 +78,8 @@ class AdditionalResourceService implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
+        * Resolve path
+        *
         * @param string $resourcePath
         * @return NULL|string
         */
index a50b6dc..7f78979 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Workspaces\Service;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * Automatic publishing of workspaces.
  *
@@ -35,10 +36,14 @@ class AutoPublishService {
                $currentAdminStatus = $GLOBALS['BE_USER']->user['admin'];
                $GLOBALS['BE_USER']->user['admin'] = 1;
                // Select all workspaces that needs to be published / unpublished:
-               $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,swap_modes,publish_time,unpublish_time', 'sys_workspace', 'pid=0
+               $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       'uid,swap_modes,publish_time,unpublish_time',
+                       'sys_workspace',
+                       'pid=0
                                AND
                                ((publish_time!=0 AND publish_time<=' . (int)$GLOBALS['EXEC_TIME'] . ')
-                               OR (publish_time=0 AND unpublish_time!=0 AND unpublish_time<=' . (int)$GLOBALS['EXEC_TIME'] . '))' . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_workspace'));
+                               OR (publish_time=0 AND unpublish_time!=0 AND unpublish_time<=' . (int)$GLOBALS['EXEC_TIME'] . '))' . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_workspace')
+               );
                $workspaceService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
                foreach ($workspaces as $rec) {
                        // First, clear start/end time so it doesn't get select once again:
index a31a777..667e8af 100644 (file)
@@ -154,18 +154,15 @@ class GridDataService {
                                        $versionArray['uid'] = $record['uid'];
                                        $versionArray['workspace'] = $versionRecord['t3ver_id'];
                                        $versionArray = array_merge($versionArray, $defaultGridColumns);
-                                       $versionArray['label_Workspace'] = htmlspecialchars(
-                                               BackendUtility::getRecordTitle($table, $versionRecord));
+                                       $versionArray['label_Workspace'] = htmlspecialchars(BackendUtility::getRecordTitle($table, $versionRecord));
                                        $versionArray['label_Live'] = htmlspecialchars(BackendUtility::getRecordTitle($table, $origRecord));
                                        $versionArray['label_Stage'] = htmlspecialchars($stagesObj->getStageTitle($versionRecord['t3ver_stage']));
                                        $tempStage = $stagesObj->getNextStage($versionRecord['t3ver_stage']);
                                        $versionArray['label_nextStage'] = htmlspecialchars($stagesObj->getStageTitle($tempStage['uid']));
                                        $tempStage = $stagesObj->getPrevStage($versionRecord['t3ver_stage']);
                                        $versionArray['label_prevStage'] = htmlspecialchars($stagesObj->getStageTitle($tempStage['uid']));
-                                       $versionArray['path_Live'] = htmlspecialchars(
-                                               BackendUtility::getRecordPath($record['livepid'], '', 999));
-                                       $versionArray['path_Workspace'] = htmlspecialchars(
-                                               BackendUtility::getRecordPath($record['wspid'], '', 999));
+                                       $versionArray['path_Live'] = htmlspecialchars(BackendUtility::getRecordPath($record['livepid'], '', 999));
+                                       $versionArray['path_Workspace'] = htmlspecialchars(BackendUtility::getRecordPath($record['wspid'], '', 999));
                                        $versionArray['workspace_Title'] = htmlspecialchars(\TYPO3\CMS\Workspaces\Service\WorkspaceService::getWorkspaceTitle($versionRecord['t3ver_wsid']));
                                        $versionArray['workspace_Tstamp'] = $versionRecord['tstamp'];
                                        $versionArray['workspace_Formated_Tstamp'] = BackendUtility::datetime($versionRecord['tstamp']);
@@ -631,7 +628,7 @@ class GridDataService {
         * @return \TYPO3\CMS\Extbase\Object\ObjectManager
         */
        protected function getObjectManager() {
-               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+               return GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
        }
 
 }
index 6dc53cc..ff78ff2 100644 (file)
@@ -15,6 +15,8 @@ namespace TYPO3\CMS\Workspaces\Service;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\MathUtility;
 
 /**
  * Stages service
@@ -308,7 +310,7 @@ class StagesService {
         * @throws \InvalidArgumentException
         */
        public function getNextStage($stageId) {
-               if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($stageId)) {
+               if (!MathUtility::canBeInterpretedAsInteger($stageId)) {
                        throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:error.stageId.integer'), 1291109987);
                }
                $nextStage = FALSE;
@@ -375,7 +377,7 @@ class StagesService {
         * @throws \InvalidArgumentException
         */
        public function getPrevStage($stageId) {
-               if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($stageId)) {
+               if (!MathUtility::canBeInterpretedAsInteger($stageId)) {
                        throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:error.stageId.integer'));
                }
                $prevStage = FALSE;
@@ -479,7 +481,7 @@ class StagesService {
         * @return string Uid list of responsible be_users
         */
        public function getResponsibleUser($stageRespValue) {
-               $stageValuesArray = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $stageRespValue, TRUE);
+               $stageValuesArray = GeneralUtility::trimExplode(',', $stageRespValue, TRUE);
                $beuserUidArray = array();
                $begroupUidArray = array();
 
@@ -501,7 +503,7 @@ class StagesService {
                        $begroupUidArray = $this->fetchGroups($begroupUidList);
                        foreach ($begroupUidArray as $groupkey => $groupData) {
                                foreach ($allBeUserArray as $useruid => $userdata) {
-                                       if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($userdata['usergroup_cached_list'], $groupData['uid'])) {
+                                       if (GeneralUtility::inList($userdata['usergroup_cached_list'], $groupData['uid'])) {
                                                $beuserUidArray[] = $useruid;
                                        }
                                }
@@ -534,7 +536,7 @@ class StagesService {
        }
 
        /**
-        * @param array         $groups
+        * @param array $groups
         * @return void
         */
        private function fetchGroupsFromDB(array $groups) {
@@ -544,6 +546,7 @@ class StagesService {
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        $this->userGroups[$row['uid']] = $row;
                }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
        }
 
        /**
@@ -554,7 +557,7 @@ class StagesService {
         * @return array
         */
        private function fetchGroupsRecursive($grList, $idList = '') {
-               $requiredGroups = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $grList, TRUE);
+               $requiredGroups = GeneralUtility::intExplode(',', $grList, TRUE);
                $existingGroups = array_keys($this->userGroups);
                $missingGroups = array_diff($requiredGroups, $existingGroups);
                if (count($missingGroups) > 0) {
@@ -565,14 +568,14 @@ class StagesService {
                        // traversing list
                        // Get row:
                        $row = $this->userGroups[$uid];
-                       if (is_array($row) && !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($idList, $uid)) {
+                       if (is_array($row) && !GeneralUtility::inList($idList, $uid)) {
                                // Must be an array and $uid should not be in the idList, because then it is somewhere previously in the grouplist
                                // If the localconf.php option isset the user of the sub- sub- groups will also be used
                                if ($GLOBALS['TYPO3_CONF_VARS']['BE']['customStageShowRecipientRecursive'] == 1) {
                                        // Include sub groups
                                        if (trim($row['subgroup'])) {
                                                // Make integer list
-                                               $theList = implode(',', \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $row['subgroup']));
+                                               $theList = implode(',', GeneralUtility::intExplode(',', $row['subgroup']));
                                                // Get the subarray
                                                $subbarray = $this->fetchGroups($theList, $idList . ',' . $uid);
                                                list($subUid, $subArray) = each($subbarray);
@@ -595,7 +598,7 @@ class StagesService {
         */
        public function getPropertyOfCurrentWorkspaceStage($stageId, $property) {
                $result = NULL;
-               if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($stageId)) {
+               if (!MathUtility::canBeInterpretedAsInteger($stageId)) {
                        throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:error.stageId.integer'));
                }
                $workspaceStage = BackendUtility::getRecord(self::TABLE_STAGE, $stageId);
@@ -725,7 +728,7 @@ class StagesService {
         * @throws \InvalidArgumentException
         */
        public function getNotificationMode($stageId) {
-               if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($stageId)) {
+               if (!MathUtility::canBeInterpretedAsInteger($stageId)) {
                        throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:error.stageId.integer'));
                }
                switch ($stageId) {
index db3f73a..312e63e 100644 (file)
@@ -86,6 +86,7 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
         *
         * @param integer $wsId
         * @return string
+        * @throws \InvalidArgumentException
         */
        static public function getWorkspaceTitle($wsId) {
                $title = FALSE;
@@ -109,11 +110,11 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Building tcemain CMD-array for swapping all versions in a workspace.
         *
-        * @param       integer         Real workspace ID, cannot be ONLINE (zero).
-        * @param       boolean         If set, then the currently online versions are swapped into the workspace in exchange for the offline versions. Otherwise the workspace is emptied.
-        * @param       integer         $pageId: ...
-        * @param       integer         $language Select specific language only
-        * @return      array           Command array for tcemain
+        * @param integer Real workspace ID, cannot be ONLINE (zero).
+        * @param boolean If set, then the currently online versions are swapped into the workspace in exchange for the offline versions. Otherwise the workspace is emptied.
+        * @param integer $pageId The page id
+        * @param integer $language Select specific language only
+        * @return array Command array for tcemain
         */
        public function getCmdArrayForPublishWS($wsid, $doSwap, $pageId = 0, $language = NULL) {
                $wsid = (int)$wsid;
@@ -143,11 +144,11 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Building tcemain CMD-array for releasing all versions in a workspace.
         *
-        * @param       integer         Real workspace ID, cannot be ONLINE (zero).
-        * @param       boolean         Run Flush (TRUE) or ClearWSID (FALSE) command
-        * @param       integer         $pageId: ...
-        * @param       integer         $language Select specific language only
-        * @return      array           Command array for tcemain
+        * @param integer Real workspace ID, cannot be ONLINE (zero).
+        * @param boolean Run Flush (TRUE) or ClearWSID (FALSE) command
+        * @param integer $pageId The page id
+        * @param integer $language Select specific language only
+        * @return array Command array for tcemain
         */
        public function getCmdArrayForFlushWS($wsid, $flush = TRUE, $pageId = 0, $language = NULL) {
                $wsid = (int)$wsid;
@@ -173,14 +174,14 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
         * Used from backend to display workspace overview
         * User for auto-publishing for selecting versions for publication
         *
-        * @param       integer         Workspace ID. If -99, will select ALL versions from ANY workspace. If -98 will select all but ONLINE. >=-1 will select from the actual workspace
-        * @param       integer         Lifecycle filter: 1 = select all drafts (never-published), 2 = select all published one or more times (archive/multiple), anything else selects all.
-        * @param       integer         Stage filter: -99 means no filtering, otherwise it will be used to select only elements with that stage. For publishing, that would be "10
-        * @param       integer         Page id: Live page for which to find versions in workspace!
-        * @param       integer         Recursion Level - select versions recursive - parameter is only relevant if $pageId != -1
-        * @param       string          How to collect records for "listing" or "modify" these tables. Support the permissions of each type of record, see \TYPO3\CMS\Core\Authentication\BackendUserAuthentication::check.
-        * @param       integer         $language Select specific language only
-        * @return      array           Array of all records uids etc. First key is table name, second key incremental integer. Records are associative arrays with uid and t3ver_oidfields. The pid of the online record is found as "livepid" the pid of the offline record is found in "wspid
+        * @param integer Workspace ID. If -99, will select ALL versions from ANY workspace. If -98 will select all but ONLINE. >=-1 will select from the actual workspace
+        * @param integer Lifecycle filter: 1 = select all drafts (never-published), 2 = select all published one or more times (archive/multiple), anything else selects all.
+        * @param integer Stage filter: -99 means no filtering, otherwise it will be used to select only elements with that stage. For publishing, that would be "10
+        * @param integer Page id: Live page for which to find versions in workspace!
+        * @param integer Recursion Level - select versions recursive - parameter is only relevant if $pageId != -1
+        * @param string How to collect records for "listing" or "modify" these tables. Support the permissions of each type of record, see \TYPO3\CMS\Core\Authentication\BackendUserAuthentication::check.
+        * @param integer $language Select specific language only
+        * @return array Array of all records uids etc. First key is table name, second key incremental integer. Records are associative arrays with uid and t3ver_oidfields. The pid of the online record is found as "livepid" the pid of the offline record is found in "wspid
         */
        public function selectVersionsInWorkspace($wsid, $filter = 0, $stage = -99, $pageId = -1, $recursionLevel = 0, $selectionType = 'tables_select', $language = NULL) {
                $wsid = (int)$wsid;
@@ -341,17 +342,17 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Find all page uids recursive starting from a specific page
         *
-        * @param        integer        $pageId
-        * @param        integer        $wsid
-        * @param        integer        $recursionLevel
-        * @return      string  Comma sep. uid list
+        * @param integer $pageId
+        * @param integer $wsid
+        * @param integer $recursionLevel
+        * @return string Comma sep. uid list
         */
        protected function getTreeUids($pageId, $wsid, $recursionLevel) {
                // Reusing existing functionality with the drawback that
                // mount points are not covered yet
                $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
                /** @var $searchObj \TYPO3\CMS\Core\Database\QueryView */
-               $searchObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryView');
+               $searchObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryView');
                if ($pageId > 0) {
                        $pageList = $searchObj->getTreeList($pageId, $recursionLevel, 0, $perms_clause);
                } else {
@@ -370,7 +371,7 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
                if ((int)$GLOBALS['TCA']['pages']['ctrl']['versioningWS'] === 2 && $pageList) {
                        // Remove the "subbranch" if a page was moved away
                        $movedAwayPages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid, pid, t3ver_move_id', 'pages', 't3ver_move_id IN (' . $pageList . ') AND t3ver_wsid=' . (int)$wsid . BackendUtility::deleteClause('pages'), '', 'uid', '', 't3ver_move_id');
-                       $pageIds = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $pageList, TRUE);
+                       $pageIds = GeneralUtility::intExplode(',', $pageList, TRUE);
                        // move all pages away
                        $newList = array_diff($pageIds, array_keys($movedAwayPages));
                        // keep current page in the list
@@ -389,7 +390,7 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
                        // In case moving pages is enabled we need to replace all move-to pointer with their origin
                        $pages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid, t3ver_move_id', 'pages', 'uid IN (' . $pageList . ')' . BackendUtility::deleteClause('pages'), '', 'uid', '', 'uid');
                        $newList = array();
-                       $pageIds = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $pageList, TRUE);
+                       $pageIds = GeneralUtility::intExplode(',', $pageList, TRUE);
                        if (!in_array($pageId, $pageIds)) {
                                $pageIds[] = $pageId;
                        }
@@ -467,7 +468,6 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Determine whether a specific page is new and not yet available in the LIVE workspace
         *
-        * @static
         * @param integer $id Primary key of the page to check
         * @param integer $language Language for which to check the page
         * @return boolean
@@ -539,7 +539,7 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
                                );
                                $_funcRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['viewSingleRecord'];
                                $null = NULL;
-                               $viewUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($_funcRef, $_params, $null);
+                               $viewUrl = GeneralUtility::callUserFunction($_funcRef, $_params, $null);
                        }
                }
 
@@ -577,14 +577,14 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
         * @return string the full domain including the protocol http:// or https://, but without the trailing '/'
         */
        public function generateWorkspacePreviewLink($uid) {
-               $previewObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Version\\Hook\\PreviewHook');
+               $previewObject = GeneralUtility::makeInstance('TYPO3\\CMS\\Version\\Hook\\PreviewHook');
                $timeToLiveHours = $previewObject->getPreviewLinkLifetime();
                $previewKeyword = $previewObject->compilePreviewKeyword('', $GLOBALS['BE_USER']->user['uid'], $timeToLiveHours * 3600, $this->getCurrentWorkspace());
                $linkParams = array(
                        'ADMCMD_prev' => $previewKeyword,
                        'id' => $uid
                );
-               return BackendUtility::getViewDomain($uid) . '/index.php?' . \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $linkParams);
+               return BackendUtility::getViewDomain($uid) . '/index.php?' . GeneralUtility::implodeArrayForUrl('', $linkParams);
        }
 
        /**
@@ -642,7 +642,7 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
         * @return \TYPO3\CMS\Extbase\Object\ObjectManager
         */
        protected function getObjectManager() {
-               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+               return GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
        }
 
 }
index 440101f..431a3c1 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Workspaces\Task;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * This class provides a wrapper around the autopublication
  * mechanism of workspaces, as a Scheduler task
index b8ce81c..ce89634 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Workspaces\Task;
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * This class provides a task to cleanup ol preview links.
  *