‪TYPO3CMS  ‪main
T3GeneralInformationWidget.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;
24 
33 {
34  private ServerRequestInterface ‪$request;
35 
36  public function ‪__construct(
37  private readonly ‪WidgetConfigurationInterface $configuration,
38  private readonly ‪BackendViewFactory $backendViewFactory,
39  private readonly array $options = [],
40  ) {}
41 
42  public function ‪setRequest(ServerRequestInterface ‪$request): void
43  {
44  $this->request = ‪$request;
45  }
46 
47  public function ‪renderWidgetContent(): string
48  {
49  $typo3Information = new ‪Typo3Information();
50  $typo3Version = new ‪Typo3Version();
51  $view = $this->backendViewFactory->create($this->request);
52  $view->assignMultiple([
53  'title' => 'TYPO3 CMS ' . $typo3Version->getVersion(),
54  'copyrightYear' => $typo3Information->getCopyrightYear(),
55  'currentVersion' => $typo3Version->getVersion(),
56  'donationUrl' => $typo3Information::URL_DONATE,
57  'copyRightNotice' => $typo3Information->getCopyrightNotice(),
58  'options' => $this->options,
59  'configuration' => $this->configuration,
60  ]);
61  return $view->render('Widget/T3GeneralInformationWidget');
62  }
63 
64  public function ‪getOptions(): array
65  {
66  return $this->options;
67  }
68 }
‪TYPO3\CMS\Core\Information\Typo3Information
Definition: Typo3Information.php:28
‪TYPO3\CMS\Core\Information\Typo3Version
Definition: Typo3Version.php:21
‪TYPO3\CMS\Backend\View\BackendViewFactory
Definition: BackendViewFactory.php:35
‪TYPO3\CMS\Dashboard\Widgets\T3GeneralInformationWidget\getOptions
‪getOptions()
Definition: T3GeneralInformationWidget.php:64
‪TYPO3\CMS\Dashboard\Widgets\RequestAwareWidgetInterface
Definition: RequestAwareWidgetInterface.php:29
‪TYPO3\CMS\Dashboard\Widgets\WidgetInterface
Definition: WidgetInterface.php:26
‪TYPO3\CMS\Dashboard\Widgets\T3GeneralInformationWidget\renderWidgetContent
‪renderWidgetContent()
Definition: T3GeneralInformationWidget.php:47
‪TYPO3\CMS\Dashboard\Widgets\T3GeneralInformationWidget\$request
‪ServerRequestInterface $request
Definition: T3GeneralInformationWidget.php:34
‪TYPO3\CMS\Dashboard\Widgets\T3GeneralInformationWidget
Definition: T3GeneralInformationWidget.php:33
‪TYPO3\CMS\Dashboard\Widgets\T3GeneralInformationWidget\__construct
‪__construct(private readonly WidgetConfigurationInterface $configuration, private readonly BackendViewFactory $backendViewFactory, private readonly array $options=[],)
Definition: T3GeneralInformationWidget.php:36
‪TYPO3\CMS\Dashboard\Widgets
Definition: AdditionalCssInterface.php:18
‪TYPO3\CMS\Dashboard\Widgets\T3GeneralInformationWidget\setRequest
‪setRequest(ServerRequestInterface $request)
Definition: T3GeneralInformationWidget.php:42
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface
Definition: WidgetConfigurationInterface.php:26