Commit c71f144b authored by Manuel Selbach's avatar Manuel Selbach Committed by Benni Mack
Browse files

[TASK] Move record-related entrypoints to backend routing

Resolves: #69038
Releases: master
Change-Id: I6ad5e541b1741f0b29a1f68d631404cb5a6d38d2
Reviewed-on: http://review.typo3.org/42609

Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 0550a05d
......@@ -14,13 +14,16 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
* The TYPO3 project - inspiring people to share!
*/
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Script Class for showing the history module of TYPO3s backend
* @see \TYPO3\CMS\Backend\History\RecordHistory
*/
class ElementHistoryController {
class ElementHistoryController implements \TYPO3\CMS\Core\Http\ControllerInterface {
/**
* @var string
......@@ -49,6 +52,25 @@ class ElementHistoryController {
$this->init();
}
/**
* Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now
*
* @param ServerRequestInterface $request
* @return ResponseInterface $response
*/
public function processRequest(ServerRequestInterface $request) {
$this->main();
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content);
return $response;
}
/**
* Initialize the module output
*
......@@ -85,8 +107,10 @@ class ElementHistoryController {
* Outputting the accumulated content to screen
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead
*/
public function printContent() {
GeneralUtility::logDeprecatedFunction();
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
echo $this->content;
......
......@@ -14,6 +14,9 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
* The TYPO3 project - inspiring people to share!
*/
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Imaging\Icon;
......@@ -27,7 +30,7 @@ use TYPO3\CMS\Backend\Backend\Avatar\Avatar;
/**
* Script Class for showing information about an item.
*/
class ElementInformationController {
class ElementInformationController implements \TYPO3\CMS\Core\Http\ControllerInterface {
/**
* Record table name
......@@ -190,6 +193,26 @@ class ElementInformationController {
}
}
/**
* Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now
*
* @param ServerRequestInterface $request
* @return ResponseInterface $response
*/
public function processRequest(ServerRequestInterface $request) {
$this->main();
$content = $this->doc->startPage($this->titleTag);
$content .= $this->doc->insertStylesAndJS($this->content);
$content .= $this->doc->endPage();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($content);
return $response;
}
/**
* @return void
*/
......@@ -520,8 +543,10 @@ class ElementInformationController {
* End page and print content
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead
*/
public function printContent() {
GeneralUtility::logDeprecatedFunction();
echo $this->doc->startPage($this->titleTag) .
$this->doc->insertStylesAndJS($this->content) .
$this->doc->endPage();
......
......@@ -14,6 +14,9 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
* The TYPO3 project - inspiring people to share!
*/
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -21,7 +24,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Script Class for rendering the move-element wizard display
*/
class MoveElementController {
class MoveElementController implements \TYPO3\CMS\Core\Http\ControllerInterface {
/**
* @var int
......@@ -113,6 +116,22 @@ class MoveElementController {
$this->content .= $this->doc->header($this->getLanguageService()->getLL('movingElement'));
}
/**
* Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now
*
* @param ServerRequestInterface $request
* @return ResponseInterface $response
*/
public function processRequest(ServerRequestInterface $request) {
$this->main();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content);
return $response;
}
/**
* Creating the module output.
*
......@@ -228,8 +247,10 @@ class MoveElementController {
* Print out the accumulated content:
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead
*/
public function printContent() {
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
......
......@@ -14,6 +14,9 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
* The TYPO3 project - inspiring people to share!
*/
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -22,7 +25,7 @@ use TYPO3\CMS\Core\Utility\PathUtility;
/**
* Script Class for the New Content element wizard
*/
class NewContentElementController {
class NewContentElementController implements \TYPO3\CMS\Core\Http\ControllerInterface {
/**
* Page id
......@@ -117,6 +120,14 @@ class NewContentElementController {
*/
protected $MCONF;
/**
* Constructor
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
$this->init();
}
/**
* Constructor, initializing internal variables.
*
......@@ -153,6 +164,22 @@ class NewContentElementController {
$this->access = is_array($this->pageInfo) ? 1 : 0;
}
/**
* Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now
*
* @param ServerRequestInterface $request
* @return ResponseInterface $response
*/
public function processRequest(ServerRequestInterface $request) {
$this->main();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content);
return $response;
}
/**
* Creating the module output.
*
......@@ -312,8 +339,10 @@ class NewContentElementController {
* Print out the accumulated content:
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead
*/
public function printContent() {
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
......
......@@ -14,16 +14,44 @@ namespace TYPO3\CMS\Backend\Controller;
* The TYPO3 project - inspiring people to share!
*/
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Script Class, creating the content for the dummy script - which is just blank output.
*/
class DummyController {
class DummyController implements \TYPO3\CMS\Core\Http\ControllerInterface {
/**
* @var string
*/
public $content;
/**
* Constructor
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
}
/**
* Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now
*
* @param ServerRequestInterface $request
* @return ResponseInterface $response
*/
public function processRequest(ServerRequestInterface $request) {
$this->main();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content);
return $response;
}
/**
* Create content for the dummy script - outputting a blank page.
*
......@@ -40,8 +68,10 @@ class DummyController {
* Outputting the accumulated content to screen
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead
*/
public function printContent() {
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
......
......@@ -14,6 +14,9 @@ namespace TYPO3\CMS\Backend\Controller;
* The TYPO3 project - inspiring people to share!
*/
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -21,13 +24,36 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Script Class, putting the frameset together.
*/
class LoginFramesetController {
class LoginFramesetController implements \TYPO3\CMS\Core\Http\ControllerInterface {
/**
* @var string
*/
protected $content;
/**
* Constructor
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
}
/**
* Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now
*
* @param ServerRequestInterface $request
* @return ResponseInterface $response
*/
public function processRequest(ServerRequestInterface $request) {
$this->main();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content);
return $response;
}
/**
* Main function.
* Creates the header code and the frameset for the two frames.
......@@ -51,8 +77,10 @@ class LoginFramesetController {
* Outputs the page content.
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead
*/
public function printContent() {
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
......
......@@ -14,6 +14,9 @@ namespace TYPO3\CMS\Backend\Controller;
* The TYPO3 project - inspiring people to share!
*/
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Database\DatabaseConnection;
......@@ -31,7 +34,7 @@ use TYPO3\CMS\Frontend\Page\PageRepository;
/**
* Script class for 'db_new'
*/
class NewRecordController {
class NewRecordController implements \TYPO3\CMS\Core\Http\ControllerInterface {
/**
* @var array
......@@ -226,6 +229,22 @@ class NewRecordController {
}
}
/**
* Injects the request object for the current request or subrequest
* As this controller goes only through the main() method, it is rather simple for now
*
* @param ServerRequestInterface $request
* @return ResponseInterface $response
*/
public function processRequest(ServerRequestInterface $request) {
$this->main();
/** @var Response $response */
$response = GeneralUtility::makeInstance(Response::class);
$response->getBody()->write($this->content);
return $response;
}
/**
* Main processing, creating the list of new record tables to select from
*
......@@ -552,8 +571,10 @@ class NewRecordController {
* Ending page output and echo'ing content to browser.
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use processRequest() instead
*/
public function printContent() {
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
......
......@@ -105,4 +105,53 @@ return [
'path' => '/file/upload',
'controller' => \TYPO3\CMS\Backend\Controller\File\FileUploadController::class
],
];
\ No newline at end of file
// Register login frameset
'login_frameset' => [
'path' => '/login/frame',
'controller' => \TYPO3\CMS\Backend\Controller\LoginFramesetController::class
],
// Register record history module
'record_history' => [
'path' => '/record/history',
'controller' => \TYPO3\CMS\Backend\Controller\ContentElement\ElementHistoryController::class
],
// Register new record
'db_new' => [
'path' => '/record/new',
'controller' => \TYPO3\CMS\Backend\Controller\NewRecordController::class
],
// Register new content element module
'new_content_element' => [
'path' => '/record/content/new',
'controller' => \TYPO3\CMS\Backend\Controller\ContentElement\NewContentElementController::class
],
// Register move element module
'move_element' => [
'path' => '/record/move',
'controller' => \TYPO3\CMS\Backend\Controller\ContentElement\MoveElementController::class
],
// Register show item module
'show_item' => [
'path' => '/record/info',
'controller' => \TYPO3\CMS\Backend\Controller\ContentElement\ElementInformationController::class
],
// Register browser
'browser' => [
'path' => '/record/browse',
'controller' => \TYPO3\CMS\Recordlist\Controller\ElementBrowserFramesetController::class
],
// Register dummy window
'dummy' => [
'path' => '/empty',
'controller' => \TYPO3\CMS\Backend\Controller\DummyController::class
],
];
<?php
$MCONF['name'] = 'browser';
$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!
*/
/**
* This is the frameset to the file/record browser window
*/
$elementBrowserFramesetController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Recordlist\Controller\ElementBrowserFramesetController::class
);
$elementBrowserFramesetController->main();
$elementBrowserFramesetController->printContent();
<?php
$MCONF['script'] = '_DISPATCH';
$MCONF['name'] = 'login_frameset';
\ 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!
*/
/**
* Login frameset
*
* This script generates a login-frameset used when the user must relogin.
*/
define('TYPO3_PROCEED_IF_NO_USER', 1);
$loginFramesetController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\LoginFramesetController::class);
$loginFramesetController->main();
$loginFramesetController->printContent();
<?php
$MCONF['script'] = '_DISPATCH';
$MCONF['name'] = 'move_element';
\ 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!
*/
/**
* Moving pages or content elements (tt_content) around in the system via a page tree navigation.
*/
$moveElementController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\ContentElement\MoveElementController::class);
$moveElementController->main();
$moveElementController->printContent();
<?php
$MCONF['script'] = '_DISPATCH';
$MCONF['name'] = 'new_content_element';
\ 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!
*/
$GLOBALS['SOBE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\ContentElement\NewContentElementController::class);
$GLOBALS['SOBE']->init();
$GLOBALS['SOBE']->main();
$GLOBALS['SOBE']->printContent();
<?php
$MCONF['script'] = '_DISPATCH';
$MCONF['name'] = 'db_new';
\ 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!
*/
/**
* New database item menu
*
* This script lets users choose a new database element to create.
* Includes a wizard mode for visually pointing out the position of new pages
*/
$newRecordController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\NewRecordController::class);
$newRecordController->main();
$newRecordController->printContent();