Commit f641caee authored by Wouter Wolters's avatar Wouter Wolters Committed by Markus Klein
Browse files

[TASK] Make dummy.php dispatched

Use dispatching for dummy.php

Resolves: #65290
Releases: master
Change-Id: I4ead54c227ab4713143617782b93a3eda256bd92
Reviewed-on: http://review.typo3.org/38378


Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Tested-by: default avatarMarkus Klein <klein.t3@reelworx.at>
parent 8fad80d1
......@@ -19,6 +19,10 @@
*/
require __DIR__ . '/init.php';
\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog(
'The entry point to the dummy window was moved to an own module. Please use BackendUtility::getModuleUrl(\'dummy\') to link to dummy.php. This script will be removed in TYPO3 CMS 8.'
);
$dummyController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\DummyController::class);
$dummyController->main();
$dummyController->printContent();
......@@ -441,7 +441,7 @@ class EditDocumentController {
$this->defVals = $this->overrideVals;
}
// Setting return URL
$this->retUrl = $this->returnUrl ?: 'dummy.php';
$this->retUrl = $this->returnUrl ?: BackendUtility::getModuleUrl('dummy');
// Fix $this->editconf if versioning applies to any of the records
$this->fixWSversioningInEditConf();
// Make R_URL (request url) based on input GETvars:
......@@ -565,7 +565,7 @@ class EditDocumentController {
$newEditConf[$tableName][$editId] = 'edit';
}
// Traverse all new records and forge the content of ->editconf so we can continue to EDIT these records!
if ($tableName == 'pages' && $this->retUrl != 'dummy.php' && $this->returnNewPageId) {
if ($tableName == 'pages' && $this->retUrl != BackendUtility::getModuleUrl('dummy') && $this->returnNewPageId) {
$this->retUrl .= '&id=' . $tce->substNEWwithIDs[$key];
}
}
......@@ -1482,7 +1482,7 @@ class EditDocumentController {
BackendUtility::setUpdateSignal('OpendocsController::updateNumber', count($this->docHandler));
}
// If ->returnEditConf is set, then add the current content of editconf to the ->retUrl variable: (used by other scripts, like wizard_add, to know which records was created or so...)
if ($this->returnEditConf && $this->retUrl != 'dummy.php') {
if ($this->returnEditConf && $this->retUrl != BackendUtility::getModuleUrl('dummy')) {
$this->retUrl .= '&returnEditConf=' . rawurlencode(json_encode($this->editconf));
}
// If code is NOT set OR set to 1, then make a header location redirect to $this->retUrl
......@@ -1502,8 +1502,8 @@ class EditDocumentController {
* @param string $retUrl Alternative/Default retUrl
* @return void
*/
public function setDocument($currentDocFromHandlerMD5 = '', $retUrl = 'dummy.php') {
if ($retUrl === 'dummy.php') {
public function setDocument($currentDocFromHandlerMD5 = '', $retUrl = '') {
if ($retUrl === '') {
return;
}
if (!$this->modTSconfig['properties']['disableDocSelector'] && is_array($this->docHandler) && count($this->docHandler)) {
......
......@@ -40,7 +40,7 @@ class LoginFramesetController {
$this->content = $GLOBALS['TBE_TEMPLATE']->getPageRenderer()->render(\TYPO3\CMS\Core\Page\PageRenderer::PART_HEADER) . '
<frameset rows="*,1">
<frame name="login" src="index.php?loginRefresh=1" marginwidth="0" marginheight="0" scrolling="no" noresize="noresize" />
<frame name="dummy" src="dummy.php" marginwidth="0" marginheight="0" scrolling="auto" noresize="noresize" />
<frame name="dummy" src="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('dummy')) . '" marginwidth="0" marginheight="0" scrolling="auto" noresize="noresize" />
</frameset>
</html>';
}
......
......@@ -295,7 +295,7 @@ class ColorpickerController extends AbstractWizardController {
$this->content = $this->getDocumentTemplate()->getPageRenderer()->render(\TYPO3\CMS\Core\Page\PageRenderer::PART_HEADER) . '
<frameset rows="*,1" framespacing="0" frameborder="0" border="0">
<frame name="content" src="' . htmlspecialchars($url) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
<frame name="menu" src="dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
<frame name="menu" src="' . htmlspecialchars(BackendUtility::getModuleUrl('dummy')) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
</frameset>
</html>';
}
......
......@@ -230,7 +230,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface {
// Unset modules that are meant to be hidden from the menu.
$loadedModules = $this->removeHiddenModules($loadedModules);
$dummyScript = BackendUtility::getModuleUrl('dummy');
foreach ($loadedModules as $moduleName => $moduleData) {
$moduleLink = '';
if (!is_array($moduleData['sub'])) {
......@@ -247,7 +247,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface {
'link' => $moduleLink,
'description' => $GLOBALS['LANG']->moduleLabels['labels'][$moduleKey . 'label']
);
if (!is_array($moduleData['sub']) && $moduleData['script'] !== 'dummy.php') {
if (!is_array($moduleData['sub']) && $moduleData['script'] !== $dummyScript) {
// Work around for modules with own main entry, but being self the only submodule
$modules[$moduleKey]['subitems'][$moduleKey] = array(
'name' => $moduleName,
......
......@@ -310,7 +310,7 @@ class ModuleLoader {
} elseif ($setupInformation['configuration']['script'] && file_exists($setupInformation['path'] . '/' . $setupInformation['configuration']['script'])) {
$finalModuleConfiguration['script'] = $this->getRelativePath(PATH_typo3, $fullPath . '/' . $setupInformation['configuration']['script']);
} else {
$finalModuleConfiguration['script'] = 'dummy.php';
$finalModuleConfiguration['script'] = BackendUtility::getModuleUrl('dummy');
}
// Navigation Frame Script (GET params could be added)
......
......@@ -102,10 +102,11 @@ class ModuleMenuView {
$data = array('success' => TRUE, 'root' => array());
$rawModuleData = $this->getRawModuleData();
$index = 0;
$dummyLink = BackendUtility::getModuleUrl('dummy');
foreach ($rawModuleData as $moduleKey => $moduleData) {
$key = substr($moduleKey, 8);
$num = count($data['root']);
if ($moduleData['link'] != 'dummy.php' || $moduleData['link'] == 'dummy.php' && is_array($moduleData['subitems'])) {
if ($moduleData['link'] != $dummyLink || $moduleData['link'] == $dummyLink && is_array($moduleData['subitems'])) {
$data['root'][$num]['key'] = $key;
$data['root'][$num]['menuState'] = $GLOBALS['BE_USER']->uc['moduleData']['menuState'][$moduleKey];
$data['root'][$num]['label'] = $moduleData['title'];
......@@ -201,7 +202,7 @@ class ModuleMenuView {
// Unset modules that are meant to be hidden from the menu.
$this->unsetHiddenModules();
$dummyScript = BackendUtility::getModuleUrl('dummy');
foreach ($this->loadedModules as $moduleName => $moduleData) {
$moduleLink = '';
if (!is_array($moduleData['sub'])) {
......@@ -218,7 +219,7 @@ class ModuleMenuView {
'link' => $moduleLink,
'description' => $GLOBALS['LANG']->moduleLabels['labels'][$moduleKey . 'label']
);
if (!is_array($moduleData['sub']) && $moduleData['script'] != 'dummy.php') {
if (!is_array($moduleData['sub']) && $moduleData['script'] != $dummyScript) {
// Work around for modules with own main entry, but being self the only submodule
$modules[$moduleKey]['subitems'][$moduleKey] = array(
'name' => $moduleName,
......
<?php
// Required for mod.php
$MCONF['name'] = 'dummy';
$MCONF['script'] = '_DISPATCH';
\ No newline at end of file
<?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!
*/
/**
* Dummy document - displays nothing but background color.
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
$dummyController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\DummyController::class);
$dummyController->main();
$dummyController->printContent();
\ No newline at end of file
......@@ -158,4 +158,10 @@ if (TYPO3_MODE === 'BE') {
'browser',
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/Browser/'
);
// Register dummy window
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
'dummy',
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/Dummy/'
);
}
=================================================
Deprecation: #65290 - Deprecate dummy entry point
=================================================
Description
===========
The following entry point has been marked as deprecated:
* typo3/dummy.php
Impact
======
Using this entry point in a backend module will throw a deprecation message.
Migration
=========
Use ``\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl()`` instead with the according module name.
typo3/dummy.php
``\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('dummy')``
\ No newline at end of file
......@@ -70,7 +70,7 @@ class ElementBrowserFramesetController {
$this->content = $documentTemplate->getPageRenderer()->render(PageRenderer::PART_HEADER) .
'<frameset rows="*,1" framespacing="0" frameborder="0" border="0">
<frame name="content" src="' . htmlspecialchars($url) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
<frame name="menu" src="' . $GLOBALS['BACK_PATH'] . 'dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
<frame name="menu" src="' . htmlspecialchars(BackendUtility::getModuleUrl('dummy')) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
</frameset>
</html>
';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment