[TASK] Add unit tests for stdWrap_date()
[Packages/TYPO3.CMS.git] / typo3 / sysext / workspaces / ext_tables.php
index 7d710e0..af1dfda 100644 (file)
@@ -1,76 +1,55 @@
 <?php
-if (!defined('TYPO3_MODE')) {
-       die('Access denied.');
-}
+defined('TYPO3_MODE') or die();
+
 // avoid that this block is loaded in the frontend or within the upgrade-wizards
-if (TYPO3_MODE == 'BE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
+if (TYPO3_MODE === 'BE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
        /** Registers a Backend Module */
-       \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'
-       ), array(
-               'access' => 'user,group',
-               'icon' => 'EXT:workspaces/Resources/Public/Images/moduleicon.gif',
-               'labels' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod.xml',
-               'navigationComponentId' => 'typo3-pagetree'
-       ));
+       \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
+               'TYPO3.CMS.Workspaces',
+               'web',
+               'workspaces',
+               'before:info',
+               array(
+                       // An array holding the controller-action-combinations that are accessible
+                       'Review' => 'index,fullIndex,singleIndex',
+                       'Preview' => 'index,newPage'
+               ),
+               array(
+                       'access' => 'user,group',
+                       'icon' => 'EXT:workspaces/Resources/Public/Icons/module-workspaces.svg',
+                       'labels' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_mod.xlf',
+                       'navigationComponentId' => 'typo3-pagetree'
+               )
+       );
+
        // register ExtDirect
-       \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');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent(
+               'TYPO3.Workspaces.ExtDirect',
+               \TYPO3\CMS\Workspaces\ExtDirect\ExtDirectServer::class,
+               'web_WorkspacesWorkspaces',
+               'user,group'
+       );
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent(
+               'TYPO3.Workspaces.ExtDirectActions',
+               \TYPO3\CMS\Workspaces\ExtDirect\ActionHandler::class,
+               'web_WorkspacesWorkspaces',
+               'user,group'
+       );
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent(
+               'TYPO3.Workspaces.ExtDirectMassActions',
+               \TYPO3\CMS\Workspaces\ExtDirect\MassActionHandler::class,
+               'web_WorkspacesWorkspaces',
+               'user,group'
+       );
+
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('Workspaces::setWorkspace', \TYPO3\CMS\Workspaces\Controller\AjaxController::class . '->setWorkspace');
 }
-/**
- * Table "sys_workspace":
- */
-$TCA['sys_workspace'] = array(
-       'ctrl' => array(
-               'label' => 'title',
-               'tstamp' => 'tstamp',
-               'title' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace',
-               'adminOnly' => 1,
-               'rootLevel' => 1,
-               'delete' => 'deleted',
-               'iconfile' => 'sys_workspace.png',
-               'typeicon_classes' => array(
-                       'default' => 'mimetypes-x-sys_workspace'
-               ),
-               'dynamicConfigFile' => \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($_EXTKEY) . 'tca.php',
-               'versioningWS_alwaysAllowLiveEdit' => TRUE,
-               'dividers2tabs' => TRUE
-       )
-);
-/**
- * Table "sys_workspace_stage":
- * Defines single custom stages which are related to sys_workspace table to create complex working processes
- * This is only the 'header' part (ctrl). The full configuration is found in t3lib/stddb/tbl_be.php
- */
-$TCA['sys_workspace_stage'] = array(
-       'ctrl' => array(
-               'label' => 'title',
-               'tstamp' => 'tstamp',
-               'sortby' => 'sorting',
-               'title' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_db.xml:sys_workspace_stage',
-               'adminOnly' => 1,
-               'rootLevel' => 1,
-               'hideTable' => TRUE,
-               'delete' => 'deleted',
-               'iconfile' => 'sys_workspace.png',
-               'typeicon_classes' => array(
-                       'default' => 'mimetypes-x-sys_workspace'
-               ),
-               '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 ;)
+
+// @todo move icons to Core sprite or keep them here and remove the todo note ;)
 $icons = array(
-       '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'
+       'sendtonextstage' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/Images/version-workspace-sendtonextstage.png',
+       'sendtoprevstage' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/Images/version-workspace-sendtoprevstage.png',
+       'generatepreviewlink' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/Images/generate-ws-preview-link.png'
 );
-\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
+\TYPO3\CMS\Backend\Sprite\SpriteManager::addSingleIcons($icons, 'workspaces');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('sys_workspace_stage', 'EXT:workspaces/Resources/Private/Language/locallang_csh_sysws_stage.xlf');