[CLEANUP] Streamline EXT:about
[Packages/TYPO3.CMS.git] / typo3 / sysext / about / Classes / Controller / AboutController.php
1 <?php
2 namespace TYPO3\CMS\About\Controller;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\About\Domain\Repository\ExtensionRepository;
18 use TYPO3\CMS\Backend\View\BackendTemplateView;
19 use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
20 use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
21
22 /**
23 * Module 'about' shows some standard information for TYPO3 CMS: About-text, version number and so on.
24 */
25 class AboutController extends ActionController
26 {
27 /**
28 * @var ViewInterface
29 */
30 protected $defaultViewObjectName = BackendTemplateView::class;
31
32 /**
33 * @var ExtensionRepository
34 */
35 protected $extensionRepository;
36
37 /**
38 * @param ExtensionRepository $extensionRepository
39 */
40 public function injectExtensionRepository(ExtensionRepository $extensionRepository)
41 {
42 $this->extensionRepository = $extensionRepository;
43 }
44
45 /**
46 * Set up the doc header properly here
47 *
48 * @param ViewInterface $view
49 */
50 protected function initializeView(ViewInterface $view)
51 {
52 /** @var BackendTemplateView $view */
53 parent::initializeView($view);
54 // Disable Path
55 $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation([]);
56 }
57
58 /**
59 * Main action: Show standard information
60 *
61 * @return void
62 */
63 public function indexAction()
64 {
65 $this->view
66 ->assign('currentVersion', TYPO3_version)
67 ->assign('copyrightYear', TYPO3_copyright_year)
68 ->assign('donationUrl', TYPO3_URL_DONATE)
69 ->assign('loadedExtensions', $this->extensionRepository->findAllLoaded());
70 }
71 }