‪TYPO3CMS  ‪main
Action.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 
21 use TYPO3\CMS\Core\Imaging\IconSize;
24 
28 class ‪Action
29 {
30  public function ‪__construct(
31  protected readonly string $name,
32  protected readonly array $configuration,
33  protected readonly string $iconIdentifier,
34  protected readonly string $labelKey,
35  ) {}
36 
37  public function ‪getName(): string
38  {
39  return $this->name;
40  }
41 
42  public function ‪getConfiguration(): string
43  {
44  return GeneralUtility::jsonEncodeForHtmlAttribute($this->configuration);
45  }
46 
47  public function ‪getLabel(): string
48  {
49  return $this->‪getLanguageService()->sL($this->labelKey);
50  }
51 
52  public function ‪getIcon(): string
53  {
54  return GeneralUtility::makeInstance(IconFactory::class)->getIcon($this->iconIdentifier, IconSize::SMALL)->render();
55  }
56 
58  {
59  return ‪$GLOBALS['LANG'];
60  }
61 }
‪TYPO3\CMS\Backend\Template\Components\MultiRecordSelection\Action\getLabel
‪getLabel()
Definition: Action.php:47
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:34
‪TYPO3\CMS\Backend\Template\Components\MultiRecordSelection\Action\__construct
‪__construct(protected readonly string $name, protected readonly array $configuration, protected readonly string $iconIdentifier, protected readonly string $labelKey,)
Definition: Action.php:30
‪TYPO3\CMS\Backend\Template\Components\MultiRecordSelection
Definition: Action.php:18
‪TYPO3\CMS\Backend\Template\Components\MultiRecordSelection\Action\getIcon
‪getIcon()
Definition: Action.php:52
‪TYPO3\CMS\Backend\Template\Components\MultiRecordSelection\Action\getLanguageService
‪getLanguageService()
Definition: Action.php:57
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Backend\Template\Components\MultiRecordSelection\Action
Definition: Action.php:29
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46
‪TYPO3\CMS\Backend\Template\Components\MultiRecordSelection\Action\getConfiguration
‪getConfiguration()
Definition: Action.php:42
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Backend\Template\Components\MultiRecordSelection\Action\getName
‪getName()
Definition: Action.php:37