diff --git a/typo3/browser.php b/typo3/browser.php index 04f101839814f4a37d796e4618739d782f72743e..a10edc4654dd25adb422247c267d1cd470eef494 100644 --- a/typo3/browser.php +++ b/typo3/browser.php @@ -19,6 +19,10 @@ */ require __DIR__ . '/init.php'; +\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog( + 'The entry point to the file/record browser window was moved to an own module. Please use BackendUtility::getModuleUrl(\'browser\') to link to browser.php. This script will be removed in TYPO3 CMS 8.' +); + $elementBrowserFramesetController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\Controller\ElementBrowserFramesetController::class); $elementBrowserFramesetController->main(); $elementBrowserFramesetController->printContent(); diff --git a/typo3/sysext/backend/Classes/Form/FormEngine.php b/typo3/sysext/backend/Classes/Form/FormEngine.php index 2057944c2b8118459bfc582dcb6b10afdfe84707..d081f018196cc60b64cae0580c4fc3981d86cee0 100644 --- a/typo3/sysext/backend/Classes/Form/FormEngine.php +++ b/typo3/sysext/backend/Classes/Form/FormEngine.php @@ -1941,7 +1941,9 @@ class FormEngine { } $pageRenderer = $this->getPageRenderer(); // load the main module for FormEngine with all important JS functions - $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/FormEngine'); + $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/FormEngine', 'function(FormEngine) { + FormEngine.setBrowserUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('browser')) . '); + }'); $pageRenderer->loadPrototype(); $pageRenderer->loadJquery(); $pageRenderer->loadExtJS(); diff --git a/typo3/sysext/backend/Modules/Browser/conf.php b/typo3/sysext/backend/Modules/Browser/conf.php new file mode 100644 index 0000000000000000000000000000000000000000..60d7df1fe4d43562537c9af2ea8541439bba28f9 --- /dev/null +++ b/typo3/sysext/backend/Modules/Browser/conf.php @@ -0,0 +1,4 @@ +<?php +// Required for mod.php +$MCONF['name'] = 'browser'; +$MCONF['script'] = '_DISPATCH'; \ No newline at end of file diff --git a/typo3/sysext/backend/Modules/Browser/index.php b/typo3/sysext/backend/Modules/Browser/index.php new file mode 100644 index 0000000000000000000000000000000000000000..fda8c3808a3ee763c5fbf2abb3f321866277be16 --- /dev/null +++ b/typo3/sysext/backend/Modules/Browser/index.php @@ -0,0 +1,25 @@ +<?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! + */ + +/** + * This is the frameset to the file/record browser window + * + * @author Kasper Skårhøj <kasperYYYY@typo3.com> + */ + +$elementBrowserFramesetController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( + \TYPO3\CMS\Recordlist\Controller\ElementBrowserFramesetController::class +); +$elementBrowserFramesetController->main(); +$elementBrowserFramesetController->printContent(); \ No newline at end of file diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js index 9355d2bb45a3680abae308b5797c9d7f5daeb7ff..b9e4c80ca88380cea9c14cd26e7874262b41400c 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js @@ -36,8 +36,12 @@ define('TYPO3/CMS/Backend/FormEngine', ['jquery'], function ($) { ,backPath: TYPO3.settings.FormEngine.backPath ,openedPopupWindow: null ,legacyFieldChangedCb: function() { !$.isFunction(TYPO3.settings.FormEngine.legacyFieldChangedCb) || TYPO3.settings.FormEngine.legacyFieldChangedCb(); } + ,browserUrl: '' }; + FormEngine.setBrowserUrl = function(browserUrl) { + FormEngine.browserUrl = browserUrl; + }; // functions to connect the db/file browser with this document and the formfields on it! @@ -50,7 +54,7 @@ define('TYPO3/CMS/Backend/FormEngine', ['jquery'], function ($) { * @param height height of the window */ FormEngine.openPopupWindow = setFormValueOpenBrowser = function(mode, params, width, height) { - var url = FormEngine.backPath + 'browser.php?mode=' + mode + '&bparams=' + params; + var url = FormEngine.backPath + FormEngine.browserUrl + '&mode=' + mode + '&bparams=' + params; width = width ? width : top.TYPO3.configuration.PopupWindow.width; height = height ? height : top.TYPO3.configuration.PopupWindow.height; FormEngine.openedPopupWindow = window.open(url, 'Typo3WinBrowser', 'height=' + height + ',width=' + width + ',status=0,menubar=0,resizable=1,scrollbars=1'); diff --git a/typo3/sysext/backend/ext_tables.php b/typo3/sysext/backend/ext_tables.php index 52d48b99c7689295d839db1ca57243c1dd0f7745..cb5cf2a9fd489a9317d5cf7104b06cd8d3571441 100644 --- a/typo3/sysext/backend/ext_tables.php +++ b/typo3/sysext/backend/ext_tables.php @@ -133,4 +133,10 @@ if (TYPO3_MODE === 'BE') { 'show_item', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/ShowItem/' ); + + // Register browser + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath( + 'browser', + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/Browser/' + ); } diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-65289-DeprecateBrowserEntryPoint.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-65289-DeprecateBrowserEntryPoint.rst new file mode 100644 index 0000000000000000000000000000000000000000..69ecf6ced4e599534329c0384ce234a8508b577a --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-65289-DeprecateBrowserEntryPoint.rst @@ -0,0 +1,25 @@ +=================================================== +Deprecation: #65289 - Deprecate browser entry point +=================================================== + +Description +=========== + +The following entry point has been marked as deprecated: + +* typo3/browser.php + + +Impact +====== + +Using this entry points in a backend module will throw a deprecation message. + + +Migration +========= + +Use ``\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl()`` instead with the according module name. + +typo3/browser.php +``\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('browser')`` \ No newline at end of file