‪TYPO3CMS  9.5
AdminPanelDataPersister.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
19 use Psr\Http\Message\ResponseInterface;
20 use Psr\Http\Message\ServerRequestInterface;
21 use Psr\Http\Server\MiddlewareInterface;
22 use Psr\Http\Server\RequestHandlerInterface;
28 
34 class ‪AdminPanelDataPersister implements MiddlewareInterface
35 {
42  public function ‪process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
43  {
44  $response = $handler->handle($request);
45  if (
46  !($response instanceof ‪NullResponse)
47  && ‪$GLOBALS['TSFE'] instanceof ‪TypoScriptFrontendController
48  && ‪$GLOBALS['TSFE']->isOutputting()
52  ) {
53  $mainController = GeneralUtility::makeInstance(MainController::class);
54  $mainController->storeData($request);
55  }
56  return $response;
57  }
58 }
‪TYPO3\CMS\Adminpanel\Controller\MainController
Definition: MainController.php:45
‪TYPO3\CMS\Adminpanel\Middleware
Definition: AdminPanelDataPersister.php:4
‪TYPO3\CMS\Adminpanel\Middleware\AdminPanelDataPersister
Definition: AdminPanelDataPersister.php:35
‪TYPO3\CMS\Adminpanel\Middleware\AdminPanelDataPersister\process
‪ResponseInterface process(ServerRequestInterface $request, RequestHandlerInterface $handler)
Definition: AdminPanelDataPersister.php:42
‪TYPO3\CMS\Adminpanel\Utility\StateUtility\isActivatedForUser
‪static bool isActivatedForUser()
Definition: StateUtility.php:33
‪TYPO3\CMS\Adminpanel\Utility\StateUtility\isHiddenForUser
‪static isHiddenForUser()
Definition: StateUtility.php:65
‪TYPO3\CMS\Core\Http\NullResponse
Definition: NullResponse.php:24
‪TYPO3\CMS\Adminpanel\Utility\StateUtility
Definition: StateUtility.php:27
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:97
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Adminpanel\Utility\StateUtility\isActivatedInTypoScript
‪static isActivatedInTypoScript()
Definition: StateUtility.php:60