‪TYPO3CMS  ‪main
RequestInformation.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Http\Message\ServerRequestInterface;
26 
33 {
34  public function ‪getIdentifier(): string
35  {
36  return 'info-request';
37  }
38 
39  public function ‪getLabel(): string
40  {
41  return $this->‪getLanguageService()->sL(
42  'LLL:EXT:adminpanel/Resources/Private/Language/locallang_info.xlf:sub.request.label'
43  );
44  }
45 
46  public function ‪getDataToStore(ServerRequestInterface $request): ‪ModuleData
47  {
48  return new ‪ModuleData(
49  [
50  'post' => $request->getParsedBody(),
51  'get' => $request->getQueryParams(),
52  'cookie' => $request->getCookieParams(),
53  'session' => isset($_SESSION) ? $_SESSION : null,
54  'server' => $request->getServerParams(),
55  ]
56  );
57  }
58 
59  public function ‪getContent(‪ModuleData $data): string
60  {
61  $view = GeneralUtility::makeInstance(StandaloneView::class);
62  $templateNameAndPath = 'EXT:adminpanel/Resources/Private/Templates/Modules/Info/RequestInformation.html';
63  $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath));
64  $view->setPartialRootPaths(['EXT:adminpanel/Resources/Private/Partials']);
65 
66  $view->assignMultiple($data->getArrayCopy());
67  $view->assign('languageKey', $this->‪getBackendUser()->user['lang'] ?? null);
68 
69  return $view->render();
70  }
71 }
‪TYPO3\CMS\Adminpanel\Modules\Info\RequestInformation
Definition: RequestInformation.php:33
‪TYPO3\CMS\Adminpanel\Modules\Info\RequestInformation\getIdentifier
‪getIdentifier()
Definition: RequestInformation.php:34
‪TYPO3\CMS\Adminpanel\Modules\Info\RequestInformation\getContent
‪getContent(ModuleData $data)
Definition: RequestInformation.php:59
‪TYPO3\CMS\Adminpanel\ModuleApi\DataProviderInterface
Definition: DataProviderInterface.php:30
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule\getBackendUser
‪getBackendUser()
Definition: AbstractSubModule.php:35
‪TYPO3\CMS\Adminpanel\Modules\Info
Definition: GeneralInformation.php:18
‪TYPO3\CMS\Adminpanel\Modules\Info\RequestInformation\getDataToStore
‪getDataToStore(ServerRequestInterface $request)
Definition: RequestInformation.php:46
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:30
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule\getLanguageService
‪getLanguageService()
Definition: AbstractSubModule.php:30
‪TYPO3\CMS\Adminpanel\ModuleApi\ModuleData
Definition: ModuleData.php:26
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule
Definition: AbstractSubModule.php:29
‪TYPO3\CMS\Adminpanel\Modules\Info\RequestInformation\getLabel
‪getLabel()
Definition: RequestInformation.php:39