[TASK] Add backend routes to configuration module 55/47055/2
authorFrank Naegler <frank.naegler@typo3.org>
Fri, 4 Mar 2016 12:57:04 +0000 (13:57 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 4 Mar 2016 14:42:28 +0000 (15:42 +0100)
This patch add the backend routes to the configuration module, to show all
current active backend routes.

Resolves: #74164
Releases: master, 7.6
Change-Id: I5c191d1d8dc8b002ea1a66a33b6628f7eec9994c
Reviewed-on: https://review.typo3.org/47055
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/lowlevel/Classes/View/ConfigurationView.php
typo3/sysext/lowlevel/Resources/Private/Language/locallang.xlf

index c9f3001..e1802eb 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Lowlevel\View;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Module\BaseScriptClass;
+use TYPO3\CMS\Backend\Routing\Router;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
@@ -113,7 +114,8 @@ class ConfigurationView extends BaseScriptClass
                 6 => LocalizationUtility::translate('tbemodulesext', 'lowlevel'),
                 7 => LocalizationUtility::translate('tbeStyles', 'lowlevel'),
                 8 => LocalizationUtility::translate('beUser', 'lowlevel'),
-                9 => LocalizationUtility::translate('usersettings', 'lowlevel')
+                9 => LocalizationUtility::translate('usersettings', 'lowlevel'),
+                10 => LocalizationUtility::translate('routes', 'lowlevel')
             ),
             'regexsearch' => '',
             'fixedLgd' => ''
@@ -191,6 +193,19 @@ class ConfigurationView extends BaseScriptClass
                 ArrayUtility::naturalKeySortRecursive($theVar);
                 $arrayBrowser->varName = '$TYPO3_USER_SETTINGS';
                 break;
+            case 10:
+                $router = GeneralUtility::makeInstance(Router::class);
+                $routes = $router->getRoutes();
+                $theVar = [];
+                foreach ($routes as $identifier => $route) {
+                    $theVar[$identifier] = [
+                        'path' => $route->getPath(),
+                        'options' => $route->getOptions()
+                    ];
+                }
+                ArrayUtility::naturalKeySortRecursive($theVar);
+                $arrayBrowser->varName = 'BackendRoutes';
+                break;
             default:
                 $theVar = array();
         }
index 13d0e3e..8f9ef31 100644 (file)
@@ -27,6 +27,9 @@
                        <trans-unit id="usersettings">
                                <source>$GLOBALS['TYPO3_USER_SETTINGS'] (User Settings Configuration)</source>
                        </trans-unit>
+                       <trans-unit id="routes">
+                               <source>Backend Routes</source>
+                       </trans-unit>
                        <trans-unit id="t3services">
                                <source>$GLOBALS['T3_SERVICES'] (Registered Services)</source>
                        </trans-unit>