[TASK] Namespace classes
authorThomas Maroschik <tmaroschik@dfau.de>
Wed, 17 Oct 2012 19:56:06 +0000 (21:56 +0200)
committerThomas Maroschik <tmaroschik@dfau.de>
Wed, 17 Oct 2012 19:56:06 +0000 (21:56 +0200)
Change-Id: Ie63b7ea09bf75bdb77870025524adfd55ce4847f

39 files changed:
typo3/sysext/workspaces/Classes/Controller/AbstractController.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/Domain/Model/DatabaseRecord.php
typo3/sysext/workspaces/Classes/ExtDirect/AbstractHandler.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/Server.php
typo3/sysext/workspaces/Classes/ExtDirect/ToolbarMenu.php
typo3/sysext/workspaces/Classes/ExtDirect/WorkspaceSelectorToolbarItem.php
typo3/sysext/workspaces/Classes/Hook/BackendUtilityHook.php
typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php
typo3/sysext/workspaces/Classes/Hook/TypoScriptFrontendControllerHook.php
typo3/sysext/workspaces/Classes/Service/AutoPublish.php
typo3/sysext/workspaces/Classes/Service/AutoPublishService.php
typo3/sysext/workspaces/Classes/Service/AutoPublishTask.php
typo3/sysext/workspaces/Classes/Service/Befunc.php
typo3/sysext/workspaces/Classes/Service/CleanupPreviewLinkTask.php
typo3/sysext/workspaces/Classes/Service/Fehooks.php
typo3/sysext/workspaces/Classes/Service/GridData.php
typo3/sysext/workspaces/Classes/Service/GridDataService.php
typo3/sysext/workspaces/Classes/Service/History.php
typo3/sysext/workspaces/Classes/Service/HistoryService.php
typo3/sysext/workspaces/Classes/Service/Integrity.php
typo3/sysext/workspaces/Classes/Service/IntegrityService.php
typo3/sysext/workspaces/Classes/Service/Stages.php
typo3/sysext/workspaces/Classes/Service/StagesService.php
typo3/sysext/workspaces/Classes/Service/Tcemain.php
typo3/sysext/workspaces/Classes/Service/WorkspaceService.php
typo3/sysext/workspaces/Classes/Service/Workspaces.php
typo3/sysext/workspaces/Classes/Task/AutoPublishTask.php
typo3/sysext/workspaces/Classes/Task/CleanupPreviewLinkTask.php
typo3/sysext/workspaces/Tests/Functional/Service/WorkspaceTest.php
typo3/sysext/workspaces/ext_autoload.php
typo3/sysext/workspaces/ext_localconf.php
typo3/sysext/workspaces/ext_tables.php

index a0fce64..37488e1 100644 (file)
@@ -24,7 +24,9 @@
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-require_once (PATH_site . TYPO3_mainDir) . 'template.php';
+require_once (PATH_site . TYPO3_mainDir) . 'TYPO3\\CMS\\Backend\\Template\\DocumentTemplate.php';
+namespace TYPO3\CMS\Workspaces\Controller;
+
 /**
  * Abstract action controller.
  *
@@ -32,7 +34,7 @@ require_once (PATH_site . TYPO3_mainDir) . 'template.php';
  * @package Workspaces
  * @subpackage Controller
  */
-class Tx_Workspaces_Controller_AbstractController extends Tx_Extbase_MVC_Controller_ActionController {
+class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
 
        /**
         * @var string Key of the extension this controller belongs to
@@ -40,7 +42,7 @@ class Tx_Workspaces_Controller_AbstractController extends Tx_Extbase_MVC_Control
        protected $extensionName = 'Workspaces';
 
        /**
-        * @var t3lib_PageRenderer
+        * @var \TYPO3\CMS\Core\Page\PageRenderer
         */
        protected $pageRenderer;
 
@@ -56,20 +58,20 @@ class Tx_Workspaces_Controller_AbstractController extends Tx_Extbase_MVC_Control
         */
        protected function initializeAction() {
                // @todo Evaluate how the intval() call can be used with Extbase validators/filters
-               $this->pageId = intval(t3lib_div::_GP('id'));
+               $this->pageId = intval(\t3lib_div::_GP('id'));
                $icons = array(
-                       'language' => t3lib_iconWorks::getSpriteIconClasses('flags-multiple'),
-                       'integrity' => t3lib_iconWorks::getSpriteIconClasses('status-dialog-information'),
-                       'success' => t3lib_iconWorks::getSpriteIconClasses('status-dialog-ok'),
-                       'info' => t3lib_iconWorks::getSpriteIconClasses('status-dialog-information'),
-                       'warning' => t3lib_iconWorks::getSpriteIconClasses('status-dialog-warning'),
-                       'error' => t3lib_iconWorks::getSpriteIconClasses('status-dialog-error')
+                       'language' => \t3lib_iconWorks::getSpriteIconClasses('flags-multiple'),
+                       'integrity' => \t3lib_iconWorks::getSpriteIconClasses('status-dialog-information'),
+                       'success' => \t3lib_iconWorks::getSpriteIconClasses('status-dialog-ok'),
+                       'info' => \t3lib_iconWorks::getSpriteIconClasses('status-dialog-information'),
+                       'warning' => \t3lib_iconWorks::getSpriteIconClasses('status-dialog-warning'),
+                       'error' => \t3lib_iconWorks::getSpriteIconClasses('status-dialog-error')
                );
                $this->pageRenderer->addInlineSetting('Workspaces', 'icons', $icons);
                $this->pageRenderer->addInlineSetting('Workspaces', 'id', $this->pageId);
                $this->pageRenderer->addInlineSetting('Workspaces', 'depth', $this->pageId === 0 ? 999 : 1);
                $this->pageRenderer->addInlineSetting('Workspaces', 'language', $this->getLanguageSelection());
-               $this->pageRenderer->addCssFile(t3lib_extMgm::extRelPath('workspaces') . 'Resources/Public/StyleSheet/module.css');
+               $this->pageRenderer->addCssFile(\t3lib_extMgm::extRelPath('workspaces') . 'Resources/Public/StyleSheet/module.css');
                $this->pageRenderer->addInlineLanguageLabelArray(array(
                        'title' => $GLOBALS['LANG']->getLL('title'),
                        'path' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path'),
@@ -88,15 +90,15 @@ class Tx_Workspaces_Controller_AbstractController extends Tx_Extbase_MVC_Control
        /**
         * Processes a general request. The result can be returned by altering the given response.
         *
-        * @param Tx_Extbase_MVC_RequestInterface $request The request object
-        * @param Tx_Extbase_MVC_ResponseInterface $response The response, modified by this handler
-        * @throws Tx_Extbase_MVC_Exception_UnsupportedRequestType if the controller doesn't support the current request type
+        * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
+        * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
+        * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException if the controller doesn't support the current request type
         * @return void
         */
-       public function processRequest(Tx_Extbase_MVC_RequestInterface $request, Tx_Extbase_MVC_ResponseInterface $response) {
-               $this->template = t3lib_div::makeInstance('template');
+       public function processRequest(\Tx_Extbase_MVC_RequestInterface $request, \Tx_Extbase_MVC_ResponseInterface $response) {
+               $this->template = \t3lib_div::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
                $this->pageRenderer = $this->template->getPageRenderer();
-               $GLOBALS['SOBE'] = new stdClass();
+               $GLOBALS['SOBE'] = new \stdClass();
                $GLOBALS['SOBE']->doc = $this->template;
                parent::processRequest($request, $response);
                $pageHeader = $this->template->startpage($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:module.title'));
@@ -119,4 +121,5 @@ class Tx_Workspaces_Controller_AbstractController extends Tx_Extbase_MVC_Control
 
 }
 
+
 ?>
\ No newline at end of file
index 55251ba..9081586 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Controller;
+
 /***************************************************************
  *  Copyright notice
  *
  * @package Workspaces
  * @subpackage Controller
  */
-class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controller_AbstractController {
+class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractController {
 
        /**
-        * @var Tx_Workspaces_Service_Stages
+        * @var \TYPO3\CMS\Workspaces\Service\StagesService
         */
        protected $stageService;
 
        /**
-        * @var Tx_Workspaces_Service_Workspaces
+        * @var \TYPO3\CMS\Workspaces\Service\WorkspaceService
         */
        protected $workspaceService;
 
@@ -50,10 +52,10 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
         */
        protected function initializeAction() {
                parent::initializeAction();
-               $this->stageService = t3lib_div::makeInstance('Tx_Workspaces_Service_Stages');
-               $this->workspaceService = t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
+               $this->stageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
+               $this->workspaceService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
                $this->template->setExtDirectStateProvider();
-               $resourcePath = t3lib_extMgm::extRelPath('workspaces') . 'Resources/Public/StyleSheet/preview.css';
+               $resourcePath = \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath('workspaces') . 'Resources/Public/StyleSheet/preview.css';
                $GLOBALS['TBE_STYLES']['extJS']['theme'] = $resourcePath;
                $this->pageRenderer->loadExtJS();
                $this->pageRenderer->enableExtJSQuickTips();
@@ -68,7 +70,7 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
                $this->pageRenderer->addJsFile($this->backPath . '../t3lib/js/extjs/ux/flashmessages.js');
                $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/iframepanel.js');
                $this->pageRenderer->addJsFile($this->backPath . '../t3lib/js/extjs/notifications.js');
-               $resourcePathJavaScript = t3lib_extMgm::extRelPath('workspaces') . 'Resources/Public/JavaScript/';
+               $resourcePathJavaScript = \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath('workspaces') . 'Resources/Public/JavaScript/';
                $jsFiles = array(
                        'Ext.ux.plugins.TabStripContainer.js',
                        'Store/mainstore.js',
@@ -93,34 +95,34 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
        public function indexAction($previewWS = NULL) {
                // @todo language doesn't always come throught the L parameter
                // @todo Evaluate how the intval() call can be used with Extbase validators/filters
-               $language = intval(t3lib_div::_GP('L'));
+               $language = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('L'));
                // fetch the next and previous stage
                $workspaceItemsArray = $this->workspaceService->selectVersionsInWorkspace($this->stageService->getWorkspaceId(), ($filter = 1), ($stage = -99), $this->pageId, ($recursionLevel = 0), ($selectionType = 'tables_modify'));
                list(, $nextStage) = $this->stageService->getNextStageForElementCollection($workspaceItemsArray);
                list(, $previousStage) = $this->stageService->getPreviousStageForElementCollection($workspaceItemsArray);
-               /** @var $wsService Tx_Workspaces_Service_Workspaces */
-               $wsService = t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
+               /** @var $wsService \TYPO3\CMS\Workspaces\Service\WorkspaceService */
+               $wsService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
                $wsList = $wsService->getAvailableWorkspaces();
                $activeWorkspace = $GLOBALS['BE_USER']->workspace;
                if (!is_null($previewWS)) {
                        if (in_array($previewWS, array_keys($wsList)) && $activeWorkspace != $previewWS) {
                                $activeWorkspace = $previewWS;
                                $GLOBALS['BE_USER']->setWorkspace($activeWorkspace);
-                               t3lib_BEfunc::setUpdateSignal('updatePageTree');
+                               \TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updatePageTree');
                        }
                }
-               /** @var $uriBuilder Tx_Extbase_MVC_Web_Routing_UriBuilder */
-               $uriBuilder = $this->objectManager->create('Tx_Extbase_MVC_Web_Routing_UriBuilder');
-               $wsSettingsPath = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'typo3/';
-               $wsSettingsUri = $uriBuilder->uriFor('singleIndex', array(), 'Tx_Workspaces_Controller_ReviewController', 'workspaces', 'web_workspacesworkspaces');
+               /** @var $uriBuilder \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder */
+               $uriBuilder = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
+               $wsSettingsPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'typo3/';
+               $wsSettingsUri = $uriBuilder->uriFor('singleIndex', array(), 'TYPO3\\CMS\\Workspaces\\Controller\\ReviewController', 'workspaces', 'web_workspacesworkspaces');
                $wsSettingsParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Review';
                $wsSettingsUrl = ($wsSettingsPath . $wsSettingsUri) . $wsSettingsParams;
-               $viewDomain = t3lib_BEfunc::getViewDomain($this->pageId);
+               $viewDomain = \TYPO3\CMS\Backend\Utility\BackendUtility::getViewDomain($this->pageId);
                $wsBaseUrl = ((($viewDomain . '/index.php?id=') . $this->pageId) . '&L=') . $language;
                // @todo - handle new pages here
                // branchpoints are not handled anymore because this feature is not supposed anymore
-               if (Tx_Workspaces_Service_Workspaces::isNewPage($this->pageId)) {
-                       $wsNewPageUri = $uriBuilder->uriFor('newPage', array(), 'Tx_Workspaces_Controller_PreviewController', 'workspaces', 'web_workspacesworkspaces');
+               if (\TYPO3\CMS\Workspaces\Service\WorkspaceService::isNewPage($this->pageId)) {
+                       $wsNewPageUri = $uriBuilder->uriFor('newPage', array(), 'TYPO3\\CMS\\Workspaces\\Controller\\PreviewController', 'workspaces', 'web_workspacesworkspaces');
                        $wsNewPageParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
                        $this->view->assign('liveUrl', ($wsSettingsPath . $wsNewPageUri) . $wsNewPageParams);
                } else {
@@ -128,19 +130,19 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
                }
                $this->view->assign('wsUrl', ($wsBaseUrl . '&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=') . $GLOBALS['BE_USER']->workspace);
                $this->view->assign('wsSettingsUrl', $wsSettingsUrl);
-               $this->view->assign('backendDomain', t3lib_div::getIndpEnv('TYPO3_HOST_ONLY'));
-               $splitPreviewTsConfig = t3lib_BEfunc::getModTSconfig($this->pageId, 'workspaces.splitPreviewModes');
-               $splitPreviewModes = t3lib_div::trimExplode(',', $splitPreviewTsConfig['value']);
+               $this->view->assign('backendDomain', \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'));
+               $splitPreviewTsConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getModTSconfig($this->pageId, 'workspaces.splitPreviewModes');
+               $splitPreviewModes = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $splitPreviewTsConfig['value']);
                $allPreviewModes = array('slider', 'vbox', 'hbox');
                if (!array_intersect($splitPreviewModes, $allPreviewModes)) {
                        $splitPreviewModes = $allPreviewModes;
                }
                $this->pageRenderer->addInlineSetting('Workspaces', 'SplitPreviewModes', $splitPreviewModes);
-               $GLOBALS['BE_USER']->setAndSaveSessionData('workspaces.backend_domain', t3lib_div::getIndpEnv('TYPO3_HOST_ONLY'));
+               $GLOBALS['BE_USER']->setAndSaveSessionData('workspaces.backend_domain', \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'));
                $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 = t3lib_extMgm::extRelPath('lang') . 'res/js/be/';
+               $resourcePath = \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath('lang') . 'res/js/be/';
                $this->pageRenderer->addJsFile($resourcePath . 'typo3lang.js');
                $this->pageRenderer->addJsInlineCode('workspaces.preview.lll', ((((((((((((((((((((((('
                TYPO3.lang = {
@@ -158,7 +160,7 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
                        previousStage: \'') . $previousStage['title']) . '\'
                };TYPO3.l10n.initialize();
 ');
-               $resourcePath = t3lib_extMgm::extRelPath('workspaces') . 'Resources/Public/';
+               $resourcePath = \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath('workspaces') . 'Resources/Public/';
                $this->pageRenderer->addJsFile($resourcePath . 'JavaScript/preview.js');
        }
 
@@ -177,8 +179,8 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
         * @return void
         */
        public function newPageAction() {
-               $message = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:info.newpage.detail'), $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:info.newpage'), t3lib_FlashMessage::INFO);
-               t3lib_FlashMessageQueue::addMessage($message);
+               $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:info.newpage.detail'), $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:info.newpage'), \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
+               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($message);
        }
 
        /**
@@ -189,10 +191,10 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
         * @return      string
         */
        protected function generateJavascript() {
-               $pathTYPO3 = t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')) . '/';
+               $pathTYPO3 = \TYPO3\CMS\Core\Utility\GeneralUtility::dirname(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('SCRIPT_NAME')) . '/';
                // If another page module was specified, replace the default Page module with the new one
                $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
-               $pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
+               $pageModule = \TYPO3\CMS\Backend\Utility\BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
                if (!$GLOBALS['BE_USER']->check('modules', $pageModule)) {
                        $pageModule = '';
                }
@@ -207,11 +209,11 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
                        $loginSecurityLevel = 'superchallenged';
                }
                $t3Configuration = array(
-                       'siteUrl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL'),
+                       'siteUrl' => \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'),
                        'PATH_typo3' => $pathTYPO3,
                        'PATH_typo3_enc' => rawurlencode($pathTYPO3),
                        'username' => htmlspecialchars($GLOBALS['BE_USER']->user['username']),
-                       'uniqueID' => t3lib_div::shortMD5(uniqid('')),
+                       'uniqueID' => \TYPO3\CMS\Core\Utility\GeneralUtility::shortMD5(uniqid('')),
                        'securityLevel' => $this->loginSecurityLevel,
                        'TYPO3_mainDir' => TYPO3_mainDir,
                        'pageModule' => $pageModule,
@@ -223,7 +225,7 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
                        'moduleMenuWidth' => $this->menuWidth - 1,
                        'topBarHeight' => isset($GLOBALS['TBE_STYLES']['dims']['topFrameH']) ? intval($GLOBALS['TBE_STYLES']['dims']['topFrameH']) : 30,
                        'showRefreshLoginPopup' => isset($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) ? intval($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) : FALSE,
-                       'listModulePath' => t3lib_extMgm::isLoaded('recordlist') ? t3lib_extMgm::extRelPath('recordlist') . 'mod1/' : '',
+                       'listModulePath' => \TYPO3\CMS\Core\Extension\ExtensionManager::isLoaded('recordlist') ? \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath('recordlist') . 'mod1/' : '',
                        'debugInWindow' => $GLOBALS['BE_USER']->uc['debugInWindow'] ? 1 : 0,
                        'ContextHelpWindows' => array(
                                'width' => 600,
@@ -287,4 +289,5 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
 
 }
 
+
 ?>
\ No newline at end of file
index 5adcd7a..8070c03 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Controller;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -31,7 +33,7 @@
  * @package Workspaces
  * @subpackage Controller
  */
-class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller_AbstractController {
+class ReviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractController {
 
        /**
         * Renders the review module user dependent with all workspaces.
@@ -40,10 +42,10 @@ class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller
         * @return void
         */
        public function indexAction() {
-               $wsService = t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
+               $wsService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
                $this->view->assign('showGrid', !($GLOBALS['BE_USER']->workspace === 0 && !$GLOBALS['BE_USER']->isAdmin()));
                $this->view->assign('showAllWorkspaceTab', $GLOBALS['BE_USER']->isAdmin());
-               $this->view->assign('pageUid', t3lib_div::_GP('id'));
+               $this->view->assign('pageUid', \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'));
                $this->view->assign('showLegend', !($GLOBALS['BE_USER']->workspace === 0 && !$GLOBALS['BE_USER']->isAdmin()));
                $wsList = $wsService->getAvailableWorkspaces();
                $activeWorkspace = $GLOBALS['BE_USER']->workspace;
@@ -55,14 +57,14 @@ class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller
                        $wsCur = array($activeWorkspace => TRUE);
                        $wsList = array_intersect_key($wsList, $wsCur);
                } else {
-                       if (strlen(t3lib_div::_GP('workspace'))) {
-                               $switchWs = (int) t3lib_div::_GP('workspace');
+                       if (strlen(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('workspace'))) {
+                               $switchWs = (int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('workspace');
                                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) {
+                                       \TYPO3\CMS\Backend\Utility\BackendUtility::setUpdateSignal('updatePageTree');
+                               } elseif ($switchWs == \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES) {
                                        $this->redirect('fullIndex');
                                }
                        }
@@ -71,8 +73,8 @@ class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller
                $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));
-               $this->view->assign('showPreviewLink', $wsService->canCreatePreviewLink(t3lib_div::_GP('id'), $activeWorkspace));
+               $this->view->assign('activeWorkspaceTitle', \TYPO3\CMS\Workspaces\Service\WorkspaceService::getWorkspaceTitle($activeWorkspace));
+               $this->view->assign('showPreviewLink', $wsService->canCreatePreviewLink(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'), $activeWorkspace));
                $GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', $activeWorkspace);
        }
 
@@ -86,15 +88,15 @@ class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller
                if (!$GLOBALS['BE_USER']->isAdmin()) {
                        $this->redirect('index');
                } else {
-                       $wsService = t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
-                       $this->view->assign('pageUid', t3lib_div::_GP('id'));
+                       $wsService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
+                       $this->view->assign('pageUid', \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'));
                        $this->view->assign('showGrid', TRUE);
                        $this->view->assign('showLegend', TRUE);
                        $this->view->assign('showAllWorkspaceTab', $GLOBALS['BE_USER']->isAdmin());
                        $this->view->assign('workspaceList', $wsService->getAvailableWorkspaces());
-                       $this->view->assign('activeWorkspaceUid', Tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES);
+                       $this->view->assign('activeWorkspaceUid', \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES);
                        $this->view->assign('showPreviewLink', FALSE);
-                       $GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', Tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES);
+                       $GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES);
                        // set flag for javascript
                        $this->pageRenderer->addInlineSetting('Workspaces', 'allView', '1');
                }
@@ -107,16 +109,16 @@ class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller
         * @return void
         */
        public function singleIndexAction() {
-               $wsService = t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
+               $wsService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
                $wsList = $wsService->getAvailableWorkspaces();
                $activeWorkspace = $GLOBALS['BE_USER']->workspace;
                $wsCur = array($activeWorkspace => TRUE);
                $wsList = array_intersect_key($wsList, $wsCur);
-               $this->view->assign('pageUid', t3lib_div::_GP('id'));
+               $this->view->assign('pageUid', \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'));
                $this->view->assign('showGrid', TRUE);
                $this->view->assign('showAllWorkspaceTab', FALSE);
                $this->view->assign('workspaceList', $wsList);
-               $this->view->assign('backendDomain', t3lib_div::getIndpEnv('TYPO3_HOST_ONLY'));
+               $this->view->assign('backendDomain', \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'));
                $this->pageRenderer->addInlineSetting('Workspaces', 'singleView', '1');
        }
 
@@ -128,9 +130,9 @@ class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller
        protected function initializeAction() {
                parent::initializeAction();
                $this->template->setExtDirectStateProvider();
-               if (Tx_Workspaces_Service_Workspaces::isOldStyleWorkspaceUsed()) {
-                       $message = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:warning.oldStyleWorkspaceInUser'), '', t3lib_FlashMessage::WARNING);
-                       t3lib_FlashMessageQueue::addMessage($message);
+               if (\TYPO3\CMS\Workspaces\Service\WorkspaceService::isOldStyleWorkspaceUsed()) {
+                       $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:warning.oldStyleWorkspaceInUser'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
+                       \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($message);
                }
                $this->pageRenderer->loadExtJS();
                $this->pageRenderer->enableExtJSQuickTips();
@@ -144,7 +146,7 @@ class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller
                $this->pageRenderer->addJsFile($this->backPath . '../t3lib/js/extjs/ux/Ext.grid.RowExpander.js');
                $this->pageRenderer->addJsFile($this->backPath . '../t3lib/js/extjs/ux/Ext.app.SearchField.js');
                $this->pageRenderer->addJsFile($this->backPath . '../t3lib/js/extjs/ux/Ext.ux.FitToParent.js');
-               $resourcePath = t3lib_extMgm::extRelPath('workspaces') . 'Resources/Public/JavaScript/';
+               $resourcePath = \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath('workspaces') . 'Resources/Public/JavaScript/';
                $this->pageRenderer->addCssFile($resourcePath . 'gridfilters/css/GridFilters.css');
                $this->pageRenderer->addCssFile($resourcePath . 'gridfilters/css/RangeMenu.css');
                $jsFiles = array(
@@ -174,4 +176,5 @@ class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller
 
 }
 
+
 ?>
\ No newline at end of file
index de0f272..f4325fd 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Domain\Model;
+
 /***************************************************************
  * Copyright notice
  *
@@ -29,7 +31,7 @@
  * @package Workspaces
  * @subpackage Domain
  */
-class Tx_Workspaces_Domain_Model_CombinedRecord {
+class CombinedRecord {
 
        /**
         * @var string
@@ -37,12 +39,12 @@ class Tx_Workspaces_Domain_Model_CombinedRecord {
        protected $table;
 
        /**
-        * @var Tx_Workspaces_Domain_Model_DatabaseRecord
+        * @var \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord
         */
        protected $versionRecord;
 
        /**
-        * @var Tx_Workspaces_Domain_Model_DatabaseRecord
+        * @var \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord
         */
        protected $liveRecord;
 
@@ -52,12 +54,12 @@ class Tx_Workspaces_Domain_Model_CombinedRecord {
         * @param string $table Name of the database table
         * @param integer $liveId Id of the database live-record row
         * @param integer $versionId Id of the datbase version-record row
-        * @return Tx_Workspaces_Domain_Model_CombinedRecord
+        * @return \TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord
         */
        static public function create($table, $liveId, $versionId) {
-               $liveRecord = Tx_Workspaces_Domain_Model_DatabaseRecord::create($table, $liveId);
-               $versionRecord = Tx_Workspaces_Domain_Model_DatabaseRecord::create($table, $versionId);
-               return t3lib_div::makeInstance('Tx_Workspaces_Domain_Model_CombinedRecord', $table, $liveRecord, $versionRecord);
+               $liveRecord = \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord::create($table, $liveId);
+               $versionRecord = \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord::create($table, $versionId);
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Domain\\Model\\CombinedRecord', $table, $liveRecord, $versionRecord);
        }
 
        /**
@@ -66,22 +68,22 @@ class Tx_Workspaces_Domain_Model_CombinedRecord {
         * @param string $table Name of the database table
         * @param array $liveRow The relevant datbase live-record row
         * @param array $versionRow The relevant database version-record row
-        * @return Tx_Workspaces_Domain_Model_CombinedRecord
+        * @return \TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord
         */
        static public function createFromArrays($table, array $liveRow, array $versionRow) {
-               $liveRecord = Tx_Workspaces_Domain_Model_DatabaseRecord::createFromArray($table, $liveRow);
-               $versionRecord = Tx_Workspaces_Domain_Model_DatabaseRecord::createFromArray($table, $versionRow);
-               return t3lib_div::makeInstance('Tx_Workspaces_Domain_Model_CombinedRecord', $table, $liveRecord, $versionRecord);
+               $liveRecord = \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord::createFromArray($table, $liveRow);
+               $versionRecord = \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord::createFromArray($table, $versionRow);
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Domain\\Model\\CombinedRecord', $table, $liveRecord, $versionRecord);
        }
 
        /**
         * Creates this object.
         *
         * @param string $table
-        * @param Tx_Workspaces_Domain_Model_DatabaseRecord $liveRecord
-        * @param Tx_Workspaces_Domain_Model_DatabaseRecord $versionRecord
+        * @param \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $liveRecord
+        * @param \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $versionRecord
         */
-       public function __construct($table, Tx_Workspaces_Domain_Model_DatabaseRecord $liveRecord, Tx_Workspaces_Domain_Model_DatabaseRecord $versionRecord) {
+       public function __construct($table, \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $liveRecord, \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $versionRecord) {
                $this->setTable($table);
                $this->setLiveRecord($liveRecord);
                $this->setVersionRecord($versionRecord);
@@ -109,7 +111,7 @@ class Tx_Workspaces_Domain_Model_CombinedRecord {
        /**
         * Gets the live-record object.
         *
-        * @return Tx_Workspaces_Domain_Model_DatabaseRecord
+        * @return \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord
         */
        public function getLiveRecord() {
                return $this->liveRecord;
@@ -118,17 +120,17 @@ class Tx_Workspaces_Domain_Model_CombinedRecord {
        /**
         * Sets the live-record object.
         *
-        * @param Tx_Workspaces_Domain_Model_DatabaseRecord $liveRecord
+        * @param \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $liveRecord
         * @return void
         */
-       public function setLiveRecord(Tx_Workspaces_Domain_Model_DatabaseRecord $liveRecord) {
+       public function setLiveRecord(\TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $liveRecord) {
                $this->liveRecord = $liveRecord;
        }
 
        /**
         * Gets the version-record object.
         *
-        * @return Tx_Workspaces_Domain_Model_DatabaseRecord
+        * @return \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord
         */
        public function getVersionRecord() {
                return $this->versionRecord;
@@ -137,10 +139,10 @@ class Tx_Workspaces_Domain_Model_CombinedRecord {
        /**
         * Sets the version-record object.
         *
-        * @param Tx_Workspaces_Domain_Model_DatabaseRecord $versionRecord
+        * @param \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $versionRecord
         * @return void
         */
-       public function setVersionRecord(Tx_Workspaces_Domain_Model_DatabaseRecord $versionRecord) {
+       public function setVersionRecord(\TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord $versionRecord) {
                $this->versionRecord = $versionRecord;
        }
 
@@ -164,4 +166,5 @@ class Tx_Workspaces_Domain_Model_CombinedRecord {
 
 }
 
+
 ?>
\ No newline at end of file
index 38a33d1..0ba7f72 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Domain\Model;
+
 /***************************************************************
  * Copyright notice
  *
@@ -29,7 +31,7 @@
  * @package Workspaces
  * @subpackage Domain
  */
-class Tx_Workspaces_Domain_Model_DatabaseRecord {
+class DatabaseRecord {
 
        /**
         * @var string
@@ -51,10 +53,10 @@ class Tx_Workspaces_Domain_Model_DatabaseRecord {
         *
         * @param string $table Name of the database table
         * @param integer $uid Id of the datbase record row
-        * @return Tx_Workspaces_Domain_Model_DatabaseRecord
+        * @return \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord
         */
        static public function create($table, $uid) {
-               return t3lib_div::makeInstance('Tx_Workspaces_Domain_Model_DatabaseRecord', $table, $uid);
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Domain\\Model\\DatabaseRecord', $table, $uid);
        }
 
        /**
@@ -62,10 +64,10 @@ class Tx_Workspaces_Domain_Model_DatabaseRecord {
         *
         * @param string $table Name of the database table
         * @param array $row The relevant database record row
-        * @return Tx_Workspaces_Domain_Model_DatabaseRecord
+        * @return \TYPO3\CMS\Workspaces\Domain\Model\DatabaseRecord
         */
        static public function createFromArray($table, array $row) {
-               return t3lib_div::makeInstance('Tx_Workspaces_Domain_Model_DatabaseRecord', $table, $row['uid'], $row);
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Domain\\Model\\DatabaseRecord', $table, $row['uid'], $row);
        }
 
        /**
@@ -155,10 +157,11 @@ class Tx_Workspaces_Domain_Model_DatabaseRecord {
         */
        protected function loadRow() {
                if ($this->row === NULL) {
-                       $this->row = t3lib_BEfunc::getRecord($this->getTable(), $this->getUid());
+                       $this->row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($this->getTable(), $this->getUid());
                }
        }
 
 }
 
+
 ?>
\ No newline at end of file
index c9642a9..662d4b2 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\ExtDirect;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -31,7 +33,7 @@
  * @package Workspaces
  * @subpackage ExtDirect
  */
-abstract class Tx_Workspaces_ExtDirect_AbstractHandler {
+abstract class AbstractHandler {
 
        /**
         * Gets the current workspace ID.
@@ -65,10 +67,10 @@ abstract class Tx_Workspaces_ExtDirect_AbstractHandler {
        /**
         * Gets an instance of the workspaces service.
         *
-        * @return Tx_Workspaces_Service_Workspaces
+        * @return \TYPO3\CMS\Workspaces\Service\WorkspaceService
         */
        protected function getWorkspaceService() {
-               return t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
        }
 
        /**
@@ -78,9 +80,9 @@ abstract class Tx_Workspaces_ExtDirect_AbstractHandler {
         * @param stdClass $parameters
         * @return integer|NULL
         */
-       protected function validateLanguageParameter(stdClass $parameters) {
+       protected function validateLanguageParameter(\stdClass $parameters) {
                $language = NULL;
-               if (isset($parameters->language) && t3lib_utility_Math::canBeInterpretedAsInteger($parameters->language)) {
+               if (isset($parameters->language) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($parameters->language)) {
                        $language = $parameters->language;
                }
                return $language;
@@ -95,17 +97,17 @@ abstract class Tx_Workspaces_ExtDirect_AbstractHandler {
         * @param stdClass $parameters
         * @return array
         */
-       protected function getAffectedElements(stdClass $parameters) {
+       protected function getAffectedElements(\stdClass $parameters) {
                $affectedElements = array();
                if ($parameters->type === 'selection') {
                        foreach ((array) $parameters->selection as $element) {
-                               $affectedElements[] = Tx_Workspaces_Domain_Model_CombinedRecord::create($element->table, $element->liveId, $element->versionId);
+                               $affectedElements[] = \TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord::create($element->table, $element->liveId, $element->versionId);
                        }
                } elseif ($parameters->type === 'all') {
                        $versions = $this->getWorkspaceService()->selectVersionsInWorkspace($this->getCurrentWorkspace(), 0, -99, -1, 0, 'tables_select', $this->validateLanguageParameter($parameters));
                        foreach ($versions as $table => $tableElements) {
                                foreach ($tableElements as $element) {
-                                       $affectedElement = Tx_Workspaces_Domain_Model_CombinedRecord::create($table, $element['t3ver_oid'], $element['uid']);
+                                       $affectedElement = \TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord::create($table, $element['t3ver_oid'], $element['uid']);
                                        $affectedElement->getVersionRecord()->setRow($element);
                                        $affectedElements[] = $affectedElement;
                                }
@@ -119,16 +121,17 @@ abstract class Tx_Workspaces_ExtDirect_AbstractHandler {
         * given set of affected elements.
         *
         * @param Tx_Workspaces_Domain_Model_CombinedRecord[] $affectedElements
-        * @return Tx_Workspaces_Service_Integrity
+        * @return \TYPO3\CMS\Workspaces\Service\IntegrityService
         * @see getAffectedElements
         */
        protected function createIntegrityService(array $affectedElements) {
-               /** @var $integrityService Tx_Workspaces_Service_Integrity */
-               $integrityService = t3lib_div::makeInstance('Tx_Workspaces_Service_Integrity');
+               /** @var $integrityService \TYPO3\CMS\Workspaces\Service\IntegrityService */
+               $integrityService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\IntegrityService');
                $integrityService->setAffectedElements($affectedElements);
                return $integrityService;
        }
 
 }
 
+
 ?>
\ No newline at end of file
index 0e259f4..3b6191d 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\ExtDirect;
+
 /***************************************************************
  *  Copyright notice
  *
  * @package Workspaces
  * @subpackage ExtDirect
  */
-class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_AbstractHandler {
+class ActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
 
        /**
-        * @var Tx_Workspaces_Service_Stages
+        * @var \TYPO3\CMS\Workspaces\Service\StagesService
         */
        protected $stageService;
 
@@ -42,7 +44,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * Creates this object.
         */
        public function __construct() {
-               $this->stageService = t3lib_div::makeInstance('Tx_Workspaces_Service_Stages');
+               $this->stageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
        }
 
        /**
@@ -96,7 +98,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @return string
         */
        public function viewSingleRecord($table, $uid) {
-               return Tx_Workspaces_Service_Workspaces::viewSingleRecord($table, $uid);
+               return \TYPO3\CMS\Workspaces\Service\WorkspaceService::viewSingleRecord($table, $uid);
        }
 
        /**
@@ -132,7 +134,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @return void
         */
        public function saveLanguageSelection($language) {
-               if (t3lib_utility_Math::canBeInterpretedAsInteger($language) === FALSE && $language !== 'all') {
+               if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($language) === FALSE && $language !== 'all') {
                        $language = 'all';
                }
                $GLOBALS['BE_USER']->uc['moduleData']['Workspaces'][$GLOBALS['BE_USER']->workspace]['language'] = $language;
@@ -148,7 +150,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @return array
         */
        public function sendToNextStageWindow($uid, $table, $t3ver_oid) {
-               $elementRecord = t3lib_BEfunc::getRecord($table, $uid);
+               $elementRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, $uid);
                if (is_array($elementRecord)) {
                        $stageId = $elementRecord['t3ver_stage'];
                        if ($this->getStageService()->isValid($stageId)) {
@@ -177,11 +179,11 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @return array
         */
        public function sendToPrevStageWindow($uid, $table) {
-               $elementRecord = t3lib_BEfunc::getRecord($table, $uid);
+               $elementRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, $uid);
                if (is_array($elementRecord)) {
                        $stageId = $elementRecord['t3ver_stage'];
                        if ($this->getStageService()->isValid($stageId)) {
-                               if ($stageId !== Tx_Workspaces_Service_Stages::STAGE_EDIT_ID) {
+                               if ($stageId !== \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_EDIT_ID) {
                                        $prevStage = $this->getStageService()->getPrevStage($stageId);
                                        $result = $this->getSentToStageWindow($prevStage['uid']);
                                        $result['affects'] = array(
@@ -227,13 +229,13 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
        public function getRecipientList(array $uidOfRecipients, $additionalRecipients, $stageId) {
                $finalRecipients = array();
                if (!$this->getStageService()->isValid($stageId)) {
-                       throw new InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:error.stageId.integer'));
+                       throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:error.stageId.integer'));
                } else {
                        $stageId = (int) $stageId;
                }
                $recipients = array();
                foreach ($uidOfRecipients as $userUid) {
-                       $beUserRecord = t3lib_befunc::getRecord('be_users', intval($userUid));
+                       $beUserRecord = \t3lib_befunc::getRecord('be_users', intval($userUid));
                        if (is_array($beUserRecord) && $beUserRecord['email'] !== '') {
                                $uc = $beUserRecord['uc'] ? unserialize($beUserRecord['uc']) : array();
                                $recipients[$beUserRecord['email']] = array(
@@ -244,7 +246,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
                }
                // the notification mode can be configured in the workspace stage record
                $notification_mode = $this->getStageService()->getNotificationMode($stageId);
-               if (intval($notification_mode) === Tx_Workspaces_Service_Stages::MODE_NOTIFY_ALL || intval($notification_mode) === Tx_Workspaces_Service_Stages::MODE_NOTIFY_ALL_STRICT) {
+               if (intval($notification_mode) === \TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_ALL || intval($notification_mode) === \TYPO3\CMS\Workspaces\Service\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);
@@ -259,7 +261,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
                        }
                }
                if ($additionalRecipients !== '') {
-                       $emails = t3lib_div::trimExplode(LF, $additionalRecipients, TRUE);
+                       $emails = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(LF, $additionalRecipients, TRUE);
                        $additionalRecipients = array();
                        foreach ($emails as $email) {
                                $additionalRecipients[$email] = array('email' => $email);
@@ -273,7 +275,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
                // and $recipients with the email address
                $allRecipients = array_merge($additionalRecipients, $recipients);
                foreach ($allRecipients as $email => $recipientInformation) {
-                       if (t3lib_div::validEmail($email)) {
+                       if (\TYPO3\CMS\Core\Utility\GeneralUtility::validEmail($email)) {
                                $finalRecipients[] = $recipientInformation;
                        }
                }
@@ -289,10 +291,10 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         */
        public function discardStagesFromPage($pageId) {
                $cmdMapArray = array();
-               /** @var $workspaceService Tx_Workspaces_Service_Workspaces */
-               $workspaceService = t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
-               /** @var $stageService Tx_Workspaces_Service_Stages */
-               $stageService = t3lib_div::makeInstance('Tx_Workspaces_Service_Stages');
+               /** @var $workspaceService \TYPO3\CMS\Workspaces\Service\WorkspaceService */
+               $workspaceService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
+               /** @var $stageService \TYPO3\CMS\Workspaces\Service\StagesService */
+               $stageService = \TYPO3\CMS\Core\Utility\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) {
                        foreach ($items as $item) {
@@ -320,20 +322,20 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @return array
         * @author Michael Klapper <development@morphodo.com>
         */
-       public function sentCollectionToStage(stdClass $parameters) {
+       public function sentCollectionToStage(\stdClass $parameters) {
                $cmdMapArray = array();
                $comment = $parameters->comments;
                $stageId = $parameters->stageId;
-               if (t3lib_utility_Math::canBeInterpretedAsInteger($stageId) === FALSE) {
-                       throw new InvalidArgumentException('Missing "stageId" in $parameters array.', 1319488194);
+               if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($stageId) === FALSE) {
+                       throw new \InvalidArgumentException('Missing "stageId" in $parameters array.', 1319488194);
                }
                if (!is_object($parameters->affects) || count($parameters->affects) == 0) {
-                       throw new InvalidArgumentException('Missing "affected items" in $parameters array.', 1319488195);
+                       throw new \InvalidArgumentException('Missing "affected items" in $parameters array.', 1319488195);
                }
                $recipients = $this->getRecipientList($parameters->receipients, $parameters->additional, $stageId);
                foreach ($parameters->affects as $tableName => $items) {
                        foreach ($items as $item) {
-                               if ($stageId == Tx_Workspaces_Service_Stages::STAGE_PUBLISH_EXECUTE_ID) {
+                               if ($stageId == \TYPO3\CMS\Workspaces\Service\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;
@@ -362,7 +364,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @author Michael Klapper <development@morphodo.com>
         */
        protected function processTcaCmd(array $cmdMapArray) {
-               $tce = t3lib_div::makeInstance('t3lib_TCEmain');
+               $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandler\\DataHandler');
                $tce->start(array(), $cmdMapArray);
                $tce->process_cmdmap();
        }
@@ -382,7 +384,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @param stdClass $parameters
         * @return array
         */
-       public function sendToNextStageExecute(stdClass $parameters) {
+       public function sendToNextStageExecute(\stdClass $parameters) {
                $cmdArray = array();
                $setStageId = $parameters->affects->nextStage;
                $comments = $parameters->comments;
@@ -390,7 +392,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
                $uid = $parameters->affects->uid;
                $t3ver_oid = $parameters->affects->t3ver_oid;
                $recipients = $this->getRecipientList($parameters->receipients, $parameters->additional, $setStageId);
-               if ($setStageId == Tx_Workspaces_Service_Stages::STAGE_PUBLISH_EXECUTE_ID) {
+               if ($setStageId == \TYPO3\CMS\Workspaces\Service\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;
@@ -422,7 +424,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @param stdClass $parameters
         * @return array
         */
-       public function sendToPrevStageExecute(stdClass $parameters) {
+       public function sendToPrevStageExecute(\stdClass $parameters) {
                $cmdArray = array();
                $recipients = array();
                $setStageId = $parameters->affects->nextStage;
@@ -462,14 +464,14 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @param stdClass $parameters
         * @return array
         */
-       public function sendToSpecificStageExecute(stdClass $parameters) {
+       public function sendToSpecificStageExecute(\stdClass $parameters) {
                $cmdArray = array();
                $setStageId = $parameters->affects->nextStage;
                $comments = $parameters->comments;
                $elements = $parameters->affects->elements;
                $recipients = $this->getRecipientList($parameters->receipients, $parameters->additional, $setStageId);
                foreach ($elements as $key => $element) {
-                       if ($setStageId == Tx_Workspaces_Service_Stages::STAGE_PUBLISH_EXECUTE_ID) {
+                       if ($setStageId == \TYPO3\CMS\Workspaces\Service\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;
@@ -495,7 +497,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @return array
         */
        protected function getSentToStageWindow($nextStageId) {
-               $workspaceRec = t3lib_BEfunc::getRecord('sys_workspace', $this->getStageService()->getWorkspaceId());
+               $workspaceRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('sys_workspace', $this->getStageService()->getWorkspaceId());
                $showNotificationFields = FALSE;
                $stageTitle = $this->getStageService()->getStageTitle($nextStageId);
                $result = array(
@@ -509,14 +511,14 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
                        )
                );
                switch ($nextStageId) {
-               case Tx_Workspaces_Service_Stages::STAGE_PUBLISH_EXECUTE_ID:
+               case \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_EXECUTE_ID:
 
-               case Tx_Workspaces_Service_Stages::STAGE_PUBLISH_ID:
+               case \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_ID:
                        if (!empty($workspaceRec['publish_allow_notificaton_settings'])) {
                                $showNotificationFields = TRUE;
                        }
                        break;
-               case Tx_Workspaces_Service_Stages::STAGE_EDIT_ID:
+               case \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_EDIT_ID:
                        if (!empty($workspaceRec['edit_allow_notificaton_settings'])) {
                                $showNotificationFields = TRUE;
                        }
@@ -568,16 +570,16 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
                $recipients = $this->getStageService()->getResponsibleBeUser($stage);
                $default_recipients = $this->getStageService()->getResponsibleBeUser($stage, TRUE);
                foreach ($recipients as $id => $user) {
-                       if (t3lib_div::validEmail($user['email'])) {
+                       if (\TYPO3\CMS\Core\Utility\GeneralUtility::validEmail($user['email'])) {
                                $checked = FALSE;
                                $disabled = FALSE;
                                $name = $user['realName'] ? $user['realName'] : $user['username'];
                                // the notification mode can be configured in the workspace stage record
                                $notification_mode = $this->getStageService()->getNotificationMode($stage);
-                               if (intval($notification_mode) === Tx_Workspaces_Service_Stages::MODE_NOTIFY_SOMEONE) {
+                               if (intval($notification_mode) === \TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_SOMEONE) {
                                        // all responsible users are checked per default, as in versions before
                                        $checked = TRUE;
-                               } elseif (intval($notification_mode) === Tx_Workspaces_Service_Stages::MODE_NOTIFY_ALL) {
+                               } elseif (intval($notification_mode) === \TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_ALL) {
                                        // the default users are checked only
                                        if (!empty($default_recipients[$id])) {
                                                $checked = TRUE;
@@ -585,7 +587,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
                                        } else {
                                                $checked = FALSE;
                                        }
-                               } elseif (intval($notification_mode) === Tx_Workspaces_Service_Stages::MODE_NOTIFY_ALL_STRICT) {
+                               } elseif (intval($notification_mode) === \TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_ALL_STRICT) {
                                        // all responsible users are checked
                                        $checked = TRUE;
                                        $disabled = TRUE;
@@ -615,11 +617,11 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
        /**
         * Gets an instance of the Stage service.
         *
-        * @return Tx_Workspaces_Service_Stages
+        * @return \TYPO3\CMS\Workspaces\Service\StagesService
         */
        protected function getStageService() {
                if (!isset($this->stageService)) {
-                       $this->stageService = t3lib_div::makeInstance('Tx_Workspaces_Service_Stages');
+                       $this->stageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
                }
                return $this->stageService;
        }
@@ -632,7 +634,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @author Michael Klapper <development@morphodo.com>
         */
        public function sendPageToPreviousStage($id) {
-               $workspaceService = t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
+               $workspaceService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
                $workspaceItemsArray = $workspaceService->selectVersionsInWorkspace($this->stageService->getWorkspaceId(), ($filter = 1), ($stage = -99), $id, ($recursionLevel = 0), ($selectionType = 'tables_modify'));
                list($currentStage, $previousStage) = $this->getStageService()->getPreviousStageForElementCollection($workspaceItemsArray);
                // get only the relevant items for processing
@@ -651,7 +653,7 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @author Michael Klapper <development@morphodo.com>
         */
        public function sendPageToNextStage($id) {
-               $workspaceService = t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
+               $workspaceService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
                $workspaceItemsArray = $workspaceService->selectVersionsInWorkspace($this->stageService->getWorkspaceId(), ($filter = 1), ($stage = -99), $id, ($recursionLevel = 0), ($selectionType = 'tables_modify'));
                list($currentStage, $nextStage) = $this->getStageService()->getNextStageForElementCollection($workspaceItemsArray);
                // get only the relevant items for processing
@@ -672,8 +674,8 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
         * @author Michael Klapper <development@morphodo.com>
         */
        public function updateStageChangeButtons($id) {
-               $stageService = t3lib_div::makeInstance('Tx_Workspaces_Service_Stages');
-               $workspaceService = t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
+               $stageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
+               $workspaceService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
                // fetch the next and previous stage
                $workspaceItemsArray = $workspaceService->selectVersionsInWorkspace($stageService->getWorkspaceId(), ($filter = 1), ($stage = -99), $id, ($recursionLevel = 0), ($selectionType = 'tables_modify'));
                list(, $nextStage) = $stageService->getNextStageForElementCollection($workspaceItemsArray);
@@ -697,4 +699,5 @@ class Tx_Workspaces_ExtDirect_ActionHandler extends Tx_Workspaces_ExtDirect_Abst
 
 }
 
+
 ?>
\ No newline at end of file
index f9ed172..e5727f0 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\ExtDirect;
+
 /***************************************************************
  *  Copyright notice
  *
  * @package Workspaces
  * @subpackage ExtDirect
  */
-class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHandler {
+class ExtDirectServer extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
 
        /**
-        * @var Tx_Workspaces_Service_GridData
+        * @var \TYPO3\CMS\Workspaces\Service\GridDataService
         */
        protected $gridDataService;
 
        /**
-        * @var Tx_Workspaces_Service_Stages
+        * @var \TYPO3\CMS\Workspaces\Service\StagesService
         */
        protected $stagesService;
 
@@ -49,7 +51,7 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
         * @param stdClass $parameters
         * @return array
         */
-       public function checkIntegrity(stdClass $parameters) {
+       public function checkIntegrity(\stdClass $parameters) {
                $integrity = $this->createIntegrityService($this->getAffectedElements($parameters));
                $integrity->check();
                $response = array(
@@ -67,7 +69,7 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
        public function getWorkspaceInfos($parameter) {
                // To avoid too much work we use -1 to indicate that every page is relevant
                $pageId = $parameter->id > 0 ? $parameter->id : -1;
-               if (!isset($parameter->language) || !t3lib_utility_Math::canBeInterpretedAsInteger($parameter->language)) {
+               if (!isset($parameter->language) || !\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($parameter->language)) {
                        $parameter->language = NULL;
                }
                $versions = $this->getWorkspaceService()->selectVersionsInWorkspace($this->getCurrentWorkspace(), 0, -99, $pageId, $parameter->depth, 'tables_select', $parameter->language);
@@ -82,8 +84,8 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
         * @return array
         */
        public function getHistory($parameters) {
-               /** @var $historyService Tx_Workspaces_Service_History */
-               $historyService = t3lib_div::makeInstance('Tx_Workspaces_Service_History');
+               /** @var $historyService \TYPO3\CMS\Workspaces\Service\HistoryService */
+               $historyService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\HistoryService');
                $history = $historyService->getHistory($parameters->table, $parameters->versionId);
                return array(
                        'data' => $history,
@@ -100,7 +102,7 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
        public function getStageActions($parameter) {
                $currentWorkspace = $this->getCurrentWorkspace();
                $stages = array();
-               if ($currentWorkspace != Tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES) {
+               if ($currentWorkspace != \TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES) {
                        $stages = $this->getStagesService()->getStagesForWSUser();
                }
                $data = array(
@@ -119,40 +121,40 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
        public function getRowDetails($parameter) {
                $diffReturnArray = array();
                $liveReturnArray = array();
-               /** @var $t3lib_diff t3lib_diff */
-               $t3lib_diff = t3lib_div::makeInstance('t3lib_diff');
-               /** @var $parseObj t3lib_parsehtml_proc */
-               $parseObj = t3lib_div::makeInstance('t3lib_parsehtml_proc');
-               $liveRecord = t3lib_BEfunc::getRecord($parameter->table, $parameter->t3ver_oid);
-               $versionRecord = t3lib_BEfunc::getRecord($parameter->table, $parameter->uid);
-               $icon_Live = t3lib_iconWorks::mapRecordTypeToSpriteIconClass($parameter->table, $liveRecord);
-               $icon_Workspace = t3lib_iconWorks::mapRecordTypeToSpriteIconClass($parameter->table, $versionRecord);
+               /** @var $t3lib_diff \TYPO3\CMS\Core\Utility\DiffUtility */
+               $t3lib_diff = \TYPO3\CMS\Core\Utility\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');
+               $liveRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($parameter->table, $parameter->t3ver_oid);
+               $versionRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($parameter->table, $parameter->uid);
+               $icon_Live = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($parameter->table, $liveRecord);
+               $icon_Workspace = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($parameter->table, $versionRecord);
                $stagePosition = $this->getStagesService()->getPositionOfCurrentStage($parameter->stage);
                $fieldsOfRecords = array_keys($liveRecord);
                // get field list from TCA configuration, if available
-               t3lib_div::loadTCA($parameter->table);
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($parameter->table);
                if ($GLOBALS['TCA'][$parameter->table]) {
                        if ($GLOBALS['TCA'][$parameter->table]['interface']['showRecordFieldList']) {
                                $fieldsOfRecords = $GLOBALS['TCA'][$parameter->table]['interface']['showRecordFieldList'];
-                               $fieldsOfRecords = t3lib_div::trimExplode(',', $fieldsOfRecords, 1);
+                               $fieldsOfRecords = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $fieldsOfRecords, 1);
                        }
                }
                foreach ($fieldsOfRecords as $fieldName) {
                        // check for exclude fields
-                       if (($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['TCA'][$parameter->table]['columns'][$fieldName]['exclude'] == 0) || t3lib_div::inList($GLOBALS['BE_USER']->groupData['non_exclude_fields'], ($parameter->table . ':') . $fieldName)) {
+                       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)) {
                                // call diff class only if there is a difference
                                if (strcmp($liveRecord[$fieldName], $versionRecord[$fieldName]) !== 0) {
                                        // Select the human readable values before diff
-                                       $liveRecord[$fieldName] = t3lib_BEfunc::getProcessedValue($parameter->table, $fieldName, $liveRecord[$fieldName], 0, 1);
-                                       $versionRecord[$fieldName] = t3lib_BEfunc::getProcessedValue($parameter->table, $fieldName, $versionRecord[$fieldName], 0, 1);
+                                       $liveRecord[$fieldName] = \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($parameter->table, $fieldName, $liveRecord[$fieldName], 0, 1);
+                                       $versionRecord[$fieldName] = \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($parameter->table, $fieldName, $versionRecord[$fieldName], 0, 1);
                                        // Get the field's label. If not available, use the field name
-                                       $fieldTitle = $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel($parameter->table, $fieldName));
+                                       $fieldTitle = $GLOBALS['LANG']->sL(\TYPO3\CMS\Backend\Utility\BackendUtility::getItemLabel($parameter->table, $fieldName));
                                        if (empty($fieldTitle)) {
                                                $fieldTitle = $fieldName;
                                        }
                                        if ($GLOBALS['TCA'][$parameter->table]['columns'][$fieldName]['config']['type'] == 'group' && $GLOBALS['TCA'][$parameter->table]['columns'][$fieldName]['config']['internal_type'] == 'file') {
-                                               $versionThumb = t3lib_BEfunc::thumbCode($versionRecord, $parameter->table, $fieldName, '');
-                                               $liveThumb = t3lib_BEfunc::thumbCode($liveRecord, $parameter->table, $fieldName, '');
+                                               $versionThumb = \TYPO3\CMS\Backend\Utility\BackendUtility::thumbCode($versionRecord, $parameter->table, $fieldName, '');
+                                               $liveThumb = \TYPO3\CMS\Backend\Utility\BackendUtility::thumbCode($liveRecord, $parameter->table, $fieldName, '');
                                                $diffReturnArray[] = array(
                                                        'field' => $fieldName,
                                                        'label' => $fieldTitle,
@@ -182,7 +184,7 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
                // (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 =& t3lib_div::getUserObj($className);
+                               $hookObject =& \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($className);
                                $hookObject->modifyDifferenceArray($parameter, $diffReturnArray, $liveReturnArray, $t3lib_diff);
                        }
                }
@@ -220,11 +222,11 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
                foreach ($sysLogRows as $sysLogRow) {
                        $sysLogEntry = array();
                        $data = unserialize($sysLogRow['log_data']);
-                       $beUserRecord = t3lib_BEfunc::getRecord('be_users', $sysLogRow['userid']);
+                       $beUserRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('be_users', $sysLogRow['userid']);
                        $sysLogEntry['stage_title'] = $this->getStagesService()->getStageTitle($data['stage']);
                        $sysLogEntry['user_uid'] = $sysLogRow['userid'];
                        $sysLogEntry['user_username'] = is_array($beUserRecord) ? $beUserRecord['username'] : '';
-                       $sysLogEntry['tstamp'] = t3lib_BEfunc::datetime($sysLogRow['tstamp']);
+                       $sysLogEntry['tstamp'] = \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($sysLogRow['tstamp']);
                        $sysLogEntry['user_comment'] = $data['comment'];
                        $sysLogReturnArray[] = $sysLogEntry;
                }
@@ -240,8 +242,8 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
                $systemLanguages = array(
                        array(
                                'uid' => 'all',
-                               'title' => Tx_Extbase_Utility_Localization::translate('language.allLanguages', 'workspaces'),
-                               'cls' => t3lib_iconWorks::getSpriteIconClasses('empty-empty')
+                               'title' => \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('language.allLanguages', 'workspaces'),
+                               'cls' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('empty-empty')
                        )
                );
                foreach ($this->getGridDataService()->getSystemLanguages() as $id => $systemLanguage) {
@@ -251,7 +253,7 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
                        $systemLanguages[] = array(
                                'uid' => $id,
                                'title' => htmlspecialchars($systemLanguage['title']),
-                               'cls' => t3lib_iconWorks::getSpriteIconClasses($systemLanguage['flagIcon'])
+                               'cls' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses($systemLanguage['flagIcon'])
                        );
                }
                $result = array(
@@ -264,11 +266,11 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
        /**
         * Gets the Grid Data Service.
         *
-        * @return Tx_Workspaces_Service_GridData
+        * @return \TYPO3\CMS\Workspaces\Service\GridDataService
         */
        protected function getGridDataService() {
                if (!isset($this->gridDataService)) {
-                       $this->gridDataService = t3lib_div::makeInstance('Tx_Workspaces_Service_GridData');
+                       $this->gridDataService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\GridDataService');
                }
                return $this->gridDataService;
        }
@@ -276,15 +278,16 @@ class Tx_Workspaces_ExtDirect_Server extends Tx_Workspaces_ExtDirect_AbstractHan
        /**
         * Gets the Stages Service.
         *
-        * @return Tx_Workspaces_Service_Stages
+        * @return \TYPO3\CMS\Workspaces\Service\StagesService
         */
        protected function getStagesService() {
                if (!isset($this->stagesService)) {
-                       $this->stagesService = t3lib_div::makeInstance('Tx_Workspaces_Service_Stages');
+                       $this->stagesService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
                }
                return $this->stagesService;
        }
 
 }
 
+
 ?>
\ No newline at end of file
index 582feaf..b6d2489 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\ExtDirect;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -33,7 +35,7 @@
  * @package Workspaces
  * @subpackage ExtDirect
  */
-class Tx_Workspaces_ExtDirect_MassActionHandler extends Tx_Workspaces_ExtDirect_AbstractHandler {
+class MassActionHandler extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
 
        const MAX_RECORDS_TO_PROCESS = 30;
        /**
@@ -54,7 +56,7 @@ class Tx_Workspaces_ExtDirect_MassActionHandler extends Tx_Workspaces_ExtDirect_
                $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 && $massActionsEnabled) {
+               if ($currentWorkspace != \TYPO3\CMS\Workspaces\Service\WorkspaceService::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'));
@@ -62,7 +64,7 @@ class Tx_Workspaces_ExtDirect_MassActionHandler extends Tx_Workspaces_ExtDirect_
                                        $actions[] = array('action' => 'swap', 'title' => $GLOBALS['LANG']->sL($this->pathToLocallang . ':label_doaction_swap'));
                                }
                        }
-                       if ($currentWorkspace !== Tx_Workspaces_Service_Workspaces::LIVE_WORKSPACE_ID) {
+                       if ($currentWorkspace !== \TYPO3\CMS\Workspaces\Service\WorkspaceService::LIVE_WORKSPACE_ID) {
                                $actions[] = array('action' => 'discard', 'title' => $GLOBALS['LANG']->sL($this->pathToLocallang . ':label_doaction_discard'));
                        }
                }
@@ -79,7 +81,7 @@ class Tx_Workspaces_ExtDirect_MassActionHandler extends Tx_Workspaces_ExtDirect_
         * @param stdclass $parameters
         * @return array
         */
-       public function publishWorkspace(stdclass $parameters) {
+       public function publishWorkspace(\stdclass $parameters) {
                $result = array(
                        'init' => FALSE,
                        'total' => 0,
@@ -95,7 +97,7 @@ class Tx_Workspaces_ExtDirect_MassActionHandler extends Tx_Workspaces_ExtDirect_
                                $result['processed'] = $this->processData($this->getCurrentWorkspace());
                                $result['total'] = $GLOBALS['BE_USER']->getSessionData('workspaceMassAction_total');
                        }
-               } catch (Exception $e) {
+               } catch (\Exception $e) {
                        $result['error'] = $e->getMessage();
                }
                return $result;
@@ -107,7 +109,7 @@ class Tx_Workspaces_ExtDirect_MassActionHandler extends Tx_Workspaces_ExtDirect_
         * @param stdclass $parameters
         * @return array
         */
-       public function flushWorkspace(stdclass $parameters) {
+       public function flushWorkspace(\stdclass $parameters) {
                $result = array(
                        'init' => FALSE,
                        'total' => 0,
@@ -123,7 +125,7 @@ class Tx_Workspaces_ExtDirect_MassActionHandler extends Tx_Workspaces_ExtDirect_
                                $result['processed'] = $this->processData($this->getCurrentWorkspace());
                                $result['total'] = $GLOBALS['BE_USER']->getSessionData('workspaceMassAction_total');
                        }
-               } catch (Exception $e) {
+               } catch (\Exception $e) {
                        $result['error'] = $e->getMessage();
                }
                return $result;
@@ -202,15 +204,15 @@ class Tx_Workspaces_ExtDirect_MassActionHandler extends Tx_Workspaces_ExtDirect_
                        $GLOBALS['BE_USER']->setAndSaveSessionData('workspaceMassAction', NULL);
                        $GLOBALS['BE_USER']->setAndSaveSessionData('workspaceMassAction_total', 0);
                } else {
-                       /** @var $tce t3lib_TCEmain */
-                       $tce = t3lib_div::makeInstance('t3lib_TCEmain');
+                       /** @var $tce \TYPO3\CMS\Core\DataHandler\DataHandler */
+                       $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandler\\DataHandler');
                        $tce->stripslashes_values = 0;
                        // Execute the commands:
                        $tce->start(array(), $limitedCmd);
                        $tce->process_cmdmap();
                        $errors = $tce->errorLog;
                        if (count($errors) > 0) {
-                               throw new Exception(implode(', ', $errors));
+                               throw new \Exception(implode(', ', $errors));
                        } else {
                                // Unset processed records
                                foreach ($limitedCmd as $table => $recs) {
@@ -228,4 +230,5 @@ class Tx_Workspaces_ExtDirect_MassActionHandler extends Tx_Workspaces_ExtDirect_
 
 }
 
+
 ?>
\ No newline at end of file
index 4b69ce5..d25ed30 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\ExtDirect;
+
 /***************************************************************
  *  Copyright notice
  *
  * @package    TYPO3
  * @subpackage t3lib
  */
-class Tx_Workspaces_ExtDirect_PagetreeCollectionsProcessor implements t3lib_tree_pagetree_interfaces_CollectionProcessor {
+class PagetreeCollectionsProcessor implements \TYPO3\CMS\Backend\Tree\Pagetree\CollectionProcessorInterface {
 
        /**
         * @abstract
-        * @param t3lib_tree_pagetree_Node $node
+        * @param \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode $node
         * @param int $mountPoint
         * @param int $level
-        * @param t3lib_tree_pagetree_NodeCollection $nodeCollection
+        * @param \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNodeCollection $nodeCollection
         * @return void
         */
        public function postProcessGetNodes($node, $mountPoint, $level, $nodeCollection) {
                foreach ($nodeCollection as $node) {
-                       /** @var $node t3lib_tree_Node */
+                       /** @var $node \TYPO3\CMS\Backend\Tree\TreeNode */
                        $this->highlightVersionizedElements($node);
                }
        }
 
        /**
         * @abstract
-        * @param t3lib_tree_pagetree_Node $node
+        * @param \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode $node
         * @param string $searchFilter
         * @param int $mountPoint
-        * @param t3lib_tree_pagetree_NodeCollection $nodeCollection
+        * @param \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNodeCollection $nodeCollection
         * @return void
         */
        public function postProcessFilteredNodes($node, $searchFilter, $mountPoint, $nodeCollection) {
                foreach ($nodeCollection as $node) {
-                       /** @var $node t3lib_tree_Node */
+                       /** @var $node \TYPO3\CMS\Backend\Tree\TreeNode */
                        $this->highlightVersionizedElements($node);
                }
        }
@@ -66,12 +68,12 @@ class Tx_Workspaces_ExtDirect_PagetreeCollectionsProcessor implements t3lib_tree
        /**
         * @abstract
         * @param string $searchFilter
-        * @param t3lib_tree_pagetree_NodeCollection $nodeCollection
+        * @param \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNodeCollection $nodeCollection
         * @return void
         */
        public function postProcessGetTreeMounts($searchFilter, $nodeCollection) {
                foreach ($nodeCollection as $node) {
-                       /** @var $node t3lib_tree_Node */
+                       /** @var $node \TYPO3\CMS\Backend\Tree\TreeNode */
                        $this->highlightVersionizedElements($node);
                }
        }
@@ -80,15 +82,16 @@ class Tx_Workspaces_ExtDirect_PagetreeCollectionsProcessor implements t3lib_tree
         * Sets the CSS Class on all pages which have versioned records
         * in the current workspace
         *
-        * @param t3lib_tree_Node $node
+        * @param \TYPO3\CMS\Backend\Tree\TreeNode $node
         * @return void
         */
-       protected function highlightVersionizedElements(t3lib_tree_Node $node) {
-               if (!$node->getCls() && count(t3lib_BEfunc::countVersionsOfRecordsOnPage($GLOBALS['BE_USER']->workspace, $node->getId(), TRUE))) {
+       protected function highlightVersionizedElements(\TYPO3\CMS\Backend\Tree\TreeNode $node) {
+               if (!$node->getCls() && count(\TYPO3\CMS\Backend\Utility\BackendUtility::countVersionsOfRecordsOnPage($GLOBALS['BE_USER']->workspace, $node->getId(), TRUE))) {
                        $node->setCls('ver-versions');
                }
        }
 
 }
 
+
 ?>
\ No newline at end of file
index a16b39f..7c485a4 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/ExtDirect/ExtDirectServer.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/ExtDirect/ExtDirectServer.php';
 ?>
\ No newline at end of file
index 5c2885e..4d07de4 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\ExtDirect;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -31,7 +33,7 @@
  * @package Workspaces
  * @subpackage ExtDirect
  */
-class Tx_Workspaces_ExtDirect_ToolbarMenu {
+class ToolbarMenu {
 
        /**
         * @param $parameter
@@ -51,11 +53,12 @@ class Tx_Workspaces_ExtDirect_ToolbarMenu {
                $workspaceId = intval($parameter->workSpaceId);
                $GLOBALS['BE_USER']->setWorkspace($workspaceId);
                return array(
-                       'title' => Tx_Workspaces_Service_Workspaces::getWorkspaceTitle($workspaceId),
+                       'title' => \TYPO3\CMS\Workspaces\Service\WorkspaceService::getWorkspaceTitle($workspaceId),
                        'id' => $workspaceId
                );
        }
 
 }
 
+
 ?>
\ No newline at end of file
index 8590d42..1313acb 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\ExtDirect;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -28,6 +30,7 @@
 if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
        require_once PATH_typo3 . 'interfaces/interface.backend_toolbaritem.php';
 }
+
 /**
  * class to render the workspace selector
  *
@@ -35,7 +38,7 @@ if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
  * @package Workspaces
  * @subpackage ExtDirect
  */
-class Tx_Workspaces_ExtDirect_WorkspaceSelectorToolbarItem implements backend_toolbarItem {
+class WorkspaceSelectorToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInterface {
 
        protected $changeWorkspace;
 
@@ -55,12 +58,12 @@ class Tx_Workspaces_ExtDirect_WorkspaceSelectorToolbarItem implements backend_to
         *
         * @param       TYPO3backend    TYPO3 backend object reference
         */
-       public function __construct(TYPO3backend &$backendReference = NULL) {
+       public function __construct(\TYPO3backend &$backendReference = NULL) {
                $this->backendReference = $backendReference;
-               $this->changeWorkspace = t3lib_div::_GP('changeWorkspace');
-               $this->changeWorkspacePreview = t3lib_div::_GP('changeWorkspacePreview');
-               $pageRenderer = t3lib_div::makeInstance('t3lib_pageRenderer');
-               $this->backendReference->addJavaScript(('TYPO3.Workspaces = { workspaceTitle : \'' . addslashes(Tx_Workspaces_Service_Workspaces::getWorkspaceTitle($GLOBALS['BE_USER']->workspace))) . '\'};
+               $this->changeWorkspace = \t3lib_div::_GP('changeWorkspace');
+               $this->changeWorkspacePreview = \t3lib_div::_GP('changeWorkspacePreview');
+               $pageRenderer = \t3lib_div::makeInstance('t3lib_pageRenderer');
+               $this->backendReference->addJavaScript(('TYPO3.Workspaces = { workspaceTitle : \'' . addslashes(\Tx_Workspaces_Service_Workspaces::getWorkspaceTitle($GLOBALS['BE_USER']->workspace))) . '\'};
 ');
        }
 
@@ -71,9 +74,9 @@ class Tx_Workspaces_ExtDirect_WorkspaceSelectorToolbarItem implements backend_to
         * @return boolean  TRUE if user has access, FALSE if not
         */
        public function checkAccess() {
-               if (t3lib_extMgm::isLoaded('workspaces')) {
+               if (\t3lib_extMgm::isLoaded('workspaces')) {
                        if ($this->checkAccess == NULL) {
-                               $availableWorkspaces = Tx_Workspaces_Service_Workspaces::getAvailableWorkspaces();
+                               $availableWorkspaces = \Tx_Workspaces_Service_Workspaces::getAvailableWorkspaces();
                                if (count($availableWorkspaces) > 0) {
                                        $this->checkAccess = TRUE;
                                } else {
@@ -93,13 +96,13 @@ class Tx_Workspaces_ExtDirect_WorkspaceSelectorToolbarItem implements backend_to
        public function render() {
                $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.workspace', TRUE);
                $this->addJavascriptToBackend();
-               $availableWorkspaces = Tx_Workspaces_Service_Workspaces::getAvailableWorkspaces();
+               $availableWorkspaces = \Tx_Workspaces_Service_Workspaces::getAvailableWorkspaces();
                $workspaceMenu = array();
-               $stateCheckedIcon = t3lib_iconWorks::getSpriteIcon('status-status-checked');
-               $stateUncheckedIcon = t3lib_iconWorks::getSpriteIcon('empty-empty', array(
+               $stateCheckedIcon = \t3lib_iconWorks::getSpriteIcon('status-status-checked');
+               $stateUncheckedIcon = \t3lib_iconWorks::getSpriteIcon('empty-empty', array(
                        'title' => $GLOBALS['LANG']->getLL('bookmark_inactive')
                ));
-               $workspaceMenu[] = ('<a href="#" class="toolbar-item">' . t3lib_iconWorks::getSpriteIcon('apps-toolbar-menu-workspace', array('title' => $title))) . '</a>';
+               $workspaceMenu[] = ('<a href="#" class="toolbar-item">' . \t3lib_iconWorks::getSpriteIcon('apps-toolbar-menu-workspace', array('title' => $title))) . '</a>';
                $workspaceMenu[] = '<ul class="toolbar-item-menu" style="display: none;">';
                if (count($availableWorkspaces)) {
                        foreach ($availableWorkspaces as $workspaceId => $label) {
@@ -128,7 +131,7 @@ class Tx_Workspaces_ExtDirect_WorkspaceSelectorToolbarItem implements backend_to
         * @return      void
         */
        protected function addJavascriptToBackend() {
-               $this->backendReference->addJavascriptFile(t3lib_extMgm::extRelPath('workspaces') . 'Resources/Public/JavaScript/workspacemenu.js');
+               $this->backendReference->addJavascriptFile(\t3lib_extMgm::extRelPath('workspaces') . 'Resources/Public/JavaScript/workspacemenu.js');
        }
 
        /**
@@ -142,7 +145,8 @@ class Tx_Workspaces_ExtDirect_WorkspaceSelectorToolbarItem implements backend_to
 
 }
 
+
 if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX)) {
-       $GLOBALS['TYPO3backend']->addToolbarItem('workSpaceSelector', 'Tx_Workspaces_ExtDirect_WorkspaceSelectorToolbarItem');
+       $GLOBALS['TYPO3backend']->addToolbarItem('workSpaceSelector', 'TYPO3\\CMS\\Workspaces\\ExtDirect\\WorkspaceSelectorToolbarItem');
 }
 ?>
\ No newline at end of file
index 25036e8..bd09b30 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Hook;
+
 /***************************************************************
  *  Copyright notice
  *
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_Befunc implements t3lib_Singleton {
+class BackendUtilityHook implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * Gets a singleton instance of this object.
         *
-        * @return Tx_Workspaces_Service_Befunc
+        * @return \TYPO3\CMS\Workspaces\Hook\BackendUtilityHook
         */
        static public function getInstance() {
-               return t3lib_div::makeInstance('Tx_Workspaces_Service_Befunc');
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Hook\\BackendUtilityHook');
        }
 
        /**
@@ -71,17 +73,17 @@ class Tx_Workspaces_Service_Befunc implements t3lib_Singleton {
         * @deprecated since TYPO3 4.6 - use Tx_Workspaces_Service_Workspaces::getLivePageUid() instead
         */
        protected function getLivePageUid($uid) {
-               t3lib_div::deprecationLog(__METHOD__ . ' is deprected since TYPO3 4.6 - use Tx_Workspaces_Service_Workspaces::getLivePageUid() instead');
+               \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog(__METHOD__ . ' is deprected since TYPO3 4.6 - use TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService::getLivePageUid() instead');
                return $this->getWorkspaceService()->getLivePageUid($uid);
        }
 
        /**
         * Gets an instance of the workspaces service.
         *
-        * @return Tx_Workspaces_Service_Workspaces
+        * @return \TYPO3\CMS\Workspaces\Service\WorkspaceService
         */
        protected function getWorkspaceService() {
-               return t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
        }
 
        /**
@@ -94,14 +96,14 @@ class Tx_Workspaces_Service_Befunc implements t3lib_Singleton {
         */
        public function makeEditForm_accessCheck($params, &$form) {
                if ($GLOBALS['BE_USER']->workspace !== 0 && $GLOBALS['TCA'][$params['table']]['ctrl']['versioningWS']) {
-                       $record = t3lib_BEfunc::getRecordWSOL($params['table'], $params['uid']);
-                       if (abs($record['t3ver_stage']) > Tx_Workspaces_Service_Stages::STAGE_EDIT_ID) {
-                               $stages = t3lib_div::makeInstance('Tx_Workspaces_Service_Stages');
+                       $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');
                                $stageName = $stages->getStageTitle($record['t3ver_stage']);
-                               $editingName = $stages->getStageTitle(Tx_Workspaces_Service_Stages::STAGE_EDIT_ID);
+                               $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 = t3lib_div::makeInstance('t3lib_FlashMessage', sprintf($message, $stageName, $editingName), '', t3lib_FlashMessage::INFO, TRUE);
-                               t3lib_FlashMessageQueue::addMessage($flashMessage);
+                               $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($message, $stageName, $editingName), '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO, TRUE);
+                               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::addMessage($flashMessage);
                        }
                }
                return $params['hasAccess'];
@@ -109,4 +111,5 @@ class Tx_Workspaces_Service_Befunc implements t3lib_Singleton {
 
 }
 
+
 ?>
\ No newline at end of file
index e3bd06d..ea9ecde 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Hook;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -31,7 +33,7 @@
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_Tcemain {
+class DataHandlerHook {
 
        /**
         * In case a sys_workspace_stage record is deleted we do a hard reset
@@ -42,14 +44,14 @@ class Tx_Workspaces_Service_Tcemain {
         * @param string $table
         * @param string $id
         * @param string $value
-        * @param t3lib_TCEmain $tcemain
+        * @param \TYPO3\CMS\Core\DataHandler\DataHandler $tcemain
         * @return void
         */
-       public function processCmdmap_postProcess($command, $table, $id, $value, t3lib_TCEmain $tcemain) {
+       public function processCmdmap_postProcess($command, $table, $id, $value, \TYPO3\CMS\Core\DataHandler\DataHandler $tcemain) {
                if ($command === 'delete') {
-                       if ($table === Tx_Workspaces_Service_Stages::TABLE_STAGE) {
+                       if ($table === \TYPO3\CMS\Workspaces\Service\StagesService::TABLE_STAGE) {
                                $this->resetStageOfElements($id);
-                       } elseif ($table === Tx_Workspaces_Service_Workspaces::TABLE_WORKSPACE) {
+                       } elseif ($table === \TYPO3\CMS\Workspaces\Service\WorkspaceService::TABLE_WORKSPACE) {
                                $this->flushWorkspaceElements($id);
                        }
                }
@@ -59,10 +61,10 @@ class Tx_Workspaces_Service_Tcemain {
         * hook that is called AFTER all commands of the commandmap was
         * executed
         *
-        * @param t3lib_TCEmain $tcemainObj reference to the main tcemain object
+        * @param \TYPO3\CMS\Core\DataHandler\DataHandler $tcemainObj reference to the main tcemain object
         * @return      void
         */
-       public function processCmdmap_afterFinish(t3lib_TCEmain $tcemainObj) {
+       public function processCmdmap_afterFinish(\TYPO3\CMS\Core\DataHandler\DataHandler $tcemainObj) {
                $this->flushWorkspaceCacheEntriesByWorkspaceId($tcemainObj->BE_USER->workspace);
        }
 
@@ -75,12 +77,12 @@ class Tx_Workspaces_Service_Tcemain {
         * @return void
         */
        protected function resetStageOfElements($stageId) {
-               $fields = array('t3ver_stage' => Tx_Workspaces_Service_Stages::STAGE_EDIT_ID);
+               $fields = array('t3ver_stage' => \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_EDIT_ID);
                foreach ($this->getTcaTables() as $tcaTable) {
-                       if (t3lib_BEfunc::isTableWorkspaceEnabled($tcaTable)) {
+                       if (\TYPO3\CMS\Backend\Utility\BackendUtility::isTableWorkspaceEnabled($tcaTable)) {
                                $where = 't3ver_stage = ' . intval($stageId);
                                $where .= ' AND t3ver_wsid > 0 AND pid=-1';
-                               $where .= t3lib_BEfunc::deleteClause($tcaTable);
+                               $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($tcaTable);
                                $GLOBALS['TYPO3_DB']->exec_UPDATEquery($tcaTable, $where, $fields);
                        }
                }
@@ -95,10 +97,10 @@ class Tx_Workspaces_Service_Tcemain {
        protected function flushWorkspaceElements($workspaceId) {
                $command = array();
                foreach ($this->getTcaTables() as $tcaTable) {
-                       if (t3lib_BEfunc::isTableWorkspaceEnabled($tcaTable)) {
+                       if (\TYPO3\CMS\Backend\Utility\BackendUtility::isTableWorkspaceEnabled($tcaTable)) {
                                $where = '1=1';
-                               $where .= t3lib_BEfunc::getWorkspaceWhereClause($tcaTable, $workspaceId);
-                               $where .= t3lib_BEfunc::deleteClause($tcaTable);
+                               $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::getWorkspaceWhereClause($tcaTable, $workspaceId);
+                               $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($tcaTable);
                                $records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', $tcaTable, $where, '', '', '', 'uid');
                                if (is_array($records)) {
                                        foreach (array_keys($records) as $recordId) {
@@ -126,10 +128,10 @@ class Tx_Workspaces_Service_Tcemain {
        /**
         * Gets a new instance of t3lib_TCEmain.
         *
-        * @return t3lib_TCEmain
+        * @return \TYPO3\CMS\Core\DataHandler\DataHandler
         */
        protected function getTceMain() {
-               $tceMain = t3lib_div::makeInstance('t3lib_TCEmain');
+               $tceMain = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandler\\DataHandler');
                $tceMain->stripslashes_values = 0;
                return $tceMain;
        }
@@ -143,9 +145,10 @@ class Tx_Workspaces_Service_Tcemain {
        protected function flushWorkspaceCacheEntriesByWorkspaceId($workspaceId) {
                $workspacesCache = $GLOBALS['typo3CacheManager']->getCache('workspaces_cache');
                $workspacesCache->flushByTag($workspaceId);
-               $workspacesCache->flushByTag(Tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES);
+               $workspacesCache->flushByTag(\TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES);
        }
 
 }
 
+
 ?>
\ No newline at end of file
index 36c8ccc..1139079 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Hook;
+
 /***************************************************************
  *  Copyright notice
  *
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_Fehooks {
+class TypoScriptFrontendControllerHook {
 
        /**
         * @param array $params
-        * @param tslib_fe $pObj
+        * @param \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $pObj
         * @return mixed
         */
        public function hook_eofe($params, $pObj) {
@@ -54,4 +56,5 @@ class Tx_Workspaces_Service_Fehooks {
 
 }
 
+
 ?>
\ No newline at end of file
index f68b441..d7d2189 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Service/AutoPublishService.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Service/AutoPublishService.php';
 ?>
\ No newline at end of file
index 335978f..bbcdc56 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Service;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -28,7 +30,7 @@
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_AutoPublish {
+class AutoPublishService {
 
        /**
         * This method is called by the Scheduler task that triggers
@@ -48,8 +50,8 @@ class Tx_Workspaces_Service_AutoPublish {
                $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,swap_modes,publish_time,unpublish_time', 'sys_workspace', (((('pid=0
                                AND
                                ((publish_time!=0 AND publish_time<=' . intval($GLOBALS['EXEC_TIME'])) . ')
-                               OR (publish_time=0 AND unpublish_time!=0 AND unpublish_time<=') . intval($GLOBALS['EXEC_TIME'])) . '))') . t3lib_BEfunc::deleteClause('sys_workspace'));
-               $workspaceService = t3lib_div::makeInstance('Tx_Workspaces_Service_Workspaces');
+                               OR (publish_time=0 AND unpublish_time!=0 AND unpublish_time<=') . intval($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:
                        $fieldArray = $rec['publish_time'] != 0 ? array('publish_time' => 0) : array('unpublish_time' => 0);
@@ -58,7 +60,7 @@ class Tx_Workspaces_Service_AutoPublish {
                        $cmd = $workspaceService->getCmdArrayForPublishWS($rec['uid'], $rec['swap_modes'] == 1);
                        // $rec['swap_modes']==1 means that auto-publishing will swap versions, not just publish and empty the workspace.
                        // Execute CMD array:
-                       $tce = t3lib_div::makeInstance('t3lib_TCEmain');
+                       $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandler\\DataHandler');
                        $tce->stripslashes_values = 0;
                        $tce->start(array(), $cmd);
                        $tce->process_cmdmap();
@@ -69,4 +71,5 @@ class Tx_Workspaces_Service_AutoPublish {
 
 }
 
+
 ?>
\ No newline at end of file
index a8f301a..871023d 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Task/AutoPublishTask.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Task/AutoPublishTask.php';
 ?>
\ No newline at end of file
index befad37..5d3c5cd 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Hook/BackendUtilityHook.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Hook/BackendUtilityHook.php';
 ?>
\ No newline at end of file
index c4adf15..86e6f48 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Task/CleanupPreviewLinkTask.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Task/CleanupPreviewLinkTask.php';
 ?>
\ No newline at end of file
index 270b7d4..3fbef46 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Hook/TypoScriptFrontendControllerHook.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Hook/TypoScriptFrontendControllerHook.php';
 ?>
\ No newline at end of file
index 3d6fd7c..5ced665 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Service/GridDataService.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Service/GridDataService.php';
 ?>
\ No newline at end of file
index 598b7a3..df60996 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Service;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -31,7 +33,7 @@
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_GridData {
+class GridDataService {
 
        const SIGNAL_GenerateDataArray_BeforeCaching = 'generateDataArray.beforeCaching';
        const SIGNAL_GenerateDataArray_PostProcesss = 'generateDataArray.postProcess';
@@ -66,7 +68,7 @@ class Tx_Workspaces_Service_GridData {
        protected $sortDir = '';
 
        /**
-        * @var t3lib_cache_frontend_Frontend
+        * @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
         */
        protected $workspacesCache = NULL;
 
@@ -76,7 +78,7 @@ class Tx_Workspaces_Service_GridData {
        protected $systemLanguages;
 
        /**
-        * @var Tx_Workspaces_Service_Integrity
+        * @var \TYPO3\CMS\Workspaces\Service\IntegrityService
         */
        protected $integrityService;
 
@@ -99,7 +101,7 @@ class Tx_Workspaces_Service_GridData {
                if (is_int($currentWorkspace)) {
                        $this->currentWorkspace = $currentWorkspace;
                } else {
-                       throw new InvalidArgumentException('No such workspace defined');
+                       throw new \InvalidArgumentException('No such workspace defined');
                }
                $data = array();
                $data['data'] = array();
@@ -118,20 +120,20 @@ class Tx_Workspaces_Service_GridData {
         */
        protected function generateDataArray(array $versions, $filterTxt) {
                $workspaceAccess = $GLOBALS['BE_USER']->checkWorkspace($GLOBALS['BE_USER']->workspace);
-               $swapStage = $workspaceAccess['publish_access'] & 1 ? Tx_Workspaces_Service_Stages::STAGE_PUBLISH_ID : 0;
+               $swapStage = $workspaceAccess['publish_access'] & 1 ? \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_ID : 0;
                $swapAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace) && $GLOBALS['BE_USER']->workspaceSwapAccess();
                $this->initializeWorkspacesCachingFramework();
                // check for dataArray in cache
                if ($this->getDataArrayFromCache($versions, $filterTxt) === FALSE) {
-                       /** @var $stagesObj Tx_Workspaces_Service_Stages */
-                       $stagesObj = t3lib_div::makeInstance('Tx_Workspaces_Service_Stages');
+                       /** @var $stagesObj \TYPO3\CMS\Workspaces\Service\StagesService */
+                       $stagesObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
                        foreach ($versions as $table => $records) {
                                $versionArray = array('table' => $table);
                                $isRecordTypeAllowedToModify = $GLOBALS['BE_USER']->check('tables_modify', $table);
                                foreach ($records as $record) {
-                                       $origRecord = t3lib_BEFunc::getRecord($table, $record['t3ver_oid']);
-                                       $versionRecord = t3lib_BEFunc::getRecord($table, $record['uid']);
-                                       $combinedRecord = Tx_Workspaces_Domain_Model_CombinedRecord::createFromArrays($table, $origRecord, $versionRecord);
+                                       $origRecord = \t3lib_BEFunc::getRecord($table, $record['t3ver_oid']);
+                                       $versionRecord = \t3lib_BEFunc::getRecord($table, $record['uid']);
+                                       $combinedRecord = \TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord::createFromArrays($table, $origRecord, $versionRecord);
                                        $this->getIntegrityService()->checkElement($combinedRecord);
                                        if (isset($GLOBALS['TCA'][$table]['columns']['hidden'])) {
                                                $recordState = $this->workspaceState($versionRecord['t3ver_state'], $origRecord['hidden'], $versionRecord['hidden']);
@@ -139,31 +141,31 @@ class Tx_Workspaces_Service_GridData {
                                                $recordState = $this->workspaceState($versionRecord['t3ver_state']);
                                        }
                                        $isDeletedPage = $table == 'pages' && $recordState == 'deleted';
-                                       $viewUrl = Tx_Workspaces_Service_Workspaces::viewSingleRecord($table, $record['t3ver_oid'], $origRecord);
+                                       $viewUrl = \TYPO3\CMS\Workspaces\Service\WorkspaceService::viewSingleRecord($table, $record['t3ver_oid'], $origRecord);
                                        $versionArray['id'] = ($table . ':') . $record['uid'];
                                        $versionArray['uid'] = $record['uid'];
                                        $versionArray['workspace'] = $versionRecord['t3ver_id'];
-                                       $versionArray['label_Workspace'] = htmlspecialchars(t3lib_befunc::getRecordTitle($table, $versionRecord));
-                                       $versionArray['label_Live'] = htmlspecialchars(t3lib_befunc::getRecordTitle($table, $origRecord));
+                                       $versionArray['label_Workspace'] = htmlspecialchars(\t3lib_befunc::getRecordTitle($table, $versionRecord));
+                                       $versionArray['label_Live'] = htmlspecialchars(\t3lib_befunc::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(t3lib_BEfunc::getRecordPath($record['livepid'], '', 999));
-                                       $versionArray['path_Workspace'] = htmlspecialchars(t3lib_BEfunc::getRecordPath($record['wspid'], '', 999));
-                                       $versionArray['workspace_Title'] = htmlspecialchars(Tx_Workspaces_Service_Workspaces::getWorkspaceTitle($versionRecord['t3ver_wsid']));
+                                       $versionArray['path_Live'] = htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath($record['livepid'], '', 999));
+                                       $versionArray['path_Workspace'] = htmlspecialchars(\TYPO3\CMS\Backend\Utility\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'] = t3lib_BEfunc::datetime($versionRecord['tstamp']);
+                                       $versionArray['workspace_Formated_Tstamp'] = \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($versionRecord['tstamp']);
                                        $versionArray['t3ver_oid'] = $record['t3ver_oid'];
                                        $versionArray['livepid'] = $record['livepid'];
                                        $versionArray['stage'] = $versionRecord['t3ver_stage'];
-                                       $versionArray['icon_Live'] = t3lib_iconWorks::mapRecordTypeToSpriteIconClass($table, $origRecord);
-                                       $versionArray['icon_Workspace'] = t3lib_iconWorks::mapRecordTypeToSpriteIconClass($table, $versionRecord);
+                                       $versionArray['icon_Live'] = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($table, $origRecord);
+                                       $versionArray['icon_Workspace'] = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($table, $versionRecord);
                                        $languageValue = $this->getLanguageValue($table, $versionRecord);
-                                       $versionArray['languageValue'] = $languageValue;
-                                       $versionArray['language'] = array(
-                                               'cls' => t3lib_iconWorks::getSpriteIconClasses($this->getSystemLanguageValue($languageValue, 'flagIcon')),
+                                       $versionArray['TYPO3\\CMS\\Lang\\LanguageServiceValue'] = $languageValue;
+                                       $versionArray['TYPO3\\CMS\\Lang\\LanguageService'] = array(
+                                               'cls' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses($this->getSystemLanguageValue($languageValue, 'flagIcon')),
                                                'title' => htmlspecialchars($this->getSystemLanguageValue($languageValue, 'title'))
                                        );
                                        $versionArray['allowedAction_nextStage'] = $isRecordTypeAllowedToModify && $stagesObj->isNextStageAllowedForUser($versionRecord['t3ver_stage']);
@@ -321,7 +323,7 @@ class Tx_Workspaces_Service_GridData {
                                break;
                        }
                } else {
-                       t3lib_div::sysLog(('Try to sort "' . $this->sort) . '" in "Tx_Workspaces_Service_GridData::sortDataArray" but $this->dataArray is empty! This might be the Bug #26422 which could not reproduced yet.', 3);
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::sysLog(('Try to sort "' . $this->sort) . '" in "TYPO3\\CMS\\Workspaces\\Service\\GridDataService::sortDataArray" but $this->dataArray is empty! This might be the Bug #26422 which could not reproduced yet.', 3);
                }
                // Suggested slot method:
                // methodName(Tx_Workspaces_Service_GridData $gridData, array &$dataArray, $sortColumn, $sortDirection)
@@ -459,7 +461,7 @@ class Tx_Workspaces_Service_GridData {
         */
        protected function getLanguageValue($table, array $record) {
                $languageValue = 0;
-               if (t3lib_BEfunc::isTableLocalizable($table)) {
+               if (\TYPO3\CMS\Backend\Utility\BackendUtility::isTableLocalizable($table)) {
                        $languageField = $GLOBALS['TCA'][$table]['ctrl']['languageField'];
                        if (!empty($record[$languageField])) {
                                $languageValue = $record[$languageField];
@@ -493,8 +495,8 @@ class Tx_Workspaces_Service_GridData {
         */
        public function getSystemLanguages() {
                if (!isset($this->systemLanguages)) {
-                       /** @var $translateTools t3lib_transl8tools */
-                       $translateTools = t3lib_div::makeInstance('t3lib_transl8tools');
+                       /** @var $translateTools \TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider */
+                       $translateTools = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Configuration\\TranslationConfigurationProvider');
                        $this->systemLanguages = $translateTools->getSystemLanguages();
                }
                return $this->systemLanguages;
@@ -503,11 +505,11 @@ class Tx_Workspaces_Service_GridData {
        /**
         * Gets an instance of the integrity service.
         *
-        * @return Tx_Workspaces_Service_Integrity
+        * @return \TYPO3\CMS\Workspaces\Service\IntegrityService
         */
        protected function getIntegrityService() {
                if (!isset($this->integrityService)) {
-                       $this->integrityService = t3lib_div::makeInstance('Tx_Workspaces_Service_Integrity');
+                       $this->integrityService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\IntegrityService');
                }
                return $this->integrityService;
        }
@@ -521,23 +523,24 @@ class Tx_Workspaces_Service_GridData {
        protected function emitSignal($signalName) {
                // Arguments are always ($this, [method argument], [method argument], ...)
                $signalArguments = array_merge(array($this), array_slice(func_get_args(), 1));
-               $this->getSignalSlotDispatcher()->dispatch('Tx_Workspaces_Service_GridData', $signalName, $signalArguments);
+               $this->getSignalSlotDispatcher()->dispatch('TYPO3\\CMS\\Workspaces\\Service\\GridDataService', $signalName, $signalArguments);
        }
 
        /**
-        * @return Tx_Extbase_SignalSlot_Dispatcher
+        * @return \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
         */
        protected function getSignalSlotDispatcher() {
-               return $this->getObjectManager()->get('Tx_Extbase_SignalSlot_Dispatcher');
+               return $this->getObjectManager()->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
        }
 
        /**
-        * @return Tx_Extbase_Object_ObjectManager
+        * @return \TYPO3\CMS\Extbase\Object\ObjectManager
         */
        protected function getObjectManager() {
-               return t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
        }
 
 }
 
+
 ?>
\ No newline at end of file
index e819e57..b8770b9 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Service/HistoryService.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Service/HistoryService.php';
 ?>
\ No newline at end of file
index 970322a..5f1fa51 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Service;
+
 /***************************************************************
  * Copyright notice
  *
@@ -29,7 +31,7 @@
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_History implements t3lib_Singleton {
+class HistoryService implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var array
@@ -42,7 +44,7 @@ class Tx_Workspaces_Service_History implements t3lib_Singleton {
        protected $historyObjects = array();
 
        /**
-        * @var t3lib_diff
+        * @var \TYPO3\CMS\Core\Utility\DiffUtility
         */
        protected $differencesObject;
 
@@ -51,7 +53,7 @@ class Tx_Workspaces_Service_History implements t3lib_Singleton {
         */
        public function __construct() {
                require_once PATH_typo3 . 'class.show_rechis.inc';
-               $this->backendUserNames = t3lib_BEfunc::getUserNames();
+               $this->backendUserNames = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
        }
 
        /**
@@ -88,7 +90,7 @@ class Tx_Workspaces_Service_History implements t3lib_Singleton {
                        $differences = implode('<br/>', $this->getDifferences($entry));
                }
                return array(
-                       'datetime' => htmlspecialchars(t3lib_BEfunc::datetime($entry['tstamp'])),
+                       'datetime' => htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::datetime($entry['tstamp'])),
                        'user' => htmlspecialchars($this->getUserName($entry['user'])),
                        'differences' => $differences
                );
@@ -107,10 +109,10 @@ class Tx_Workspaces_Service_History implements t3lib_Singleton {
                if (is_array($entry['newRecord'])) {
                        $fields = array_keys($entry['newRecord']);
                        foreach ($fields as $field) {
-                               t3lib_div::loadTCA($tableName);
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($tableName);
                                if (!empty($GLOBALS['TCA'][$tableName]['columns'][$field]['config']['type']) && $GLOBALS['TCA'][$tableName]['columns'][$field]['config']['type'] !== 'passthrough') {
                                        // Create diff-result:
-                                       $fieldDifferences = $this->getDifferencesObject()->makeDiffDisplay(t3lib_BEfunc::getProcessedValue($tableName, $field, $entry['oldRecord'][$field], 0, TRUE), t3lib_BEfunc::getProcessedValue($tableName, $field, $entry['newRecord'][$field], 0, TRUE));
+                                       $fieldDifferences = $this->getDifferencesObject()->makeDiffDisplay(\TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($tableName, $field, $entry['oldRecord'][$field], 0, TRUE), \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($tableName, $field, $entry['newRecord'][$field], 0, TRUE));
                                        $differences[] = nl2br($fieldDifferences);
                                }
                        }
@@ -137,12 +139,12 @@ class Tx_Workspaces_Service_History implements t3lib_Singleton {
         *
         * @param string $table Name of the table
         * @param integer $id Uid of the record
-        * @return recordHistory
+        * @return \TYPO3\CMS\Backend\History\RecordHistory
         */
        protected function getHistoryObject($table, $id) {
                if (!isset($this->historyObjects[$table][$id])) {
-                       /** @var $historyObject recordHistory */
-                       $historyObject = t3lib_div::makeInstance('recordHistory');
+                       /** @var $historyObject \TYPO3\CMS\Backend\History\RecordHistory */
+                       $historyObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\History\\RecordHistory');
                        $historyObject->element = ($table . ':') . $id;
                        $historyObject->createChangeLog();
                        $this->historyObjects[$table][$id] = $historyObject;
@@ -153,15 +155,16 @@ class Tx_Workspaces_Service_History implements t3lib_Singleton {
        /**
         * Gets an instance of the record differences utility.
         *
-        * @return t3lib_diff
+        * @return \TYPO3\CMS\Core\Utility\DiffUtility
         */
        protected function getDifferencesObject() {
                if (!isset($this->differencesObject)) {
-                       $this->differencesObject = t3lib_div::makeInstance('t3lib_diff');
+                       $this->differencesObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\DiffUtility');
                }
                return $this->differencesObject;
        }
 
 }
 
+
 ?>
\ No newline at end of file
index 5c70dc0..5097075 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Service/IntegrityService.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Service/IntegrityService.php';
 ?>
\ No newline at end of file
index ce0b2e8..2404430 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Service;
+
 /***************************************************************
  * Copyright notice
  *
@@ -29,7 +31,7 @@
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_Integrity {
+class IntegrityService {
 
        /**
         * Succes status - everything is fine
@@ -110,10 +112,10 @@ class Tx_Workspaces_Service_Integrity {
        /**
         * Checks a single element.
         *
-        * @param Tx_Workspaces_Domain_Model_CombinedRecord $element
+        * @param \TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord $element
         * @return void
         */
-       public function checkElement(Tx_Workspaces_Domain_Model_CombinedRecord $element) {
+       public function checkElement(\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord $element) {
                $this->checkLocalization($element);
        }
 
@@ -123,26 +125,26 @@ class Tx_Workspaces_Service_Integrity {
         * is new in this workspace (has only a placeholder record in live),
         * then boths (localization and localization parent) should be published.
         *
-        * @param Tx_Workspaces_Domain_Model_CombinedRecord $element
+        * @param \TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord $element
         * @return void
         */
-       protected function checkLocalization(Tx_Workspaces_Domain_Model_CombinedRecord $element) {
+       protected function checkLocalization(\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord $element) {
                $table = $element->getTable();
-               if (t3lib_BEfunc::isTableLocalizable($table)) {
+               if (\TYPO3\CMS\Backend\Utility\BackendUtility::isTableLocalizable($table)) {
                        $languageField = $GLOBALS['TCA'][$table]['ctrl']['languageField'];
                        $languageParentField = $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'];
                        $versionRow = $element->getVersionRecord()->getRow();
                        // If element is a localization:
                        if ($versionRow[$languageField] > 0) {
                                // Get localization parent from live workspace:
-                               $languageParentRecord = t3lib_BEfunc::getRecord($table, $versionRow[$languageParentField], 'uid,t3ver_state');
+                               $languageParentRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, $versionRow[$languageParentField], 'uid,t3ver_state');
                                // If localization parent is a "new placeholder" record:
                                if ($languageParentRecord['t3ver_state'] == 1) {
-                                       $title = t3lib_BEfunc::getRecordTitle($table, $versionRow);
+                                       $title = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle($table, $versionRow);
                                        // Add warning for current versionized record:
-                                       $this->addIssue($element->getLiveRecord()->getIdentifier(), self::STATUS_Warning, sprintf(Tx_Extbase_Utility_Localization::translate('integrity.dependsOnDefaultLanguageRecord', 'workspaces'), $title));
+                                       $this->addIssue($element->getLiveRecord()->getIdentifier(), self::STATUS_Warning, sprintf(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('integrity.dependsOnDefaultLanguageRecord', 'workspaces'), $title));
                                        // Add info for related localization parent record:
-                                       $this->addIssue(($table . ':') . $languageParentRecord['uid'], self::STATUS_Info, sprintf(Tx_Extbase_Utility_Localization::translate('integrity.isDefaultLanguageRecord', 'workspaces'), $title));
+                                       $this->addIssue(($table . ':') . $languageParentRecord['uid'], self::STATUS_Info, sprintf(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('integrity.isDefaultLanguageRecord', 'workspaces'), $title));
                                }
                        }
                }
@@ -247,4 +249,5 @@ class Tx_Workspaces_Service_Integrity {
 
 }
 
+
 ?>
\ No newline at end of file
index d81d379..6906ec0 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Service/StagesService.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Service/StagesService.php';
 ?>
\ No newline at end of file
index 88814a5..37c72ab 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Service;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -31,7 +33,7 @@
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_Stages {
+class StagesService {
 
        const TABLE_STAGE = 'sys_workspace_stage';
        // if a record is in the "ready to publish" stage STAGE_PUBLISH_ID the nextStage is STAGE_PUBLISH_EXECUTE_ID, this id wont be saved at any time in db
@@ -116,7 +118,7 @@ class Tx_Workspaces_Service_Stages {
         * @return array Current and next highest possible stage
         * @author Michael Klapper <development@morphodo.com>
         */
-       public function getPreviousStageForElementCollection($workspaceItems, array $byTableName = array('tt_content', 'pages', 'pages_language_overlay')) {
+       public function getPreviousStageForElementCollection($workspaceItems, array $byTableName = array('tt_content', 'pages', 'sys_language_overlay')) {
                $currentStage = array();
                $previousStage = array();
                $usedStages = array();
@@ -162,7 +164,7 @@ class Tx_Workspaces_Service_Stages {
         * @return array Current and next possible stage.
         * @author Michael Klapper <development@morphodo.com>
         */
-       public function getNextStageForElementCollection($workspaceItems, array $byTableName = array('tt_content', 'pages', 'pages_language_overlay')) {
+       public function getNextStageForElementCollection($workspaceItems, array $byTableName = array('tt_content', 'pages', 'sys_language_overlay')) {
                $currentStage = array();
                $usedStages = array();
                $nextStage = array();
@@ -214,7 +216,7 @@ class Tx_Workspaces_Service_Stages {
                                'uid' => self::STAGE_EDIT_ID,
                                'title' => (($GLOBALS['LANG']->sL(($this->pathToLocallang . ':actionSendToStage')) . ' "') . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_user_ws.xml:stage_editing')) . '"'
                        );
-                       $workspaceRec = t3lib_BEfunc::getRecord('sys_workspace', $this->getWorkspaceId());
+                       $workspaceRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('sys_workspace', $this->getWorkspaceId());
                        if ($workspaceRec['custom_stages'] > 0) {
                                // Get all stage records for this workspace
                                $workspaceStageRecs = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', self::TABLE_STAGE, ((('parentid=' . $this->getWorkspaceId()) . ' AND parenttable=') . $GLOBALS['TYPO3_DB']->fullQuoteStr('sys_workspace', self::TABLE_STAGE)) . ' AND deleted=0', '', 'sorting', '', 'uid');
@@ -280,7 +282,7 @@ class Tx_Workspaces_Service_Stages {
         * @return bool TRUE or FALSE
         */
        public function checkCustomStagingForWS() {
-               $workspaceRec = t3lib_BEfunc::getRecord('sys_workspace', $this->getWorkspaceId());
+               $workspaceRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('sys_workspace', $this->getWorkspaceId());
                return $workspaceRec['custom_stages'] > 0;
        }
 
@@ -320,7 +322,7 @@ class Tx_Workspaces_Service_Stages {
         * @return array
         */
        public function getStageRecord($stageid) {
-               return t3lib_BEfunc::getRecord('sys_workspace_stage', $stageid);
+               return \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('sys_workspace_stage', $stageid);
        }
 
        /**
@@ -330,8 +332,8 @@ class Tx_Workspaces_Service_Stages {
         * @return integer The next stage Id
         */
        public function getNextStage($stageId) {
-               if (!t3lib_utility_Math::canBeInterpretedAsInteger($stageId)) {
-                       throw new InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:error.stageId.integer'), 1291109987);
+               if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($stageId)) {
+                       throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:error.stageId.integer'), 1291109987);
                }
                $nextStage = FALSE;
                $workspaceStageRecs = $this->getStagesForWS();
@@ -397,8 +399,8 @@ class Tx_Workspaces_Service_Stages {
         * @return int                  id
         */
        public function getPrevStage($stageid) {
-               if (!t3lib_utility_Math::canBeInterpretedAsInteger($stageid)) {
-                       throw new InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:error.stageId.integer'));
+               if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($stageid)) {
+                       throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:error.stageId.integer'));
                }
                $prevStage = FALSE;
                $workspaceStageRecs = $this->getStagesForWS();
@@ -452,7 +454,7 @@ class Tx_Workspaces_Service_Stages {
         * @return      array be_users with e-mail and name
         */
        public function getResponsibleBeUser($stageId, $selectDefaultUserField = FALSE) {
-               $workspaceRec = t3lib_BEfunc::getRecord('sys_workspace', $this->getWorkspaceId());
+               $workspaceRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('sys_workspace', $this->getWorkspaceId());
                $recipientArray = array();
                switch ($stageId) {
                case self::STAGE_PUBLISH_EXECUTE_ID:
@@ -484,7 +486,7 @@ class Tx_Workspaces_Service_Stages {
                        break;
                }
                if (!empty($userList)) {
-                       $userRecords = t3lib_BEfunc::getUserNames('username, uid, email, realName', ('AND uid IN (' . $userList) . ')');
+                       $userRecords = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames('username, uid, email, realName', ('AND uid IN (' . $userList) . ')');
                }
                if (!empty($userRecords) && is_array($userRecords)) {
                        foreach ($userRecords as $userUid => $userRecord) {
@@ -502,7 +504,7 @@ class Tx_Workspaces_Service_Stages {
         */
        public function getResponsibleUser($stageRespValue) {
                $stageValuesArray = array();
-               $stageValuesArray = t3lib_div::trimExplode(',', $stageRespValue);
+               $stageValuesArray = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $stageRespValue);
                $beuserUidArray = array();
                $begroupUidArray = array();
                $allBeUserArray = array();
@@ -518,13 +520,13 @@ class Tx_Workspaces_Service_Stages {
                        }
                }
                if (!empty($begroupUidArray)) {
-                       $allBeUserArray = t3lib_befunc::getUserNames();
+                       $allBeUserArray = \t3lib_befunc::getUserNames();
                        $begroupUidList = implode(',', $begroupUidArray);
                        $this->userGroups = array();
                        $begroupUidArray = $this->fetchGroups($begroupUidList);
                        foreach ($begroupUidArray as $groupkey => $groupData) {
                                foreach ($allBeUserArray as $useruid => $userdata) {
-                                       if (t3lib_div::inList($userdata['usergroup_cached_list'], $groupData['uid'])) {
+                                       if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($userdata['usergroup_cached_list'], $groupData['uid'])) {
                                                $beuserUidArray[] = $useruid;
                                        }
                                }
@@ -576,7 +578,7 @@ class Tx_Workspaces_Service_Stages {
         * @return array
         */
        private function fetchGroupsRecursive($grList, $idList = '') {
-               $requiredGroups = t3lib_div::intExplode(',', $grList, TRUE);
+               $requiredGroups = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $grList, TRUE);
                $existingGroups = array_keys($this->userGroups);
                $missingGroups = array_diff($requiredGroups, $existingGroups);
                if (count($missingGroups) > 0) {
@@ -587,14 +589,14 @@ class Tx_Workspaces_Service_Stages {
                        // traversing list
                        // Get row:
                        $row = $this->userGroups[$uid];
-                       if (is_array($row) && !t3lib_div::inList($idList, $uid)) {
+                       if (is_array($row) && !\TYPO3\CMS\Core\Utility\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(',', t3lib_div::intExplode(',', $row['subgroup']));
+                                               $theList = implode(',', \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $row['subgroup']));
                                                // Get the subarray
                                                $subbarray = $this->fetchGroups($theList, ($idList . ',') . $uid);
                                                list($subUid, $subArray) = each($subbarray);
@@ -616,10 +618,10 @@ class Tx_Workspaces_Service_Stages {
         */
        public function getPropertyOfCurrentWorkspaceStage($stageId, $property) {
                $result = NULL;
-               if (!t3lib_utility_Math::canBeInterpretedAsInteger($stageId)) {
-                       throw new InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:error.stageId.integer'));
+               if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($stageId)) {
+                       throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:error.stageId.integer'));
                }
-               $workspaceStage = t3lib_BEfunc::getRecord(self::TABLE_STAGE, $stageId);
+               $workspaceStage = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord(self::TABLE_STAGE, $stageId);
                if (is_array($workspaceStage) && isset($workspaceStage[$property])) {
                        $result = $workspaceStage[$property];
                }
@@ -671,7 +673,7 @@ class Tx_Workspaces_Service_Stages {
                                // if the current stage is allowed for the user, the user is also allowed to send to prev
                                $isAllowed = $this->isStageAllowedForUser($stageId);
                        }
-               } catch (Exception $e) {
+               } catch (\Exception $e) {
 
                }
                return $isAllowed;
@@ -693,7 +695,7 @@ class Tx_Workspaces_Service_Stages {
                                // if the current stage is allowed for the user, the user is also allowed to send to next
                                $isAllowed = $this->isStageAllowedForUser($stageId);
                        }
-               } catch (Exception $e) {
+               } catch (\Exception $e) {
 
                }
                return $isAllowed;
@@ -745,22 +747,22 @@ class Tx_Workspaces_Service_Stages {
         * @return integer
         */
        public function getNotificationMode($stageId) {
-               if (!t3lib_utility_Math::canBeInterpretedAsInteger($stageId)) {
-                       throw new InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:error.stageId.integer'));
+               if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($stageId)) {
+                       throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:error.stageId.integer'));
                }
                switch ($stageId) {
                case self::STAGE_PUBLISH_EXECUTE_ID:
 
                case self::STAGE_PUBLISH_ID:
-                       $workspaceRecord = t3lib_BEfunc::getRecord('sys_workspace', $this->getWorkspaceId());
+                       $workspaceRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('sys_workspace', $this->getWorkspaceId());
                        return $workspaceRecord['publish_notification_mode'];
                        break;
                case self::STAGE_EDIT_ID:
-                       $workspaceRecord = t3lib_BEfunc::getRecord('sys_workspace', $this->getWorkspaceId());
+                       $workspaceRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('sys_workspace', $this->getWorkspaceId());
                        return $workspaceRecord['edit_notification_mode'];
                        break;
                default:
-                       $workspaceStage = t3lib_BEfunc::getRecord(self::TABLE_STAGE, $stageId);
+                       $workspaceStage = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord(self::TABLE_STAGE, $stageId);
                        if (is_array($workspaceStage) && isset($workspaceStage['notification_mode'])) {
                                return $workspaceStage['notification_mode'];
                        }
@@ -770,4 +772,5 @@ class Tx_Workspaces_Service_Stages {
 
 }
 
+
 ?>
\ No newline at end of file
index 03c6498..710e98f 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Hook/DataHandlerHook.php';
 ?>
\ No newline at end of file
index c6e2414..5c68986 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Service;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -31,7 +33,7 @@
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
+class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var array
@@ -54,7 +56,7 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                        $availableWorkspaces[self::LIVE_WORKSPACE_ID] = self::getWorkspaceTitle(self::LIVE_WORKSPACE_ID);
                }
                // add custom workspaces (selecting all, filtering by BE_USER check):
-               $customWorkspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid, title, adminusers, members', 'sys_workspace', 'pid = 0' . t3lib_BEfunc::deleteClause('sys_workspace'), '', 'title');
+               $customWorkspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid, title, adminusers, members', 'sys_workspace', 'pid = 0' . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_workspace'), '', 'title');
                if (count($customWorkspaces)) {
                        foreach ($customWorkspaces as $workspace) {
                                if ($GLOBALS['BE_USER']->checkWorkspace($workspace)) {
@@ -93,13 +95,13 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                        break;
                default:
                        $labelField = $GLOBALS['TCA']['sys_workspace']['ctrl']['label'];
-                       $wsRecord = t3lib_beFunc::getRecord('sys_workspace', $wsId, 'uid,' . $labelField);
+                       $wsRecord = \t3lib_beFunc::getRecord('sys_workspace', $wsId, 'uid,' . $labelField);
                        if (is_array($wsRecord)) {
                                $title = $wsRecord[$labelField];
                        }
                }
                if ($title === FALSE) {
-                       throw new InvalidArgumentException('No such workspace defined');
+                       throw new \InvalidArgumentException('No such workspace defined');
                }
                return $title;
        }
@@ -120,9 +122,9 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                        // Define stage to select:
                        $stage = -99;
                        if ($wsid > 0) {
-                               $workspaceRec = t3lib_BEfunc::getRecord('sys_workspace', $wsid);
+                               $workspaceRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('sys_workspace', $wsid);
                                if ($workspaceRec['publish_access'] & 1) {
-                                       $stage = Tx_Workspaces_Service_Stages::STAGE_PUBLISH_ID;
+                                       $stage = \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_ID;
                                }
                        }
                        // Select all versions to swap:
@@ -235,7 +237,7 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
         * @return array
         */
        protected function selectAllVersionsFromPages($table, $pageList, $wsid, $filter, $stage, $language = NULL) {
-               $isTableLocalizable = t3lib_BEfunc::isTableLocalizable($table);
+               $isTableLocalizable = \TYPO3\CMS\Backend\Utility\BackendUtility::isTableLocalizable($table);
                $languageParentField = '';
                // If table is not localizable, but localized reocrds shall
                // be collected, an empty result array needs to be returned:
@@ -256,7 +258,7 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                        $pidConstraint = strstr($pageList, ',') ? (' IN (' . $pageList) . ')' : '=' . $pageList;
                        $where .= (' AND B.' . $pidField) . $pidConstraint;
                }
-               if ($isTableLocalizable && t3lib_utility_Math::canBeInterpretedAsInteger($language)) {
+               if ($isTableLocalizable && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($language)) {
                        $where .= ((' AND A.' . $GLOBALS['TCA'][$table]['ctrl']['languageField']) . '=') . $language;
                }
                /** For "real" workspace numbers, select by that.
@@ -280,8 +282,8 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                $where .= ' AND B.pid>=0';
                // ... and finally the join between the two tables.
                $where .= ' AND A.t3ver_oid=B.uid';
-               $where .= t3lib_BEfunc::deleteClause($table, 'A');
-               $where .= t3lib_BEfunc::deleteClause($table, 'B');
+               $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table, 'A');
+               $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table, 'B');
                /** Select all records from this table in the database from the workspace
                This joins the online version with the offline version as tables A and B
                Order by UID, mostly to have a sorting in the backend overview module which doesn't "jump around" when swapping. */
@@ -327,9 +329,9 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                        $where .= (' AND ' . $pidField) . $pidConstraint;
                }
                $where .= ' AND A.t3ver_move_id = B.uid AND B.uid = C.t3ver_oid';
-               $where .= t3lib_BEfunc::deleteClause($table, 'A');
-               $where .= t3lib_BEfunc::deleteClause($table, 'B');
-               $where .= t3lib_BEfunc::deleteClause($table, 'C');
+               $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table, 'A');
+               $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table, 'B');
+               $where .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($table, 'C');
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $from, $where, '', 'A.uid');
                return is_array($res) ? $res : array();
        }
@@ -346,8 +348,8 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                /** Reusing existing functionality with the drawback that
                mount points are not covered yet */
                $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
-               /** @var $searchObj t3lib_fullsearch */
-               $searchObj = t3lib_div::makeInstance('t3lib_fullsearch');
+               /** @var $searchObj \TYPO3\CMS\Core\Database\QueryView */
+               $searchObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryView');
                if ($pageId > 0) {
                        $pageList = $searchObj->getTreeList($pageId, $recursionLevel, 0, $perms_clause);
                } else {
@@ -365,8 +367,8 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                unset($searchObj);
                if (intval($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=') . intval($wsid)) . t3lib_BEfunc::deleteClause('pages'), '', 'uid', '', 't3ver_move_id');
-                       $pageIds = t3lib_div::intExplode(',', $pageList, TRUE);
+                       $movedAwayPages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid, pid, t3ver_move_id', 'pages', ((('t3ver_move_id IN (' . $pageList) . ') AND t3ver_wsid=') . intval($wsid)) . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages'), '', 'uid', '', 't3ver_move_id');
+                       $pageIds = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $pageList, TRUE);
                        // move all pages away
                        $newList = array_diff($pageIds, array_keys($movedAwayPages));
                        // keep current page in the list
@@ -383,9 +385,9 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                        } while ($changed);
                        $pageList = implode(',', $newList);
                        // 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) . ')') . t3lib_BEfunc::deleteClause('pages'), '', 'uid', '', 'uid');
+                       $pages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid, t3ver_move_id', 'pages', (('uid IN (' . $pageList) . ')') . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages'), '', 'uid', '', 'uid');
                        $newList = array();
-                       $pageIds = t3lib_div::intExplode(',', $pageList, TRUE);
+                       $pageIds = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $pageList, TRUE);
                        if (!in_array($pageId, $pageIds)) {
                                $pageIds[] = $pageId;
                        }
@@ -413,7 +415,7 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                $permittedElements = array();
                if (is_array($recs)) {
                        foreach ($recs as $rec) {
-                               $page = t3lib_beFunc::getRecord('pages', $rec[$checkField], 'uid,pid,perms_userid,perms_user,perms_groupid,perms_group,perms_everybody');
+                               $page = \t3lib_beFunc::getRecord('pages', $rec[$checkField], 'uid,pid,perms_userid,perms_user,perms_groupid,perms_group,perms_everybody');
                                if ($GLOBALS['BE_USER']->doesUserHaveAccess($page, 1) && $this->isLanguageAccessibleForCurrentUser($table, $rec)) {
                                        $permittedElements[] = $rec;
                                }
@@ -431,7 +433,7 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
         */
        protected function isLanguageAccessibleForCurrentUser($table, array $record) {
                $languageUid = 0;
-               if (t3lib_BEfunc::isTableLocalizable($table)) {
+               if (\TYPO3\CMS\Backend\Utility\BackendUtility::isTableLocalizable($table)) {
                        $languageUid = $record[$GLOBALS['TCA'][$table]['ctrl']['languageField']];
                } else {
                        return TRUE;
@@ -473,15 +475,15 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                // If the language is not default, check state of overlay
                if ($language > 0) {
                        $whereClause = 'pid = ' . $id;
-                       $whereClause .= ((' AND ' . $GLOBALS['TCA']['pages_language_overlay']['ctrl']['languageField']) . ' = ') . $language;
+                       $whereClause .= ((' AND ' . $GLOBALS['TCA']['sys_language_overlay']['ctrl']['languageField']) . ' = ') . $language;
                        $whereClause .= ' AND t3ver_wsid = ' . $GLOBALS['BE_USER']->workspace;
-                       $whereClause .= t3lib_BEfunc::deleteClause('pages_language_overlay');
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('t3ver_state', 'pages_language_overlay', $whereClause);
+                       $whereClause .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('sys_language_overlay');
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('t3ver_state', 'sys_language_overlay', $whereClause);
                        if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                $isNewPage = (int) $row['t3ver_state'] === 1;
                        }
                } else {
-                       $rec = t3lib_BEfunc::getRecord('pages', $id, 't3ver_state');
+                       $rec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $id, 't3ver_state');
                        if (is_array($rec)) {
                                $isNewPage = (int) $rec['t3ver_state'] === 1;
                        }
@@ -501,16 +503,16 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
        static public function viewSingleRecord($table, $uid, $record = NULL) {
                $viewUrl = '';
                if ($table == 'pages') {
-                       $viewUrl = t3lib_BEfunc::viewOnClick(t3lib_BEfunc::getLiveVersionIdOfRecord('pages', $uid));
-               } elseif ($table == 'pages_language_overlay' || $table == 'tt_content') {
-                       $elementRecord = is_array($record) ? $record : t3lib_BEfunc::getLiveVersionOfRecord($table, $uid);
-                       $viewUrl = t3lib_BEfunc::viewOnClick($elementRecord['pid']);
+                       $viewUrl = \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick(\TYPO3\CMS\Backend\Utility\BackendUtility::getLiveVersionIdOfRecord('pages', $uid));
+               } elseif ($table == 'sys_language_overlay' || $table == 'tt_content') {
+                       $elementRecord = is_array($record) ? $record : \TYPO3\CMS\Backend\Utility\BackendUtility::getLiveVersionOfRecord($table, $uid);
+                       $viewUrl = \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($elementRecord['pid']);
                } else {
                        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['viewSingleRecord'])) {
                                $_params = array('table' => $table, 'uid' => $uid, 'record' => $record);
                                $_funcRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['viewSingleRecord'];
                                $null = NULL;
-                               $viewUrl = t3lib_div::callUserFunction($_funcRef, $_params, $null);
+                               $viewUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($_funcRef, $_params, $null);
                        }
                }
                return $viewUrl;
@@ -526,9 +528,9 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
        public function canCreatePreviewLink($pageUid, $workspaceUid) {
                $result = TRUE;
                if ($pageUid > 0 && $workspaceUid > 0) {
-                       $pageRecord = t3lib_BEfunc::getRecord('pages', $pageUid);
-                       t3lib_BEfunc::workspaceOL('pages', $pageRecord, $workspaceUid);
-                       if (!t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'], $pageRecord['doktype'])) {
+                       $pageRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $pageUid);
+                       \TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL('pages', $pageRecord, $workspaceUid);
+                       if (!\TYPO3\CMS\Core\Utility\GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'], $pageRecord['doktype'])) {
                                $result = FALSE;
                        }
                } else {
@@ -544,14 +546,14 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
         * @return string the full domain including the protocol http:// or https://, but without the trailing '/'
         */
        public function generateWorkspacePreviewLink($uid) {
-               $previewObject = t3lib_div::makeInstance('Tx_Version_Preview');
+               $previewObject = \TYPO3\CMS\Core\Utility\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 (t3lib_BEfunc::getViewDomain($uid) . '/index.php?') . t3lib_div::implodeArrayForUrl('', $linkParams);
+               return (\TYPO3\CMS\Backend\Utility\BackendUtility::getViewDomain($uid) . '/index.php?') . \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $linkParams);
        }
 
        /**
@@ -566,9 +568,9 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                if ($uid > 0) {
                        $uid = $this->getLivePageUid($uid);
                }
-               $objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
-               /** @var $uriBuilder Tx_Extbase_MVC_Web_Routing_UriBuilder */
-               $uriBuilder = $objectManager->create('Tx_Extbase_MVC_Web_Routing_UriBuilder');
+               $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+               /** @var $uriBuilder \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder */
+               $uriBuilder = $objectManager->create('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
                /** This seems to be very harsh to set this directly to "/typo3 but the viewOnClick also
                has /index.php as fixed value here and dealing with the backPath is very error-prone
 
@@ -577,9 +579,9 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
                $redirect = $backPath . 'index.php?redirect_url=';
                // @todo why do we need these additional params? the URIBuilder should add the controller, but he doesn't :(
                $additionalParams = '&tx_workspaces_web_workspacesworkspaces%5Bcontroller%5D=Preview&M=web_WorkspacesWorkspaces&id=';
-               $viewScript = ($backPath . $uriBuilder->setArguments(array('tx_workspaces_web_workspacesworkspaces' => array('previewWS' => $GLOBALS['BE_USER']->workspace)))->uriFor('index', array(), 'Tx_Workspaces_Controller_PreviewController', 'workspaces', 'web_workspacesworkspaces')) . $additionalParams;
+               $viewScript = ($backPath . $uriBuilder->setArguments(array('tx_workspaces_web_workspacesworkspaces' => array('previewWS' => $GLOBALS['BE_USER']->workspace)))->uriFor('index', array(), 'TYPO3\\CMS\\Workspaces\\Controller\\PreviewController', 'workspaces', 'web_workspacesworkspaces')) . $additionalParams;
                if ($addDomain === TRUE) {
-                       return ((t3lib_BEfunc::getViewDomain($uid) . $redirect) . urlencode($viewScript)) . $uid;
+                       return ((\TYPO3\CMS\Backend\Utility\BackendUtility::getViewDomain($uid) . $redirect) . urlencode($viewScript)) . $uid;
                } else {
                        return $viewScript;
                }
@@ -595,11 +597,11 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
         */
        public function getLivePageUid($uid) {
                if (!isset($this->pageCache[$uid])) {
-                       $pageRecord = t3lib_beFunc::getRecord('pages', $uid);
+                       $pageRecord = \t3lib_beFunc::getRecord('pages', $uid);
                        if (is_array($pageRecord)) {
                                $this->pageCache[$uid] = $pageRecord['t3ver_oid'] ? $pageRecord['t3ver_oid'] : $uid;
                        } else {
-                               throw new InvalidArgumentException('uid is supposed to point to an existing page - given value was:' . $uid, 1290628113);
+                               throw new \InvalidArgumentException('uid is supposed to point to an existing page - given value was:' . $uid, 1290628113);
                        }
                }
                return $this->pageCache[$uid];
@@ -607,4 +609,5 @@ class Tx_Workspaces_Service_Workspaces implements t3lib_Singleton {
 
 }
 
+
 ?>
\ No newline at end of file
index 2397dbc..e3eab94 100644 (file)
@@ -4,4 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/workspaces/Classes/Service/WorkspaceService.php
  */
+require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces') . 'Classes/Service/WorkspaceService.php';
 ?>
\ No newline at end of file
index 89cd89b..616be96 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Task;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -29,7 +31,7 @@
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_AutoPublishTask extends tx_scheduler_Task {
+class AutoPublishTask extends \TYPO3\CMS\Scheduler\Task {
 
        /**
         * Method executed from the Scheduler.
@@ -39,7 +41,7 @@ class Tx_Workspaces_Service_AutoPublishTask extends tx_scheduler_Task {
         * @return      boolean
         */
        public function execute() {
-               $autopubObj = t3lib_div::makeInstance('Tx_Workspaces_Service_AutoPublish');
+               $autopubObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\AutoPublishService');
                // Publish the workspaces that need to be
                $autopubObj->autoPublishWorkspaces();
                // There's no feedback from the publishing process,
@@ -50,4 +52,5 @@ class Tx_Workspaces_Service_AutoPublishTask extends tx_scheduler_Task {
 
 }
 
+
 ?>
\ No newline at end of file
index bd3e500..1f79b45 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Workspaces\Task;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -28,7 +30,7 @@
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_CleanupPreviewLinkTask extends tx_scheduler_Task {
+class CleanupPreviewLinkTask extends \TYPO3\CMS\Scheduler\Task {
 
        /**
         * Cleanup old preview links.
@@ -43,4 +45,5 @@ class Tx_Workspaces_Service_CleanupPreviewLinkTask extends tx_scheduler_Task {
 
 }
 
+
 ?>
\ No newline at end of file
index 7dc9b9a..13376b4 100644 (file)
@@ -1,30 +1,31 @@
 <?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2010-2011 Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
+namespace TYPO3\CMS\Workspaces\Service;
 
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010-2011 Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
 /**
  * Workspace service test
  *
  * @package Workspaces
  * @subpackage Service
  */
-class Tx_Workspaces_Service_WorkspacesTest extends tx_phpunit_database_testcase {
+class WorkspacesServiceTest extends tx_phpunit_database_testcase {
+
        /**
-        *
+
         */
        public function setUp() {
                $GLOBALS['BE_USER']->user['admin'] = 1;
@@ -45,7 +47,7 @@ class Tx_Workspaces_Service_WorkspacesTest extends tx_phpunit_database_testcase
        }
 
        /**
-        *
+
         */
        public function tearDown() {
                $this->cleanDatabase();
@@ -53,14 +55,12 @@ class Tx_Workspaces_Service_WorkspacesTest extends tx_phpunit_database_testcase
                $GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db);
        }
 
-
        /**
         * @test
-        **/
+        */
        public function emptyWorkspaceReturnsEmptyArray() {
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
-
-               $service = new Tx_Workspaces_Service_Workspaces();
+               $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();
                $result = $service->selectVersionsInWorkspace(90);
                $this->assertTrue(empty($result), 'The workspace 90 contains no changes and the result was supposed to be empty');
                $this->assertTrue(is_array($result), 'Even the empty result from workspace 90 is supposed to be an array');
@@ -68,12 +68,11 @@ class Tx_Workspaces_Service_WorkspacesTest extends tx_phpunit_database_testcase
 
        /**
         * @test
-        **/
+        */
        public function versionsFromSpecificWorkspaceCanBeFound() {
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultPages.xml');
-
-               $service = new Tx_Workspaces_Service_Workspaces();
+               $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();
                $result = $service->selectVersionsInWorkspace(91, 0, -99, 2);
                $this->assertTrue(is_array($result), 'The result from workspace 91 is supposed to be an array');
                $this->assertEquals(1, sizeof($result['pages']), 'The result is supposed to contain one version for this page in workspace 91');
@@ -83,25 +82,23 @@ class Tx_Workspaces_Service_WorkspacesTest extends tx_phpunit_database_testcase
 
        /**
         * @test
-        **/
+        */
        public function versionsFromAllWorkspaceCanBeFound() {
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultPages.xml');
-
-               $service = new Tx_Workspaces_Service_Workspaces();
-               $result = $service->selectVersionsInWorkspace(Tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES, 0, -99, 2);
+               $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();
+               $result = $service->selectVersionsInWorkspace(\TYPO3\CMS\Workspaces\Service\WorkspaceService::SELECT_ALL_WORKSPACES, 0, -99, 2);
                $this->assertTrue(is_array($result), 'The result from workspace 91 is supposed to be an array');
                $this->assertEquals(2, sizeof($result['pages']), 'The result is supposed to contain one version for this page in workspace 91');
        }
 
        /**
         * @test
-        **/
+        */
        public function versionsCanBeFoundRecursive() {
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultPages.xml');
-
-               $service = new Tx_Workspaces_Service_Workspaces();
+               $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();
                $result = $service->selectVersionsInWorkspace(91, 0, -99, 1, 99);
                $this->assertTrue(is_array($result), 'The result from workspace 91 is supposed to be an array');
                $this->assertEquals(4, sizeof($result['pages']), 'The result is supposed to contain four versions for this page in workspace 91');
@@ -109,21 +106,18 @@ class Tx_Workspaces_Service_WorkspacesTest extends tx_phpunit_database_testcase
 
        /**
         * @test
-        **/
+        */
        public function versionsCanBeFilteredToSpecificStage() {
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultPages.xml');
-
-               $service = new Tx_Workspaces_Service_Workspaces();
-
-                       // testing stage 1
+               $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();
+               // testing stage 1
                $result = $service->selectVersionsInWorkspace(91, 0, 1, 1, 99);
                $this->assertTrue(is_array($result), 'The result from workspace 91 is supposed to be an array');
                $this->assertEquals(2, sizeof($result['pages']), 'The result is supposed to contain two versions for this page in workspace 91');
                $this->assertEquals(102, $result['pages'][0]['uid'], 'First records is supposed to have the uid 102');
                $this->assertEquals(105, $result['pages'][1]['uid'], 'First records is supposed to have the uid 105');
-
-                       // testing stage 2
+               // testing stage 2
                $result = $service->selectVersionsInWorkspace(91, 0, 2, 1, 99);
                $this->assertTrue(is_array($result), 'The result from workspace 91 is supposed to be an array');
                $this->assertEquals(2, sizeof($result['pages']), 'The result is supposed to contain two versions for this page in workspace 91');
@@ -133,23 +127,19 @@ class Tx_Workspaces_Service_WorkspacesTest extends tx_phpunit_database_testcase
 
        /**
         * @test
-        **/
+        */
        public function versionsCanBeFilteredToSpecificLifecycleStep() {
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultPages.xml');
-
-               $service = new Tx_Workspaces_Service_Workspaces();
-
-                       // testing all "draft" records
+               $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();
+               // testing all "draft" records
                $result = $service->selectVersionsInWorkspace(91, 1, -99, 1, 99);
                $this->assertTrue(is_array($result), 'The result from workspace 91 is supposed to be an array');
                $this->assertEquals(2, sizeof($result['pages']), 'The result is supposed to contain three versions for this page in workspace 91');
-
-                       // testing all "archive" records
+               // testing all "archive" records
                $result = $service->selectVersionsInWorkspace(91, 2, -99, 1, 99);
                $this->assertEquals(2, sizeof($result['pages']), 'The result is supposed to contain two versions for this page in workspace 91');
-
-                       // testing both types records
+               // testing both types records
                $result = $service->selectVersionsInWorkspace(91, 0, -99, 1, 99);
                $this->assertEquals(4, sizeof($result['pages']), 'The result is supposed to contain two versions for this page in workspace 91');
        }
@@ -159,28 +149,25 @@ class Tx_Workspaces_Service_WorkspacesTest extends tx_phpunit_database_testcase
         * branch of the tree - therefore we're not supposed to find anything here
         *
         * @test
-        **/
+        */
        public function movedElementsCanNotBeFoundAtTheirOrigin() {
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbMovedContent.xml');
-
-                       // Test if the placeholder can be found when we ask using recursion (same result)
-               $service = new Tx_Workspaces_Service_Workspaces();
+               // Test if the placeholder can be found when we ask using recursion (same result)
+               $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();
                $result = $service->selectVersionsInWorkspace(91, 0, -99, 2, 99);
-
                $this->assertEquals(0, sizeof($result['pages']), 'Changes should not show up in this branch of the tree within workspace 91');
                $this->assertEquals(0, sizeof($result['tt_content']), 'Changes should not show up in this branch of the tree within workspace 91');
        }
 
        /**
         * @test
-        **/
+        */
        public function movedElementsCanBeFoundAtTheirDestination() {
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbMovedContent.xml');
-
-                       // Test if the placeholder can be found when we ask using recursion (same result)
-               $service = new Tx_Workspaces_Service_Workspaces();
+               // Test if the placeholder can be found when we ask using recursion (same result)
+               $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();
                $result = $service->selectVersionsInWorkspace(91, 0, -99, 5, 99);
                $this->assertEquals(1, sizeof($result['pages']), 'Wrong amount of page versions found within workspace 91');
                $this->assertEquals(103, $result['pages'][0]['uid'], 'Wrong move-to pointer found for page 3 in workspace 91');
@@ -194,19 +181,18 @@ class Tx_Workspaces_Service_WorkspacesTest extends tx_phpunit_database_testcase
 
        /**
         * @test
-        **/
+        */
        public function movedElementsCanBeFoundUsingTheirLiveUID() {
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
                $this->importDataSet(dirname(__FILE__) . '/fixtures/dbMovedContent.xml');
-
-                       // Test if the placeholder can be found when we ask using recursion (same result)
-               $service = new Tx_Workspaces_Service_Workspaces();
+               // Test if the placeholder can be found when we ask using recursion (same result)
+               $service = new \TYPO3\CMS\Workspaces\Service\WorkspaceService();
                $result = $service->selectVersionsInWorkspace(91, 0, -99, 3, 99);
-
                $this->assertEquals(1, sizeof($result), 'Wrong amount of versions found within workspace 91');
                $this->assertEquals(1, sizeof($result['pages']), 'Wrong amount of page versions found within workspace 91');
                $this->assertEquals(103, $result['pages'][0]['uid'], 'Wrong move-to pointer found for page 3 in workspace 91');
        }
+
 }
 
 
index b480187..34b75c6 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 // DO NOT CHANGE THIS FILE! It is automatically generated by extdeveval::buildAutoloadRegistry.
 // This file was generated on 2010-11-11 21:58
-$extensionPath = t3lib_extMgm::extPath('workspaces');
+$extensionPath = \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces');
 return array(
        'tx_workspaces_controller_abstractcontroller' => $extensionPath . 'Classes/Controller/AbstractController.php',
        'tx_workspaces_controller_previewcontroller' => $extensionPath . 'Classes/Controller/PreviewController.php',
index 987bbcf..d348349 100644 (file)
@@ -3,33 +3,33 @@ if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
 if (TYPO3_MODE == 'BE') {
-       $workspaceSelectorToolbarItemClassPath = t3lib_extMgm::extPath('workspaces', 'Classes/ExtDirect/WorkspaceSelectorToolbarItem.php');
+       $workspaceSelectorToolbarItemClassPath = \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('workspaces', 'Classes/ExtDirect/WorkspaceSelectorToolbarItem.php');
        $GLOBALS['TYPO3_CONF_VARS']['typo3/backend.php']['additionalBackendItems'][] = $workspaceSelectorToolbarItemClassPath;
 }
 // Register the autopublishing task
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['Tx_Workspaces_Service_AutoPublishTask'] = array(
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Workspaces\\Service\\AutoPublishServiceTask'] = array(
        'extension' => $_EXTKEY,
        'title' => ('LLL:EXT:' . $_EXTKEY) . '/Resources/Private/Language/locallang_mod.xml:autopublishTask.name',
        'description' => ('LLL:EXT:' . $_EXTKEY) . '/Resources/Private/Language/locallang_mod.xml:autopublishTask.description'
 );
 // Register the cleanup preview links task
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['Tx_Workspaces_Service_CleanupPreviewLinkTask'] = array(
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Workspaces\\Task\\CleanupPreviewLinkTask'] = array(
        'extension' => $_EXTKEY,
        'title' => ('LLL:EXT:' . $_EXTKEY) . '/Resources/Private/Language/locallang_mod.xml:cleanupPreviewLinkTask.name',
        'description' => ('LLL:EXT:' . $_EXTKEY) . '/Resources/Private/Language/locallang_mod.xml:cleanupPreviewLinkTask.description'
 );
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['workspaces'] = 'EXT:workspaces/Classes/Service/Tcemain.php:Tx_Workspaces_Service_Tcemain';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass']['workspaces'] = 'EXT:workspaces/Classes/Service/Befunc.php:Tx_Workspaces_Service_Befunc';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['workspaces'] = 'EXT:workspaces/Classes/Service/Fehooks.php:Tx_Workspaces_Service_Fehooks->hook_eofe';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck']['workspaces'] = 'EXT:workspaces/Classes/Service/Befunc.php:Tx_Workspaces_Service_Befunc->makeEditForm_accessCheck';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['workspaces'] = 'EXT:workspaces/Classes/Service/Tcemain.php:TYPO3\\CMS\\Workspaces\\Hook\\DataHandlerHook';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass']['workspaces'] = 'EXT:workspaces/Classes/Service/Befunc.php:TYPO3\\CMS\\Workspaces\\Hook\\BackendUtilityHook';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['workspaces'] = 'EXT:workspaces/Classes/Service/Fehooks.php:TYPO3\\CMS\\Workspaces\\Hook\\TypoScriptFrontendControllerHook->hook_eofe';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck']['workspaces'] = 'EXT:workspaces/Classes/Service/Befunc.php:TYPO3\\CMS\\Workspaces\\Hook\\BackendUtilityHook->makeEditForm_accessCheck';
 // Register workspaces cache if not already done in localconf.php or a previously loaded extension.
-// We do not set frontend and backend: The cache manager uses t3lib_cache_frontend_VariableFrontend
+// We do not set frontend and backend: The cache manager uses t3lib_Cache\Frontend\VariableFrontend
 // as frontend and t3lib_cache_backend_DbBackend as backend by default if not set otherwise. This
 // is perfectly fine for the workspaces_cache.
 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['workspaces_cache'])) {
        $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['workspaces_cache'] = array();
 }
-t3lib_extMgm::addUserTSConfig('options.workspaces.considerReferences = 1');
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/tree/pagetree/class.t3lib_tree_pagetree_dataprovider.php']['postProcessCollections'][] = 'EXT:workspaces/Classes/ExtDirect/PagetreeCollectionsProcessor.php:Tx_Workspaces_ExtDirect_PagetreeCollectionsProcessor';
-t3lib_extMgm::addUserTSConfig('options.workspaces.considerReferences = 1');
+\TYPO3\CMS\Core\Extension\ExtensionManager::addUserTSConfig('options.workspaces.considerReferences = 1');
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/tree/pagetree/class.t3lib_tree_pagetree_dataprovider.php']['postProcessCollections'][] = 'EXT:workspaces/Classes/ExtDirect/PagetreeCollectionsProcessor.php:TYPO3\\CMS\\Workspaces\\ExtDirect\\PagetreeCollectionsProcessor';
+\TYPO3\CMS\Core\Extension\ExtensionManager::addUserTSConfig('options.workspaces.considerReferences = 1');
 ?>
\ No newline at end of file
index 1187001..4d375e7 100644 (file)
@@ -5,7 +5,7 @@ if (!defined('TYPO3_MODE')) {
 // avoid that this block is loaded in the frontend or within the upgrade-wizards
 if (TYPO3_MODE == 'BE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
        /** Registers a Backend Module */
-       Tx_Extbase_Utility_Extension::registerModule($_EXTKEY, 'web', 'workspaces', 'before:info', array(
+       \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule($_EXTKEY, 'web', 'workspaces', 'before:info', array(
                // An array holding the controller-action-combinations that are accessible
                'Review' => 'index,fullIndex,singleIndex',
                'Preview' => 'index,newPage'
@@ -16,10 +16,10 @@ if (TYPO3_MODE == 'BE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
                'navigationComponentId' => 'typo3-pagetree'
        ));
        // register ExtDirect
-       t3lib_extMgm::registerExtDirectComponent('TYPO3.Workspaces.ExtDirect', t3lib_extMgm::extPath($_EXTKEY) . 'Classes/ExtDirect/Server.php:Tx_Workspaces_ExtDirect_Server', 'web_WorkspacesWorkspaces', 'user,group');
-       t3lib_extMgm::registerExtDirectComponent('TYPO3.Workspaces.ExtDirectActions', t3lib_extMgm::extPath($_EXTKEY) . 'Classes/ExtDirect/ActionHandler.php:Tx_Workspaces_ExtDirect_ActionHandler', 'web_WorkspacesWorkspaces', 'user,group');
-       t3lib_extMgm::registerExtDirectComponent('TYPO3.Workspaces.ExtDirectMassActions', t3lib_extMgm::extPath($_EXTKEY) . 'Classes/ExtDirect/MassActionHandler.php:Tx_Workspaces_ExtDirect_MassActionHandler', 'web_WorkspacesWorkspaces', 'user,group');
-       t3lib_extMgm::registerExtDirectComponent('TYPO3.Ajax.ExtDirect.ToolbarMenu', t3lib_extMgm::extPath($_EXTKEY) . 'Classes/ExtDirect/ToolbarMenu.php:Tx_Workspaces_ExtDirect_ToolbarMenu');
+       \TYPO3\CMS\Core\Extension\ExtensionManager::registerExtDirectComponent('TYPO3.Workspaces.ExtDirect', \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) . 'Classes/ExtDirect/Server.php:TYPO3\\CMS\\Workspaces\\ExtDirect\\ExtDirectServer', 'web_WorkspacesWorkspaces', 'user,group');
+       \TYPO3\CMS\Core\Extension\ExtensionManager::registerExtDirectComponent('TYPO3.Workspaces.ExtDirectActions', \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) . 'Classes/ExtDirect/ActionHandler.php:TYPO3\\CMS\\Workspaces\\ExtDirect\\ActionHandler', 'web_WorkspacesWorkspaces', 'user,group');
+       \TYPO3\CMS\Core\Extension\ExtensionManager::registerExtDirectComponent('TYPO3.Workspaces.ExtDirectMassActions', \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) . 'Classes/ExtDirect/MassActionHandler.php:TYPO3\\CMS\\Workspaces\\ExtDirect\\MassActionHandler', 'web_WorkspacesWorkspaces', 'user,group');
+       \TYPO3\CMS\Core\Extension\ExtensionManager::registerExtDirectComponent('TYPO3.Ajax.ExtDirect.ToolbarMenu', \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) . 'Classes/ExtDirect/ToolbarMenu.php:TYPO3\\CMS\\Workspaces\\ExtDirect\\ToolbarMenu');
 }
 /**
  * Table "sys_workspace":
@@ -36,7 +36,7 @@ $TCA['sys_workspace'] = array(
                'typeicon_classes' => array(
                        'default' => 'mimetypes-x-sys_workspace'
                ),
-               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
+               'dynamicConfigFile' => \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) . 'tca.php',
                'versioningWS_alwaysAllowLiveEdit' => TRUE,
                'dividers2tabs' => TRUE
        )
@@ -60,17 +60,17 @@ $TCA['sys_workspace_stage'] = array(
                'typeicon_classes' => array(
                        'default' => 'mimetypes-x-sys_workspace'
                ),
-               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
+               'dynamicConfigFile' => \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) . 'tca.php',
                'versioningWS_alwaysAllowLiveEdit' => TRUE,
                'dividers2tabs' => TRUE
        )
 );
 // todo move icons to Core sprite or keep them here and remove the todo note ;)
 $icons = array(
-       'sendtonextstage' => t3lib_extMgm::extRelPath($_EXTKEY) . 'Resources/Public/Images/version-workspace-sendtonextstage.png',
-       'sendtoprevstage' => t3lib_extMgm::extRelPath($_EXTKEY) . 'Resources/Public/Images/version-workspace-sendtoprevstage.png',
-       'generatepreviewlink' => t3lib_extMgm::extRelPath($_EXTKEY) . 'Resources/Public/Images/generate-ws-preview-link.png'
+       'sendtonextstage' => \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath($_EXTKEY) . 'Resources/Public/Images/version-workspace-sendtonextstage.png',
+       'sendtoprevstage' => \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath($_EXTKEY) . 'Resources/Public/Images/version-workspace-sendtoprevstage.png',
+       'generatepreviewlink' => \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath($_EXTKEY) . 'Resources/Public/Images/generate-ws-preview-link.png'
 );
-t3lib_SpriteManager::addSingleIcons($icons, $_EXTKEY);
-t3lib_extMgm::addLLrefForTCAdescr('sys_workspace_stage', 'EXT:workspaces/Resources/Private/Language/locallang_csh_sysws_stage.xml');
+\TYPO3\CMS\Backend\Sprite\SpriteManager::addSingleIcons($icons, $_EXTKEY);
+\TYPO3\CMS\Core\Extension\ExtensionManager::addLLrefForTCAdescr('sys_workspace_stage', 'EXT:workspaces/Resources/Private/Language/locallang_csh_sysws_stage.xml');
 ?>
\ No newline at end of file