[TASK] Move ExtDirect component registration to EXT:backend 49/52649/2
authorBenni Mack <benni@typo3.org>
Fri, 28 Apr 2017 10:05:51 +0000 (12:05 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 2 May 2017 18:31:54 +0000 (20:31 +0200)
Although this functionality will be removed anyway as soon as possible,
moving this code to EXT:backend where it belongs cleans up the general
bootstrap class and separates the logic into the system extension that
is referenced.

Resolves: #81060
Releases: master
Change-Id: I1e1a4d2a791e17a52c8298e08299a3ee74ee37dc
Reviewed-on: https://review.typo3.org/52649
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/ext_localconf.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/ExtDirect/ExtDirectRouter.php

index 52191c9..106bc78 100644 (file)
@@ -42,3 +42,11 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch']['page'] = 'pages';
 // Include base TSconfig setup
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:backend/Configuration/TSconfig/Page/Mod/Wizards/NewContentElement.ts">');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:backend/Configuration/TSconfig/User/Options.ts">');
+
+// Register ExtDirect components
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']['TYPO3.Components.PageTree.DataProvider'] = [
+    'callbackClass' => \TYPO3\CMS\Backend\Tree\Pagetree\ExtdirectTreeDataProvider::class,
+];
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']['TYPO3.Components.PageTree.Commands'] = [
+    'callbackClass' => \TYPO3\CMS\Backend\Tree\Pagetree\ExtdirectTreeCommands::class,
+];
index f2f7180..132835b 100644 (file)
@@ -397,7 +397,6 @@ class Bootstrap
             ->initializePackageManagement($packageManagerClassName)
             ->initializeRuntimeActivatedPackagesFromConfiguration()
             ->defineUserAgentConstant()
-            ->registerExtDirectComponents()
             ->setCacheHashOptions()
             ->setDefaultTimezone()
             ->initializeL10nLocales()
@@ -524,28 +523,6 @@ class Bootstrap
     }
 
     /**
-     * Register default ExtDirect components
-     *
-     * @return Bootstrap
-     */
-    protected function registerExtDirectComponents()
-    {
-        if (TYPO3_MODE === 'BE') {
-            $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']['TYPO3.Components.PageTree.DataProvider'] = [
-                'callbackClass' => \TYPO3\CMS\Backend\Tree\Pagetree\ExtdirectTreeDataProvider::class,
-                'moduleName' => null,
-                'accessLevel' => null
-            ];
-            $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']['TYPO3.Components.PageTree.Commands'] = [
-                'callbackClass' => \TYPO3\CMS\Backend\Tree\Pagetree\ExtdirectTreeCommands::class,
-                'moduleName' => null,
-                'accessLevel' => null
-            ];
-        }
-        return $this;
-    }
-
-    /**
      * Initialize caching framework, and re-initializes it (e.g. in the install tool) by recreating the instances
      * again despite the Singleton instance
      *
index b4a49f3..7055d68 100644 (file)
@@ -130,7 +130,8 @@ class ExtDirectRouter
         }
         $callbackClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName]['callbackClass'];
         $configuration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect'][$endpointName];
-        if (!is_null($configuration['moduleName']) && !is_null($configuration['accessLevel'])) {
+        if (isset($configuration['moduleName']) && !is_null($configuration['moduleName'])
+            && isset($configuration['accessLevel']) && !is_null($configuration['accessLevel'])) {
             $GLOBALS['BE_USER']->modAccess([
                 'name' => $configuration['moduleName'],
                 'access' => $configuration['accessLevel']