‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Imaging\IconRegistry Class Reference
Inheritance diagram for TYPO3\CMS\Core\Imaging\IconRegistry:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 getBackendIconsCacheIdentifier ()
 
bool isRegistered ($identifier)
 
bool isDeprecated ($identifier)
 
string getDefaultIconIdentifier ()
 
 registerIcon ($identifier, $iconProviderClassName, array $options=[])
 
 registerAlias ($alias, $identifier)
 
 registerFileExtension ($fileExtension, $iconIdentifier)
 
 registerMimeTypeIcon ($mimeType, $iconIdentifier)
 
mixed getIconConfigurationByIdentifier ($identifier)
 
array getAllRegisteredIconIdentifiers ()
 
 getDeprecatedIcons ()
 
string getIconIdentifierForFileExtension ($fileExtension)
 
string null getIconIdentifierForMimeType ($mimeType)
 
string detectIconProvider ($iconReference)
 
 warmupCaches (CacheWarmupEvent $event)
 

Public Attributes

$this cacheIdentifier = $cacheIdentifier
 

Protected Member Functions

 initialize ()
 
 getCachedBackendIcons ()
 
 registerBackendIcons ()
 
 registerTCAIcons ()
 
 getCachedFlagIcons ()
 
 registerFlags ()
 

Protected Attributes

bool $fullInitialized = false
 
bool $tcaInitialized = false
 
bool $flagsInitialized = false
 
bool $backendIconsInitialized = false
 
array $icons = array( )
 
string $backendIconDeclaration = 'EXT:core/Resources/Public/Icons/T3Icons/icons.json'
 
string[] $backendIconAllowedExtensionsWithProvider
 
array $staticIcons
 
string[] $fileExtensionMapping
 
string[] $mimeTypeMapping
 
array< string, $iconAliases=array();protected array $deprecatedIcons=array();protected string $defaultIconIdentifier='default-not-found';protected FrontendInterface $cache;private string $cacheIdentifier;public function __construct(FrontendInterface $assetsCache, string $cacheIdentifier) { $this-> cache = $assetsCache
 

Detailed Description

Class IconRegistry, which makes it possible to register custom icons from within an extension.

Definition at line 31 of file IconRegistry.php.

Member Function Documentation

◆ detectIconProvider()

string TYPO3\CMS\Core\Imaging\IconRegistry::detectIconProvider (   $iconReference)

Detect the IconProvider of an icon

Parameters
string$iconReference
Returns
‪string

Definition at line 549 of file IconRegistry.php.

Referenced by TYPO3\CMS\Core\ServiceProvider\configureIconRegistry(), and TYPO3\CMS\Core\Imaging\IconRegistry\registerTCAIcons().

◆ getAllRegisteredIconIdentifiers()

array TYPO3\CMS\Core\Imaging\IconRegistry::getAllRegisteredIconIdentifiers ( )
Returns
‪array

Definition at line 426 of file IconRegistry.php.

References TYPO3\CMS\Core\Imaging\IconRegistry\initialize().

◆ getBackendIconsCacheIdentifier()

TYPO3\CMS\Core\Imaging\IconRegistry::getBackendIconsCacheIdentifier ( )

◆ getCachedBackendIcons()

TYPO3\CMS\Core\Imaging\IconRegistry::getCachedBackendIcons ( )
protected

◆ getCachedFlagIcons()

◆ getDefaultIconIdentifier()

string TYPO3\CMS\Core\Imaging\IconRegistry::getDefaultIconIdentifier ( )
Returns
‪string

Definition at line 319 of file IconRegistry.php.

◆ getDeprecatedIcons()

TYPO3\CMS\Core\Imaging\IconRegistry::getDeprecatedIcons ( )

Definition at line 434 of file IconRegistry.php.

◆ getIconConfigurationByIdentifier()

mixed TYPO3\CMS\Core\Imaging\IconRegistry::getIconConfigurationByIdentifier (   $identifier)

Fetches the configuration provided by registerIcon()

Parameters
string$identifier‪the icon identifier
Returns
‪mixed
Exceptions
Exception

Definition at line 393 of file IconRegistry.php.

References TYPO3\CMS\Webhooks\Message\$identifier, TYPO3\CMS\Core\Imaging\IconRegistry\initialize(), TYPO3\CMS\Core\Imaging\IconRegistry\isDeprecated(), and TYPO3\CMS\Core\Imaging\IconRegistry\isRegistered().

◆ getIconIdentifierForFileExtension()

string TYPO3\CMS\Core\Imaging\IconRegistry::getIconIdentifierForFileExtension (   $fileExtension)
Parameters
string$fileExtension
Returns
‪string

Definition at line 443 of file IconRegistry.php.

◆ getIconIdentifierForMimeType()

string null TYPO3\CMS\Core\Imaging\IconRegistry::getIconIdentifierForMimeType (   $mimeType)

Get iconIdentifier for given mimeType

Parameters
string$mimeType
Returns
‪string|null Returns null if no icon is registered for the mimeType

Definition at line 458 of file IconRegistry.php.

◆ initialize()

TYPO3\CMS\Core\Imaging\IconRegistry::initialize ( )
protected

Initialize the registry This method can be called multiple times, depending on initialization status. In some cases e.g. TCA is not available, the method must be called multiple times.

Definition at line 217 of file IconRegistry.php.

References $GLOBALS, TYPO3\CMS\Core\Imaging\IconRegistry\getCachedBackendIcons(), TYPO3\CMS\Core\Imaging\IconRegistry\getCachedFlagIcons(), and TYPO3\CMS\Core\Imaging\IconRegistry\registerTCAIcons().

Referenced by TYPO3\CMS\Core\Imaging\IconRegistry\getAllRegisteredIconIdentifiers(), TYPO3\CMS\Core\Imaging\IconRegistry\getIconConfigurationByIdentifier(), and TYPO3\CMS\Core\Imaging\IconRegistry\isRegistered().

◆ isDeprecated()

bool TYPO3\CMS\Core\Imaging\IconRegistry::isDeprecated (   $identifier)
Parameters
string$identifier
Returns
‪bool

Definition at line 311 of file IconRegistry.php.

References TYPO3\CMS\Webhooks\Message\$identifier.

Referenced by TYPO3\CMS\Core\Imaging\IconRegistry\getIconConfigurationByIdentifier().

◆ isRegistered()

bool TYPO3\CMS\Core\Imaging\IconRegistry::isRegistered (   $identifier)

◆ registerAlias()

TYPO3\CMS\Core\Imaging\IconRegistry::registerAlias (   $alias,
  $identifier 
)

Registers an icon to be available inside the Icon Factory

Parameters
string$alias
string$identifier
Exceptions

Definition at line 356 of file IconRegistry.php.

References TYPO3\CMS\Webhooks\Message\$identifier.

Referenced by TYPO3\CMS\Core\Imaging\IconRegistry\registerBackendIcons().

◆ registerBackendIcons()

TYPO3\CMS\Core\Imaging\IconRegistry::registerBackendIcons ( )
protected

◆ registerFileExtension()

TYPO3\CMS\Core\Imaging\IconRegistry::registerFileExtension (   $fileExtension,
  $iconIdentifier 
)

Register an icon for a file extension

Parameters
string$fileExtension
string$iconIdentifier

Definition at line 370 of file IconRegistry.php.

◆ registerFlags()

TYPO3\CMS\Core\Imaging\IconRegistry::registerFlags ( )
protected

Register flags

Definition at line 518 of file IconRegistry.php.

Referenced by TYPO3\CMS\Core\Imaging\IconRegistry\getCachedFlagIcons().

◆ registerIcon()

TYPO3\CMS\Core\Imaging\IconRegistry::registerIcon (   $identifier,
  $iconProviderClassName,
array  $options = [] 
)

Registers an icon to be available inside the Icon Factory

Parameters
string$identifier
string$iconProviderClassName
Exceptions

Definition at line 332 of file IconRegistry.php.

References TYPO3\CMS\Webhooks\Message\$identifier.

Referenced by TYPO3\CMS\Core\ServiceProvider\configureIconRegistry(), and TYPO3\CMS\Core\Imaging\IconRegistry\registerBackendIcons().

◆ registerMimeTypeIcon()

TYPO3\CMS\Core\Imaging\IconRegistry::registerMimeTypeIcon (   $mimeType,
  $iconIdentifier 
)

Register an icon for a mime-type

Parameters
string$mimeType
string$iconIdentifier

Definition at line 381 of file IconRegistry.php.

◆ registerTCAIcons()

TYPO3\CMS\Core\Imaging\IconRegistry::registerTCAIcons ( )
protected

Load icons from TCA for each table and add them as "tcarecords-XX" to $this->icons

Definition at line 469 of file IconRegistry.php.

References $GLOBALS, and TYPO3\CMS\Core\Imaging\IconRegistry\detectIconProvider().

Referenced by TYPO3\CMS\Core\Imaging\IconRegistry\initialize().

◆ warmupCaches()

Member Data Documentation

◆ $backendIconAllowedExtensionsWithProvider

string [] TYPO3\CMS\Core\Imaging\IconRegistry::$backendIconAllowedExtensionsWithProvider
protected
Initial value:
= array(
'png' => BitmapIconProvider::class,
'webp' => BitmapIconProvider::class,
'svg' => SvgIconProvider::class,
)

List of allowed icon file extensions with their Provider class

Definition at line 63 of file IconRegistry.php.

◆ $backendIconDeclaration

string TYPO3\CMS\Core\Imaging\IconRegistry::$backendIconDeclaration = 'EXT:core/Resources/Public/Icons/T3Icons/icons.json'
protected

Definition at line 57 of file IconRegistry.php.

◆ $backendIconsInitialized

bool TYPO3\CMS\Core\Imaging\IconRegistry::$backendIconsInitialized = false
protected

Definition at line 47 of file IconRegistry.php.

◆ $fileExtensionMapping

string [] TYPO3\CMS\Core\Imaging\IconRegistry::$fileExtensionMapping
protected

Mapping of file extensions to mimetypes

Definition at line 88 of file IconRegistry.php.

◆ $flagsInitialized

bool TYPO3\CMS\Core\Imaging\IconRegistry::$flagsInitialized = false
protected

Definition at line 43 of file IconRegistry.php.

◆ $fullInitialized

bool TYPO3\CMS\Core\Imaging\IconRegistry::$fullInitialized = false
protected

Definition at line 35 of file IconRegistry.php.

◆ $icons

array TYPO3\CMS\Core\Imaging\IconRegistry::$icons = array( )
protected

Registered icons

Definition at line 53 of file IconRegistry.php.

Referenced by TYPO3\CMS\Core\Imaging\IconRegistry\warmupCaches().

◆ $mimeTypeMapping

string [] TYPO3\CMS\Core\Imaging\IconRegistry::$mimeTypeMapping
protected
Initial value:
= array(
'video/*' => 'mimetypes-media-video',
'audio/*' => 'mimetypes-media-audio',
'image/*' => 'mimetypes-media-image',
'text/*' => 'mimetypes-text-text',
)

Mapping of mime types to icons

Definition at line 170 of file IconRegistry.php.

◆ $staticIcons

array TYPO3\CMS\Core\Imaging\IconRegistry::$staticIcons
protected
Initial value:
= array(
)

manually registered icons hopefully obsolete one day

Definition at line 74 of file IconRegistry.php.

◆ $tcaInitialized

bool TYPO3\CMS\Core\Imaging\IconRegistry::$tcaInitialized = false
protected

Definition at line 39 of file IconRegistry.php.

◆ cache

array<string, $iconAliases = array( ); protected array $deprecatedIcons = array( ); protected string $defaultIconIdentifier = 'default-not-found'; protected FrontendInterface $cache; private string $cacheIdentifier; public function __construct(FrontendInterface $assetsCache, string $cacheIdentifier) { $this-> TYPO3\CMS\Core\Imaging\IconRegistry::cache = $assetsCache
protected

◆ cacheIdentifier

$this TYPO3\CMS\Core\Imaging\IconRegistry::cacheIdentifier = $cacheIdentifier

Definition at line 208 of file IconRegistry.php.