[!!!][TASK] Make backend.php dispatched 44/41644/3
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 17 Jul 2015 23:37:12 +0000 (01:37 +0200)
committerAndreas Wolf <andreas.wolf@typo3.org>
Sat, 18 Jul 2015 07:30:30 +0000 (09:30 +0200)
Remove backed.php as well. It is unlikely one referenced backend.php
directly.

Resolves: #68325
Releases: master
Change-Id: Id1017450c052af917de07f0a3428861dbea5bfa9
Reviewed-on: http://review.typo3.org/41644
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
typo3/backend.php [deleted file]
typo3/sysext/backend/Classes/Controller/LoginController.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Modules/Main/conf.php [new file with mode: 0644]
typo3/sysext/backend/Modules/Main/index.php [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/backend.js
typo3/sysext/backend/ext_tables.php
typo3/sysext/beuser/Classes/Hook/SwitchBackUserHook.php
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/workspaces/Classes/Backend/ToolbarItems/WorkspaceSelectorToolbarItem.php
typo3/sysext/workspaces/Classes/Controller/PreviewController.php

diff --git a/typo3/backend.php b/typo3/backend.php
deleted file mode 100644 (file)
index 6b06878..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-call_user_func(function() {
-       $classLoader = require __DIR__ . '/vendor/autoload.php';
-       (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run(function() {
-               $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xlf');
-
-               // Document generation
-               $GLOBALS['TYPO3backend'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\BackendController::class);
-               $GLOBALS['TYPO3backend']->render();
-       });
-});
index 6a42e98..652bb1a 100644 (file)
@@ -41,7 +41,7 @@ class LoginController implements \TYPO3\CMS\Core\Http\ControllerInterface {
        protected $redirectUrl;
 
        /**
-        * Set to the redirect URL of the form (may be redirect_url or "backend.php")
+        * Set to the redirect URL of the form (may be redirect_url or "index.php?M=main")
         *
         * @var string
         */
@@ -109,8 +109,8 @@ class LoginController implements \TYPO3\CMS\Core\Http\ControllerInterface {
 
                $this->getLanguageService()->includeLLFile('EXT:lang/locallang_login.xlf');
 
-               // Setting the redirect URL to "backend.php" if no alternative input is given
-               $this->redirectToURL = $this->redirectUrl ?: 'backend.php';
+               // Setting the redirect URL to "index.php?M=main" if no alternative input is given
+               $this->redirectToURL = $this->redirectUrl ?: BackendUtility::getModuleUrl('main');
 
                // If "L" is "OUT", then any logged in is logged out. If redirect_url is given, we redirect to it
                if (GeneralUtility::_GP('L') === 'OUT' && is_object($this->getBackendUserAuthentication())) {
@@ -289,7 +289,7 @@ class LoginController implements \TYPO3\CMS\Core\Http\ControllerInterface {
                                        break;
                                case 'backend':
                                        $interface = 'backend';
-                                       $this->redirectToURL = 'backend.php';
+                                       $this->redirectToURL = BackendUtility::getModuleUrl('main');
                                        break;
                                default:
                                        $interface = '';
@@ -335,7 +335,7 @@ class LoginController implements \TYPO3\CMS\Core\Http\ControllerInterface {
                                $interfaces = array(
                                        'backend' => array(
                                                'label' => $this->getLanguageService()->getLL('interface.backend'),
-                                               'jumpScript' => 'backend.php',
+                                               'jumpScript' => BackendUtility::getModuleUrl('main'),
                                                'interface' => 'backend'
                                        ),
                                        'frontend' => array(
index 91bf188..8492747 100755 (executable)
@@ -4438,9 +4438,8 @@ class BackendUtility {
                                $script = '../.';
                                break;
                        case 'backend':
-
                        default:
-                               $script = 'backend.php';
+                               $script = self::getModuleUrl('main');
                }
                return $script;
        }
diff --git a/typo3/sysext/backend/Modules/Main/conf.php b/typo3/sysext/backend/Modules/Main/conf.php
new file mode 100644 (file)
index 0000000..8022f84
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+$MCONF['name'] = 'main';
+$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
diff --git a/typo3/sysext/backend/Modules/Main/index.php b/typo3/sysext/backend/Modules/Main/index.php
new file mode 100644 (file)
index 0000000..5951748
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xlf');
+
+// Document generation
+$GLOBALS['TYPO3backend'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
+       \TYPO3\CMS\Backend\Controller\BackendController::class
+);
+$GLOBALS['TYPO3backend']->render();
\ No newline at end of file
index d26f034..138cdf0 100644 (file)
@@ -68,7 +68,7 @@ function jump(url, modName, mainModName, pageId) {
 
 /**
  * shortcut manager to delegate the action of creating shortcuts to the new
- * backend.php shortcut menu or the old shortcut frame depending on what is available
+ * BackendUtility::getModuleUrl('main') shortcut menu or the old shortcut frame depending on what is available
  */
 var ShortcutManager = {
 
index dd50c7e..77209d2 100644 (file)
@@ -2,6 +2,12 @@
 defined('TYPO3_MODE') or die();
 
 if (TYPO3_MODE === 'BE') {
+       // Main module
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
+               'main',
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/Main/'
+       );
+
        // Register record edit module
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
                'record_edit',
index 2f00c39..2408167 100644 (file)
@@ -37,7 +37,7 @@ class SwitchBackUserHook {
                        $objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
                        $backendUserSessionRepository = $objectManager->get(\TYPO3\CMS\Beuser\Domain\Repository\BackendUserSessionRepository::class);
                        $backendUserSessionRepository->switchBackToOriginalUser($authentication);
-                       HttpUtility::redirect($GLOBALS['BACK_PATH'] . 'backend.php');
+                       HttpUtility::redirect(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('main'));
                }
        }
 
index c339428..36adeaf 100644 (file)
@@ -156,7 +156,7 @@ class SystemEnvironmentBuilder {
                // Absolute path of the entry script that was called
                // All paths are unified between Windows and Unix, so the \ of Windows is substituted to a /
                // Example "/var/www/instance-name/htdocs/typo3conf/ext/wec_map/mod1/index.php"
-               // Example "c:/var/www/instance-name/htdocs/typo3/backend.php" for a path in Windows
+               // Example "c:/var/www/instance-name/htdocs/typo3/index.php?M=main" for a path in Windows
                if (!defined('PATH_thisScript')) {
                        define('PATH_thisScript', self::getPathThisScript());
                }
index c7f3c8d..d77d6fc 100644 (file)
@@ -97,7 +97,7 @@ class WorkspaceSelectorToolbarItem implements ToolbarItemInterface {
                        $classValue = ($workspaceId === $activeWorkspace ? ' class="selected"' : '');
                        $sectionName = ($index++ === 0 ? 'top' : 'items');
                        $workspaceSections[$sectionName][] = '<li' . $classValue . '>'
-                               . '<a href="backend.php?changeWorkspace=' . $workspaceId . '" data-workspaceid="' . $workspaceId . '" class="dropdown-list-link tx-workspaces-switchlink">'
+                               . '<a href="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('main', array('changeWorkspace' => $workspaceId))) . '" data-workspaceid="' . $workspaceId . '" class="dropdown-list-link tx-workspaces-switchlink">'
                                . $iconState . ' ' . htmlspecialchars($label)
                                . '</a></li>';
                }
index f2eec66..06bddb7 100644 (file)
@@ -182,7 +182,7 @@ class PreviewController extends AbstractController {
        /**
         * Generates the JavaScript code for the backend,
         * and since we're loading a backend module outside of the actual backend
-        * this copies parts of the backend.php
+        * this copies parts of the index.php?M=main module
         *
         * @return string
         */