‪TYPO3CMS  ‪main
AboutController.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\EventDispatcher\EventDispatcherInterface;
21 use Psr\Http\Message\ResponseInterface;
22 use Psr\Http\Message\ServerRequestInterface;
29 use TYPO3\CMS\Core\Package\PackageManager;
30 
37 #[AsController]
39 {
40  public function ‪__construct(
41  protected readonly ‪Typo3Version $version,
42  protected readonly ‪Typo3Information $typo3Information,
43  protected readonly ‪ModuleProvider $moduleProvider,
44  protected readonly EventDispatcherInterface $eventDispatcher,
45  protected readonly PackageManager $packageManager,
46  protected readonly ‪ModuleTemplateFactory $moduleTemplateFactory,
47  ) {}
48 
52  public function ‪handleRequest(ServerRequestInterface $request): ResponseInterface
53  {
55  $event = $this->eventDispatcher->dispatch($event);
56  $view = $this->moduleTemplateFactory->create($request);
57  $view->assignMultiple([
58  'typo3Info' => $this->typo3Information,
59  'typo3Version' => $this->version,
60  'donationUrl' => $this->typo3Information::URL_DONATE,
61  'loadedExtensions' => $this->‪getLoadedExtensions(),
62  'messages' => $event->getMessages(),
63  'modules' => $this->moduleProvider->getModules($this->getBackendUser()),
64  ]);
65  return $view->renderResponse('About/Index');
66  }
67 
71  protected function ‪getLoadedExtensions(): array
72  {
73  $extensions = [];
74  foreach ($this->packageManager->getActivePackages() as $package) {
75  // Skip system extensions
76  if ($package->getPackageMetaData()->isFrameworkType()) {
77  continue;
78  }
79  $extensions[] = [
80  'key' => $package->getPackageKey(),
81  'title' => $package->getPackageMetaData()->getDescription(),
82  'authors' => $package->getValueFromComposerManifest('authors'),
83  ];
84  }
85  return $extensions;
86  }
87 
89  {
90  return ‪$GLOBALS['BE_USER'];
91  }
92 }
‪TYPO3\CMS\Backend\Controller\AboutController\handleRequest
‪handleRequest(ServerRequestInterface $request)
Definition: AboutController.php:52
‪TYPO3\CMS\Core\Information\Typo3Information
Definition: Typo3Information.php:28
‪TYPO3\CMS\Core\Information\Typo3Version
Definition: Typo3Version.php:21
‪TYPO3\CMS\Backend\Template\ModuleTemplateFactory
Definition: ModuleTemplateFactory.php:33
‪TYPO3\CMS\Backend\Controller\AboutController\__construct
‪__construct(protected readonly Typo3Version $version, protected readonly Typo3Information $typo3Information, protected readonly ModuleProvider $moduleProvider, protected readonly EventDispatcherInterface $eventDispatcher, protected readonly PackageManager $packageManager, protected readonly ModuleTemplateFactory $moduleTemplateFactory,)
Definition: AboutController.php:40
‪TYPO3\CMS\Backend\Controller\AboutController\getBackendUser
‪getBackendUser()
Definition: AboutController.php:88
‪TYPO3\CMS\Backend\Controller\AboutController\getLoadedExtensions
‪getLoadedExtensions()
Definition: AboutController.php:71
‪TYPO3\CMS\Backend\Module\ModuleProvider
Definition: ModuleProvider.php:29
‪TYPO3\CMS\Backend\Controller\Event\ModifyGenericBackendMessagesEvent
Definition: ModifyGenericBackendMessagesEvent.php:26
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Backend\Attribute\AsController
Definition: AsController.php:25
‪TYPO3\CMS\Backend\Controller
Definition: AboutController.php:18
‪TYPO3\CMS\Backend\Controller\AboutController
Definition: AboutController.php:39