[TASK] Update TYPO3 version to TYPO3 8.0-dev
[Packages/TYPO3.CMS.git] / typo3 / deprecated.php
1 <?php
2 /*
3 * This file is part of the TYPO3 CMS project.
4 *
5 * It is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License, either version 2
7 * of the License, or any later version.
8 *
9 * For the full copyright and license information, please read the
10 * LICENSE.txt file that was distributed with this source code.
11 *
12 * The TYPO3 project - inspiring people to share!
13 */
14
15 /*
16 * Base wrapper for loading old entry points, which are all used within TYPO3 directly
17 * This file is only a deprecation layer, and all @deprecated entrypoints fallbacks will be removed with TYPO3 CMS 8
18 * Use the UriBuilder for generating routes in your scripts to link to Ajax pages, Modules or simple pages in the Backend.
19 */
20 use TYPO3\CMS\Backend\Controller;
21 use TYPO3\CMS\Core\Utility\GeneralUtility;
22
23 call_user_func(function () {
24 $classLoader = require __DIR__ . '/../vendor/autoload.php';
25 (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run(function () {
26
27 $originalRequestedFilenameParts = parse_url(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
28 $originalRequestedFilename = basename($originalRequestedFilenameParts['path']);
29
30 switch ($originalRequestedFilename) {
31 case 'ajax.php':
32 GeneralUtility::deprecationLog(
33 'The entry point to ajax.php was moved to index.php with ajaxID given. Please use BackendUtility::getAjaxUrl(\'myAjaxKey\') to link to the AJAX Call.'
34 );
35 break;
36
37 case 'alt_clickmenu.php':
38 GeneralUtility::deprecationLog(
39 'alt_clickmenu.php is deprecated, and will not work anymore, please use the AJAX functionality as used in the TYPO3 Core.'
40 );
41
42 $clickMenuController = GeneralUtility::makeInstance(Controller\ClickMenuController::class);
43 $clickMenuController->main();
44 $clickMenuController->printContent();
45 break;
46
47 case 'alt_db_navframe.php':
48 GeneralUtility::deprecationLog(
49 'Usage of alt_db_navframe.php is deprecated since TYPO3 CMS 7, and will be removed in TYPO3 CMS 8'
50 );
51
52 // Make instance if it is not an AJAX call
53 $pageTreeNavigationController = GeneralUtility::makeInstance(Controller\PageTreeNavigationController::class);
54 $pageTreeNavigationController->initPage();
55 $pageTreeNavigationController->main();
56 $pageTreeNavigationController->printContent();
57 break;
58
59 case 'alt_doc.php':
60 GeneralUtility::deprecationLog(
61 'The entry point to FormEngine was moved to an own module. Please use BackendUtility::getModuleUrl(\'record_edit\') to link to alt_doc.php.'
62 );
63 \TYPO3\CMS\Backend\Utility\BackendUtility::lockRecords();
64
65 /* @var $editDocumentController Controller\EditDocumentController */
66 $editDocumentController = GeneralUtility::makeInstance(Controller\EditDocumentController::class);
67
68 // Preprocessing, storing data if submitted to
69 $editDocumentController->preInit();
70
71 // Checks, if a save button has been clicked (or the doSave variable is sent)
72 if ($editDocumentController->doProcessData()) {
73 $formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
74 if ($formProtection->validateToken(GeneralUtility::_GP('formToken'), 'editRecord')) {
75 $editDocumentController->processData();
76 }
77 }
78
79 $editDocumentController->init();
80 $editDocumentController->main();
81 $editDocumentController->printContent();
82 break;
83
84 case 'alt_file_navframe.php':
85 GeneralUtility::deprecationLog(
86 'The entry point to the folder tree was moved to an own module. Please use BackendUtility::getModuleUrl(\'file_navframe\') to link to alt_file_navframe.php.'
87 );
88
89 $fileSystemNavigationFrameController = GeneralUtility::makeInstance(Controller\FileSystemNavigationFrameController::class);
90 $fileSystemNavigationFrameController->initPage();
91 $fileSystemNavigationFrameController->main();
92 $fileSystemNavigationFrameController->printContent();
93 break;
94
95 case 'browser.php':
96 GeneralUtility::deprecationLog(
97 '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.'
98 );
99
100 $elementBrowserFramesetController = GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\Controller\ElementBrowserFramesetController::class);
101 $elementBrowserFramesetController->main();
102 $elementBrowserFramesetController->printContent();
103 break;
104
105 case 'db_new.php':
106 GeneralUtility::deprecationLog(
107 'The entry point to create a new database entry was moved to an own module. Please use BackendUtility::getModuleUrl(\'db_new\') to link to db_new.php.'
108 );
109
110 $newRecordController = GeneralUtility::makeInstance(Controller\NewRecordController::class);
111 $newRecordController->main();
112 $newRecordController->printContent();
113 break;
114
115 case 'dummy.php':
116 GeneralUtility::deprecationLog(
117 'The entry point to the dummy window was moved to an own module. Please use BackendUtility::getModuleUrl(\'dummy\') to link to dummy.php.'
118 );
119
120 $dummyController = GeneralUtility::makeInstance(Controller\DummyController::class);
121 $dummyController->main();
122 $dummyController->printContent();
123 break;
124
125 case 'init.php':
126 GeneralUtility::deprecationLog(
127 'Usage of typo3/init.php is deprecated. Use index.php with Routing or the Backend Application class directly. See index.php for usage'
128 );
129 break;
130
131 case 'login_frameset.php':
132 GeneralUtility::deprecationLog(
133 'Login frameset is moved to an own module. Please use BackendUtility::getModuleUrl(\'login_frameset\') to link to login_frameset.php.'
134 );
135
136 // Make instance:
137 $loginFramesetController = GeneralUtility::makeInstance(Controller\LoginFramesetController::class);
138 $loginFramesetController->main();
139 $loginFramesetController->printContent();
140 break;
141
142 case 'logout.php':
143 GeneralUtility::deprecationLog(
144 'The entry point to logout was moved to an own module. Please use BackendUtility::getModuleUrl(\'logout\') to link to logout.php.'
145 );
146
147 $logoutController = GeneralUtility::makeInstance(Controller\LogoutController::class);
148 $logoutController->logout();
149 // do the redirect
150 $redirect = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('redirect'));
151 $redirectUrl = $redirect ?: 'index.php';
152 \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl);
153 break;
154
155 case 'mod.php':
156 GeneralUtility::deprecationLog(
157 'The entry point to mod.php was moved to index.php with "M" given. Please use BackendUtility::getModuleUrl(\'myModuleKey\') to link to a module.'
158 );
159 break;
160
161 case 'move_el.php':
162 GeneralUtility::deprecationLog(
163 'Moving an element is moved to an own module. Please use BackendUtility::getModuleUrl(\'move_element\') to link to move_el.php.'
164 );
165
166 $moveElementController = GeneralUtility::makeInstance(Controller\ContentElement\MoveElementController::class);
167 $moveElementController->main();
168 $moveElementController->printContent();
169 break;
170
171 case 'show_item.php':
172 GeneralUtility::deprecationLog(
173 'The entry point to show_item was moved to an own module. Please use BackendUtility::getModuleUrl(\'show_item\') to link to show_item.php.'
174 );
175
176 $elementInformationController = GeneralUtility::makeInstance(Controller\ContentElement\ElementInformationController::class);
177 $elementInformationController->main();
178 $elementInformationController->printContent();
179 break;
180
181 case 'tce_db.php':
182 GeneralUtility::deprecationLog(
183 'The entry point to data handling via DataHandler was moved to an own module. Please use BackendUtility::getModuleUrl(\'tce_db\') to link to tce_db.php / DataHandler.'
184 );
185
186 $simpleDataHandlerController = GeneralUtility::makeInstance(Controller\SimpleDataHandlerController::class);
187
188 $formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
189 if ($formProtection->validateToken(GeneralUtility::_GP('formToken'), 'tceAction')) {
190 $simpleDataHandlerController->initClipboard();
191 $simpleDataHandlerController->main();
192 }
193 $simpleDataHandlerController->finish();
194 break;
195
196 case 'tce_file.php':
197 GeneralUtility::deprecationLog(
198 'File handling entry point was moved an own module. Please use BackendUtility::getModuleUrl(\'tce_file\') to link to tce_file.php.'
199 );
200
201 $fileController = GeneralUtility::makeInstance(Controller\File\FileController::class);
202
203 $formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
204 if ($formProtection->validateToken(GeneralUtility::_GP('formToken'), 'tceAction')) {
205 $fileController->main();
206 }
207
208 $fileController->finish();
209 break;
210
211 case 'thumbs.php':
212 GeneralUtility::deprecationLog(
213 'thumbs.php is no longer in use, please use the corresponding Resource objects to generate a preview functionality for thumbnails.'
214 );
215 $GLOBALS['SOBE'] = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\View\ThumbnailView::class);
216 $GLOBALS['SOBE']->init();
217 $GLOBALS['SOBE']->main();
218 break;
219
220 default:
221 throw new \RuntimeException('You cannot call this script directly.');
222 }
223
224 });
225 });