‪TYPO3CMS  ‪main
ReactionsProvider.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 
22 
24 {
25  public function ‪__construct(
26  private readonly ‪ReactionRegistry $reactionRegistry
27  ) {}
28 
29  public function ‪getConfiguration(): array
30  {
31  $configuration = [];
32  $languageService = $this->‪getLanguageService();
33  foreach ($this->reactionRegistry->getAvailableReactionTypes() as $type => $reaction) {
34  $description = $languageService->sL($reaction::getDescription());
35  if ($description !== $reaction::getDescription()) {
36  $description .= ' [' . $reaction::getDescription() . ']';
37  }
38  $configuration[$type] = [
39  'description' => $description,
40  'iconIdentifier' => $reaction::getIconIdentifier(),
41  ];
42  }
43  return $configuration;
44  }
45 }
‪TYPO3\CMS\Reactions\ConfigurationModuleProvider
Definition: ReactionsProvider.php:18
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider\getLanguageService
‪getLanguageService()
Definition: AbstractProvider.php:52
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider
Definition: AbstractProvider.php:27
‪TYPO3\CMS\Reactions\ConfigurationModuleProvider\ReactionsProvider\getConfiguration
‪getConfiguration()
Definition: ReactionsProvider.php:29
‪TYPO3\CMS\Reactions\ConfigurationModuleProvider\ReactionsProvider
Definition: ReactionsProvider.php:24
‪TYPO3\CMS\Reactions\ReactionRegistry
Definition: ReactionRegistry.php:28
‪TYPO3\CMS\Reactions\ConfigurationModuleProvider\ReactionsProvider\__construct
‪__construct(private readonly ReactionRegistry $reactionRegistry)
Definition: ReactionsProvider.php:25