‪TYPO3CMS  10.4
IconRegistry.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
32 
38 {
42  protected ‪$fullInitialized = false;
43 
47  protected ‪$tcaInitialized = false;
48 
52  protected ‪$flagsInitialized = false;
53 
57  protected ‪$moduleIconsInitialized = false;
58 
62  protected ‪$backendIconsInitialized = false;
63 
69  protected ‪$icons = [];
70 
74  protected ‪$backendIconDeclaration = 'EXT:core/Resources/Public/Icons/T3Icons/icons.json';
75 
82  'png' => BitmapIconProvider::class,
83  'svg' => SvgIconProvider::class
84  ];
85 
92  protected ‪$staticIcons = [
93 
101  // Apps
102  'apps-pagetree-category-toggle-hide-checked' => [
103  'provider' => FontawesomeIconProvider::class,
104  'options' => [
105  'name' => 'check-square'
106  ]
107  ],
108 
109  // Status
110  'status-dialog-information' => [
111  'provider' => FontawesomeIconProvider::class,
112  'options' => [
113  'name' => 'exclamation-circle'
114  ]
115  ],
116  'status-dialog-ok' => [
117  'provider' => FontawesomeIconProvider::class,
118  'options' => [
119  'name' => 'check-circle',
120  ]
121  ],
122  'status-dialog-notification' => [
123  'provider' => FontawesomeIconProvider::class,
124  'options' => [
125  'name' => 'exclamation-circle'
126  ]
127  ],
128  'status-dialog-warning' => [
129  'provider' => FontawesomeIconProvider::class,
130  'options' => [
131  'name' => 'exclamation-triangle'
132  ]
133  ],
134  'status-dialog-error' => [
135  'provider' => FontawesomeIconProvider::class,
136  'options' => [
137  'name' => 'exclamation-circle'
138  ]
139  ],
140  'status-status-checked' => [
141  'provider' => FontawesomeIconProvider::class,
142  'options' => [
143  'name' => 'check',
144  ]
145  ],
146  'status-status-current' => [
147  'provider' => FontawesomeIconProvider::class,
148  'options' => [
149  'name' => 'caret-right',
150  ]
151  ],
152  'status-status-sorting-asc' => [
153  'provider' => FontawesomeIconProvider::class,
154  'options' => [
155  'name' => 'caret-up',
156  ]
157  ],
158  'status-status-sorting-desc' => [
159  'provider' => FontawesomeIconProvider::class,
160  'options' => [
161  'name' => 'caret-down',
162  ]
163  ],
164  'status-status-sorting-light-asc' => [
165  'provider' => FontawesomeIconProvider::class,
166  'options' => [
167  'name' => 'caret-up',
168  ]
169  ],
170  'status-status-sorting-light-desc' => [
171  'provider' => FontawesomeIconProvider::class,
172  'options' => [
173  'name' => 'caret-down',
174  ]
175  ],
176  'status-status-permission-granted' => [
177  'provider' => FontawesomeIconProvider::class,
178  'options' => [
179  'name' => 'check',
180  ]
181  ],
182  'status-status-permission-denied' => [
183  'provider' => FontawesomeIconProvider::class,
184  'options' => [
185  'name' => 'times',
186  ]
187  ],
188 
189  // Empty
190  'empty-empty' => [
191  'provider' => FontawesomeIconProvider::class,
192  'options' => [
193  'name' => 'empty-empty',
194  ]
195  ],
196 
197  // System Information
198  'information-php-version' => [
199  'provider' => FontawesomeIconProvider::class,
200  'options' => [
201  'name' => 'code'
202  ]
203  ],
204  'information-database' => [
205  'provider' => FontawesomeIconProvider::class,
206  'options' => [
207  'name' => 'database'
208  ]
209  ],
210  'information-application-context' => [
211  'provider' => FontawesomeIconProvider::class,
212  'options' => [
213  'name' => 'tasks'
214  ]
215  ],
216  'information-composer-mode' => [
217  'provider' => FontawesomeIconProvider::class,
218  'options' => [
219  'name' => 'music'
220  ]
221  ],
222  'information-git' => [
223  'provider' => FontawesomeIconProvider::class,
224  'options' => [
225  'name' => 'git'
226  ]
227  ],
228  'information-webserver' => [
229  'provider' => FontawesomeIconProvider::class,
230  'options' => [
231  'name' => 'server'
232  ]
233  ],
234  'information-os-linux' => [
235  'provider' => FontawesomeIconProvider::class,
236  'options' => [
237  'name' => 'linux'
238  ]
239  ],
240  'information-os-apple' => [
241  'provider' => FontawesomeIconProvider::class,
242  'options' => [
243  'name' => 'apple'
244  ]
245  ],
246  'information-os-windows' => [
247  'provider' => FontawesomeIconProvider::class,
248  'options' => [
249  'name' => 'windows'
250  ]
251  ],
252 
253  // Sysnote
254  'sysnote-type-0' => [
255  'provider' => FontawesomeIconProvider::class,
256  'options' => [
257  'name' => 'sticky-note-o'
258  ]
259  ],
260  'sysnote-type-1' => [
261  'provider' => FontawesomeIconProvider::class,
262  'options' => [
263  'name' => 'cog'
264  ]
265  ],
266  'sysnote-type-2' => [
267  'provider' => FontawesomeIconProvider::class,
268  'options' => [
269  'name' => 'code'
270  ]
271  ],
272  'sysnote-type-3' => [
273  'provider' => FontawesomeIconProvider::class,
274  'options' => [
275  'name' => 'thumb-tack'
276  ]
277  ],
278  'sysnote-type-4' => [
279  'provider' => FontawesomeIconProvider::class,
280  'options' => [
281  'name' => 'check-square'
282  ]
283  ]
284  ];
285 
291  protected ‪$fileExtensionMapping = [
292  'htm' => 'mimetypes-text-html',
293  'html' => 'mimetypes-text-html',
294  'css' => 'mimetypes-text-css',
295  'js' => 'mimetypes-text-js',
296  'csv' => 'mimetypes-text-csv',
297  'php' => 'mimetypes-text-php',
298  'php6' => 'mimetypes-text-php',
299  'php5' => 'mimetypes-text-php',
300  'php4' => 'mimetypes-text-php',
301  'php3' => 'mimetypes-text-php',
302  'inc' => 'mimetypes-text-php',
303  'ts' => 'mimetypes-text-ts',
304  'typoscript' => 'mimetypes-text-typoscript',
305  'txt' => 'mimetypes-text-text',
306  'class' => 'mimetypes-text-text',
307  'tmpl' => 'mimetypes-text-text',
308  'jpg' => 'mimetypes-media-image',
309  'jpeg' => 'mimetypes-media-image',
310  'gif' => 'mimetypes-media-image',
311  'png' => 'mimetypes-media-image',
312  'bmp' => 'mimetypes-media-image',
313  'tif' => 'mimetypes-media-image',
314  'tiff' => 'mimetypes-media-image',
315  'tga' => 'mimetypes-media-image',
316  'psd' => 'mimetypes-media-image',
317  'eps' => 'mimetypes-media-image',
318  'ai' => 'mimetypes-media-image',
319  'svg' => 'mimetypes-media-image',
320  'pcx' => 'mimetypes-media-image',
321  'avi' => 'mimetypes-media-video',
322  'mpg' => 'mimetypes-media-video',
323  'mpeg' => 'mimetypes-media-video',
324  'mov' => 'mimetypes-media-video',
325  'vimeo' => 'mimetypes-media-video-vimeo',
326  'youtube' => 'mimetypes-media-video-youtube',
327  'wav' => 'mimetypes-media-audio',
328  'mp3' => 'mimetypes-media-audio',
329  'ogg' => 'mimetypes-media-audio',
330  'flac' => 'mimetypes-media-audio',
331  'opus' => 'mimetypes-media-audio',
332  'mid' => 'mimetypes-media-audio',
333  'swf' => 'mimetypes-media-flash',
334  'swa' => 'mimetypes-media-flash',
335  'exe' => 'mimetypes-application',
336  'com' => 'mimetypes-application',
337  't3x' => 'mimetypes-compressed',
338  't3d' => 'mimetypes-compressed',
339  'zip' => 'mimetypes-compressed',
340  'tgz' => 'mimetypes-compressed',
341  'gz' => 'mimetypes-compressed',
342  'pdf' => 'mimetypes-pdf',
343  'doc' => 'mimetypes-word',
344  'dot' => 'mimetypes-word',
345  'docm' => 'mimetypes-word',
346  'docx' => 'mimetypes-word',
347  'dotm' => 'mimetypes-word',
348  'dotx' => 'mimetypes-word',
349  'sxw' => 'mimetypes-word',
350  'rtf' => 'mimetypes-word',
351  'xls' => 'mimetypes-excel',
352  'xlsm' => 'mimetypes-excel',
353  'xlsx' => 'mimetypes-excel',
354  'xltm' => 'mimetypes-excel',
355  'xltx' => 'mimetypes-excel',
356  'sxc' => 'mimetypes-excel',
357  'pps' => 'mimetypes-powerpoint',
358  'ppsx' => 'mimetypes-powerpoint',
359  'ppt' => 'mimetypes-powerpoint',
360  'pptm' => 'mimetypes-powerpoint',
361  'pptx' => 'mimetypes-powerpoint',
362  'potm' => 'mimetypes-powerpoint',
363  'potx' => 'mimetypes-powerpoint',
364  'mount' => 'apps-filetree-mount',
365  'folder' => 'apps-filetree-folder-default',
366  'default' => 'mimetypes-other-other',
367  ];
368 
374  protected ‪$mimeTypeMapping = [
375  'video/*' => 'mimetypes-media-video',
376  'audio/*' => 'mimetypes-media-audio',
377  'image/*' => 'mimetypes-media-image',
378  'text/*' => 'mimetypes-text-text',
379  ];
380 
384  protected $iconAliases = [];
385 
399  protected $deprecatedIcons = [
400  'module-web' => 'modulegroup-web',
401  'module-site' => 'modulegroup-site',
402  'module-file' => 'modulegroup-file',
403  'module-tools' => 'modulegroup-tools',
404  'module-system' => 'modulegroup-system',
405  'module-help' => 'modulegroup-help',
406  'module-workspaces-action-preview-link' => 'actions-version-workspaces-preview-link',
407  'generate-ws-preview-link' => 'actions-version-workspaces-preview-link',
408  'extensions-workspaces-generatepreviewlink' => 'actions-version-workspaces-preview-link',
409  'extensions-extensionmanager-update-script' => 'actions-refresh',
410  'extensions-scheduler-run-task' => 'actions-play',
411  'extensions-scheduler-run-task-cron' => 'actions-clock',
412  'status-warning-lock' => 'warning-lock',
413  'status-warning-in-use' => 'warning-in-use',
414  'status-status-edit-read-only' => 'status-edit-read-only',
415  't3-form-icon-advanced-password' => 'form-advanced-password',
416  't3-form-icon-checkbox' => 'form-checkbox',
417  't3-form-icon-content-element' => 'form-content-element',
418  't3-form-icon-date-picker' => 'form-date-picker',
419  't3-form-icon-duplicate' => 'actions-duplicate',
420  't3-form-icon-email' => 'form-email',
421  't3-form-icon-fieldset' => 'form-fieldset',
422  't3-form-icon-file-upload' => 'form-file-upload',
423  't3-form-icon-finisher' => 'form-finisher',
424  't3-form-icon-form-element-selector' => 'actions-variable-select',
425  't3-form-icon-gridcontainer' => 'form-gridcontainer',
426  't3-form-icon-gridrow' => 'form-gridrow',
427  't3-form-icon-hidden' => 'form-hidden',
428  't3-form-icon-image-upload' => 'form-image-upload',
429  't3-form-icon-insert-after' => 'actions-form-insert-after',
430  't3-form-icon-insert-in' => 'actions-form-insert-in',
431  't3-form-icon-multi-checkbox' => 'form-multi-checkbox',
432  't3-form-icon-multi-select' => 'form-multi-select',
433  't3-form-icon-number' => 'form-number',
434  't3-form-icon-page' => 'form-page',
435  't3-form-icon-password' => 'form-password',
436  't3-form-icon-radio-button' => 'form-radio-button',
437  't3-form-icon-single-select' => 'form-single-select',
438  't3-form-icon-static-text' => 'form-static-text',
439  't3-form-icon-summary-page' => 'form-summary-page',
440  't3-form-icon-telephone' => 'form-telephone',
441  't3-form-icon-text' => 'form-text',
442  't3-form-icon-textarea' => 'form-textarea',
443  't3-form-icon-url' => 'form-url',
444  't3-form-icon-validator' => 'form-validator',
445  ];
446 
450  protected $defaultIconIdentifier = 'default-not-found';
451 
455  protected static $cache = null;
456 
460  public function __construct()
461  {
463  // ext:impexp is no required extension, the target items are located there.
464  // Register its deprecations only if impexp is loaded
465  $this->‪deprecatedIcons['status-status-reference-hard'] = 'status-reference-hard';
466  $this->‪deprecatedIcons['status-status-reference-soft'] = 'status-reference-soft';
467  }
468  $this->‪initialize();
469  }
470 
475  public static function ‪setCache(‪FrontendInterface $cache)
476  {
477  static::$cache = $cache;
478  }
479 
485  protected function ‪initialize()
486  {
487  if (!$this->backendIconsInitialized) {
488  $this->‪getCachedBackendIcons();
489  }
490  if (!$this->tcaInitialized && !empty(‪$GLOBALS['TCA'])) {
491  $this->‪registerTCAIcons();
492  }
493  if (!$this->moduleIconsInitialized && !empty(‪$GLOBALS['TBE_MODULES'])) {
494  $this->‪registerModuleIcons();
495  }
496  if (!$this->flagsInitialized) {
497  $this->‪registerFlags();
498  }
499  if ($this->backendIconsInitialized
500  && $this->tcaInitialized
501  && $this->moduleIconsInitialized
502  && $this->flagsInitialized) {
503  $this->fullInitialized = true;
504  }
505  }
506 
510  protected function ‪getCachedBackendIcons()
511  {
512  $cacheIdentifier = 'BackendIcons_' . sha1((string)(new Typo3Version()) . ‪Environment::getProjectPath() . 'BackendIcons');
514  $assetsCache = static::$cache ?? GeneralUtility::makeInstance(CacheManager::class)->getCache('assets');
515  $cacheEntry = $assetsCache->get($cacheIdentifier);
516 
517  if ($cacheEntry !== false) {
518  $this->icons = $cacheEntry;
519  } else {
520  $this->‪registerBackendIcons();
521  // all found icons should now be present, for historic reasons now merge w/ the statically declared icons
522  $this->icons = array_merge($this->icons, $this->iconAliases, $this->staticIcons);
523  $assetsCache->set($cacheIdentifier, $this->icons);
524  }
525  // if there's now at least one icon registered, consider it successful
526  if (is_array($this->icons) && (count($this->icons) >= count($this->staticIcons))) {
527  $this->backendIconsInitialized = true;
528  }
529  }
530 
534  protected function ‪registerBackendIcons(): void
535  {
536  ‪$dir = dirname($this->backendIconDeclaration);
537  $absoluteIconDeclarationPath = GeneralUtility::getFileAbsFileName($this->backendIconDeclaration);
538  $json = json_decode(file_get_contents($absoluteIconDeclarationPath), true);
539  foreach ($json['icons'] ?? [] as $declaration) {
540  $iconOptions = [
541  'sprite' => ‪$dir . '/' . $declaration['sprite'],
542  'source' => ‪$dir . '/' . $declaration['svg'],
543  ];
544  // kind of hotfix for now, needs a nicer concept later
545  if ($declaration['category'] === 'spinner') {
546  $iconOptions['spinning'] = true;
547  }
548 
549  $this->‪registerIcon(
550  $declaration['identifier'],
551  SvgSpriteIconProvider::class,
552  $iconOptions
553  );
554  }
555 
556  foreach ($json['aliases'] as $alias => $identifier) {
557  $this->‪registerAlias($alias, $identifier);
558  }
559  }
560 
565  public function ‪isRegistered($identifier)
566  {
567  if (!$this->fullInitialized) {
568  $this->‪initialize();
569  }
570  return isset($this->icons[$identifier]);
571  }
572 
577  public function ‪isDeprecated($identifier)
578  {
579  return isset($this->‪deprecatedIcons[$identifier]);
580  }
581 
585  public function ‪getDefaultIconIdentifier()
586  {
587  return $this->defaultIconIdentifier;
588  }
589 
599  public function ‪registerIcon($identifier, $iconProviderClassName, array $options = [])
600  {
601  if (!in_array(IconProviderInterface::class, class_implements($iconProviderClassName), true)) {
602  throw new \InvalidArgumentException('An IconProvider must implement '
603  . IconProviderInterface::class, 1437425803);
604  }
605  $this->icons[$identifier] = [
606  'provider' => $iconProviderClassName,
607  'options' => $options
608  ];
609  }
610 
619  public function ‪registerAlias($alias, $identifier)
620  {
621  if (!isset($this->icons[$identifier])) {
622  throw new \InvalidArgumentException('No icon with identifier "' . $identifier . '" registered.', 1602251838);
623  }
624  $this->iconAliases[$alias] = $this->icons[$identifier];
625  }
626 
633  public function ‪registerFileExtension($fileExtension, $iconIdentifier)
634  {
635  $this->fileExtensionMapping[$fileExtension] = $iconIdentifier;
636  }
637 
644  public function ‪registerMimeTypeIcon($mimeType, $iconIdentifier)
645  {
646  $this->mimeTypeMapping[$mimeType] = $iconIdentifier;
647  }
648 
656  public function ‪getIconConfigurationByIdentifier($identifier)
657  {
658  if (!$this->fullInitialized) {
659  $this->‪initialize();
660  }
661  if ($this->‪isDeprecated($identifier)) {
662  $replacement = $this->‪deprecatedIcons[$identifier] ?? null;
663  if (!empty($replacement)) {
664  $message = 'The icon "%s" is deprecated since TYPO3 v9 and will be removed in TYPO3 v10.0. Please use "%s" instead.';
665  $arguments = [$identifier, $replacement];
666  $identifier = $replacement;
667  } else {
668  $message = 'The icon "%s" is deprecated since TYPO3 v9 and will be removed in TYPO3 v10.0.';
669  $arguments = [$identifier];
670  }
671  trigger_error(vsprintf($message, $arguments), E_USER_DEPRECATED);
672  }
673  if (!$this->‪isRegistered($identifier)) {
674  throw new Exception('Icon with identifier "' . $identifier . '" is not registered"', 1437425804);
675  }
676  return $this->icons[$identifier];
677  }
678 
682  public function ‪getAllRegisteredIconIdentifiers()
683  {
684  if (!$this->fullInitialized) {
685  $this->‪initialize();
686  }
687  return array_keys($this->icons);
688  }
689 
693  public function ‪getDeprecatedIcons(): array
694  {
695  return $this->deprecatedIcons;
696  }
697 
702  public function ‪getIconIdentifierForFileExtension($fileExtension)
703  {
704  // If the file extension is not valid use the default one
705  if (!isset($this->fileExtensionMapping[$fileExtension])) {
706  $fileExtension = 'default';
707  }
708  return $this->fileExtensionMapping[$fileExtension];
709  }
710 
717  public function ‪getIconIdentifierForMimeType($mimeType)
718  {
719  if (!isset($this->mimeTypeMapping[$mimeType])) {
720  return null;
721  }
722  return $this->mimeTypeMapping[$mimeType];
723  }
724 
731  public function ‪getCacheIdentifier(): string
732  {
733  if (!$this->fullInitialized) {
734  $this->‪initialize();
735  }
736 
737  return sha1((string)json_encode($this->icons));
738  }
739 
743  protected function ‪registerTCAIcons()
744  {
745  $resultArray = [];
746 
747  $tcaTables = array_keys(‪$GLOBALS['TCA'] ?? []);
748  // check every table in the TCA, if an icon is needed
749  foreach ($tcaTables as $tableName) {
750  // This method is only needed for TCA tables where typeicon_classes are not configured
751  $iconIdentifier = 'tcarecords-' . $tableName . '-default';
752  if (
753  isset($this->icons[$iconIdentifier])
754  || !isset(‪$GLOBALS['TCA'][$tableName]['ctrl']['iconfile'])
755  ) {
756  continue;
757  }
758  $resultArray[$iconIdentifier] = ‪$GLOBALS['TCA'][$tableName]['ctrl']['iconfile'];
759  }
760 
761  foreach ($resultArray as $iconIdentifier => $iconFilePath) {
762  $iconProviderClass = $this->‪detectIconProvider($iconFilePath);
763  $this->icons[$iconIdentifier] = [
764  'provider' => $iconProviderClass,
765  'options' => [
766  'source' => $iconFilePath
767  ]
768  ];
769  }
770  $this->tcaInitialized = true;
771  }
772 
776  protected function ‪registerModuleIcons()
777  {
778  $moduleConfiguration = ‪$GLOBALS['TBE_MODULES']['_configuration'] ?? [];
779  foreach ($moduleConfiguration as $moduleKey => $singleModuleConfiguration) {
780  $iconIdentifier = !empty($singleModuleConfiguration['iconIdentifier'])
781  ? $singleModuleConfiguration['iconIdentifier']
782  : null;
783 
784  if ($iconIdentifier !== null) {
785  // iconIdentifier found, icon is registered, continue
786  continue;
787  }
788 
789  $iconPath = !empty($singleModuleConfiguration['icon'])
790  ? $singleModuleConfiguration['icon']
791  : null;
792  $iconProviderClass = $this->‪detectIconProvider($iconPath);
793  $iconIdentifier = 'module-icon-' . $moduleKey;
794 
795  $this->icons[$iconIdentifier] = [
796  'provider' => $iconProviderClass,
797  'options' => [
798  'source' => $iconPath
799  ]
800  ];
801  }
802  $this->moduleIconsInitialized = true;
803  }
804 
808  protected function ‪registerFlags()
809  {
810  $iconFolder = 'EXT:core/Resources/Public/Icons/Flags/';
811  $files = [
812  'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AN', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ',
813  'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ',
814  'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CS', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ',
815  'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ',
816  'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'EU',
817  'FI', 'FJ', 'FK', 'FM', 'FO', 'FR',
818  'GA', 'GB-ENG', 'GB-NIR', 'GB-SCT', 'GB-WLS', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY',
819  'HK', 'HM', 'HN', 'HR', 'HT', 'HU',
820  'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT',
821  'JE', 'JM', 'JO', 'JP',
822  'KE', 'KG', 'KH', 'KI', 'KL', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ',
823  'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY',
824  'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MI', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ',
825  'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ',
826  'OM',
827  'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY',
828  'QA', 'QC',
829  'RE', 'RO', 'RS', 'RU', 'RW',
830  'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ',
831  'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ',
832  'UA', 'UG', 'UM', 'US', 'UY', 'UZ',
833  'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU',
834  'WF', 'WS',
835  'YE', 'YT',
836  'ZA', 'ZM', 'ZW',
837  // Special Flags
838  'catalonia',
839  'multiple',
840  'en-us-gb'
841  ];
842  foreach ($files as $file) {
843  $identifier = strtolower($file);
844  $this->icons['flags-' . $identifier] = [
845  'provider' => BitmapIconProvider::class,
846  'options' => [
847  'source' => $iconFolder . $file . '.png'
848  ]
849  ];
850  }
851  $this->flagsInitialized = true;
852  }
853 
860  public function ‪detectIconProvider($iconReference)
861  {
862  if (‪StringUtility::endsWith(strtolower($iconReference), 'svg')) {
863  return SvgIconProvider::class;
864  }
865  return BitmapIconProvider::class;
866  }
867 }
‪TYPO3\CMS\Core\Imaging\IconRegistry\$staticIcons
‪array $staticIcons
Definition: IconRegistry.php:83
‪TYPO3\CMS\Core\Imaging\IconRegistry\getCacheIdentifier
‪string getCacheIdentifier()
Definition: IconRegistry.php:716
‪TYPO3\CMS\Core\Imaging
Definition: Dimension.php:16
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerMimeTypeIcon
‪registerMimeTypeIcon($mimeType, $iconIdentifier)
Definition: IconRegistry.php:629
‪TYPO3\CMS\Core\Imaging\IconRegistry\getIconIdentifierForMimeType
‪string null getIconIdentifierForMimeType($mimeType)
Definition: IconRegistry.php:702
‪TYPO3\CMS\Core\Imaging\IconRegistry\getIconIdentifierForFileExtension
‪string getIconIdentifierForFileExtension($fileExtension)
Definition: IconRegistry.php:687
‪TYPO3\CMS\Core\Imaging\IconRegistry\$icons
‪array $icons
Definition: IconRegistry.php:63
‪TYPO3\CMS\Core\Utility\StringUtility\endsWith
‪static bool endsWith($haystack, $needle)
Definition: StringUtility.php:61
‪TYPO3\CMS\Core\Imaging\IconRegistry\getCachedBackendIcons
‪getCachedBackendIcons()
Definition: IconRegistry.php:495
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerFlags
‪registerFlags()
Definition: IconRegistry.php:793
‪TYPO3\CMS\Core\Information\Typo3Version
Definition: Typo3Version.php:21
‪TYPO3\CMS\Core\Exception
Definition: Exception.php:22
‪TYPO3\CMS\Core\Imaging\IconRegistry\$backendIconsInitialized
‪bool $backendIconsInitialized
Definition: IconRegistry.php:57
‪TYPO3\CMS\Core\Imaging\IconRegistry\$tcaInitialized
‪bool $tcaInitialized
Definition: IconRegistry.php:45
‪TYPO3\CMS\Core\Exception
‪TYPO3\CMS\Core\Imaging\IconRegistry\getDeprecatedIcons
‪array getDeprecatedIcons()
Definition: IconRegistry.php:678
‪$dir
‪$dir
Definition: validateRstFiles.php:213
‪TYPO3\CMS\Core\Imaging\IconRegistry\$fileExtensionMapping
‪string[] $fileExtensionMapping
Definition: IconRegistry.php:281
‪TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider
Definition: BitmapIconProvider.php:27
‪TYPO3\CMS\Core\Imaging\IconRegistry\getDefaultIconIdentifier
‪string getDefaultIconIdentifier()
Definition: IconRegistry.php:570
‪TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider
Definition: FontawesomeIconProvider.php:25
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:43
‪TYPO3\CMS\Core\Core\Environment\getProjectPath
‪static string getProjectPath()
Definition: Environment.php:169
‪TYPO3\CMS\Core\Imaging\IconRegistry\$flagsInitialized
‪bool $flagsInitialized
Definition: IconRegistry.php:49
‪TYPO3\CMS\Core\Imaging\IconRegistry\isRegistered
‪bool isRegistered($identifier)
Definition: IconRegistry.php:550
‪TYPO3\CMS\Core\Imaging\IconRegistry\$mimeTypeMapping
‪string[] $mimeTypeMapping
Definition: IconRegistry.php:363
‪TYPO3\CMS\Core\Imaging\IconProvider\SvgSpriteIconProvider
Definition: SvgSpriteIconProvider.php:31
‪TYPO3\CMS\Core\Imaging\IconRegistry\isDeprecated
‪bool isDeprecated($identifier)
Definition: IconRegistry.php:562
‪TYPO3\CMS\Core\Cache\Frontend\VariableFrontend
Definition: VariableFrontend.php:25
‪TYPO3\CMS\Core\Imaging\IconRegistry\getIconConfigurationByIdentifier
‪mixed getIconConfigurationByIdentifier($identifier)
Definition: IconRegistry.php:641
‪TYPO3\CMS\Core\Imaging\IconRegistry\getAllRegisteredIconIdentifiers
‪array getAllRegisteredIconIdentifiers()
Definition: IconRegistry.php:667
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerIcon
‪registerIcon($identifier, $iconProviderClassName, array $options=[])
Definition: IconRegistry.php:584
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerModuleIcons
‪registerModuleIcons()
Definition: IconRegistry.php:761
‪TYPO3\CMS\Core\Imaging\IconRegistry
Definition: IconRegistry.php:38
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:35
‪TYPO3\CMS\Core\Imaging\IconRegistry\$backendIconDeclaration
‪string $backendIconDeclaration
Definition: IconRegistry.php:67
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerFileExtension
‪registerFileExtension($fileExtension, $iconIdentifier)
Definition: IconRegistry.php:618
‪TYPO3\CMS\Core\Imaging\IconRegistry\deprecatedIcons
‪array< string, $iconAliases=array();protected array $deprecatedIcons=array('module-web'=> 'modulegroup-web', 'module-site'=> 'modulegroup-site', 'module-file'=> 'modulegroup-file', 'module-tools'=> 'modulegroup-tools', 'module-system'=> 'modulegroup-system', 'module-help'=> 'modulegroup-help', 'module-workspaces-action-preview-link'=> 'actions-version-workspaces-preview-link', 'generate-ws-preview-link'=> 'actions-version-workspaces-preview-link', 'extensions-workspaces-generatepreviewlink'=> 'actions-version-workspaces-preview-link', 'extensions-extensionmanager-update-script'=> 'actions-refresh', 'extensions-scheduler-run-task'=> 'actions-play', 'extensions-scheduler-run-task-cron'=> 'actions-clock', 'status-warning-lock'=> 'warning-lock', 'status-warning-in-use'=> 'warning-in-use', 'status-status-edit-read-only'=> 'status-edit-read-only', 't3-form-icon-advanced-password'=> 'form-advanced-password', 't3-form-icon-checkbox'=> 'form-checkbox', 't3-form-icon-content-element'=> 'form-content-element', 't3-form-icon-date-picker'=> 'form-date-picker', 't3-form-icon-duplicate'=> 'actions-duplicate', 't3-form-icon-email'=> 'form-email', 't3-form-icon-fieldset'=> 'form-fieldset', 't3-form-icon-file-upload'=> 'form-file-upload', 't3-form-icon-finisher'=> 'form-finisher', 't3-form-icon-form-element-selector'=> 'actions-variable-select', 't3-form-icon-gridcontainer'=> 'form-gridcontainer', 't3-form-icon-gridrow'=> 'form-gridrow', 't3-form-icon-hidden'=> 'form-hidden', 't3-form-icon-image-upload'=> 'form-image-upload', 't3-form-icon-insert-after'=> 'actions-form-insert-after', 't3-form-icon-insert-in'=> 'actions-form-insert-in', 't3-form-icon-multi-checkbox'=> 'form-multi-checkbox', 't3-form-icon-multi-select'=> 'form-multi-select', 't3-form-icon-number'=> 'form-number', 't3-form-icon-page'=> 'form-page', 't3-form-icon-password'=> 'form-password', 't3-form-icon-radio-button'=> 'form-radio-button', 't3-form-icon-single-select'=> 'form-single-select', 't3-form-icon-static-text'=> 'form-static-text', 't3-form-icon-summary-page'=> 'form-summary-page', 't3-form-icon-telephone'=> 'form-telephone', 't3-form-icon-text'=> 'form-text', 't3-form-icon-textarea'=> 'form-textarea', 't3-form-icon-url'=> 'form-url', 't3-form-icon-validator'=> 'form-validator',);protected string $defaultIconIdentifier='default-not-found';protected static FrontendInterface $cache=null;public function __construct() { if(ExtensionManagementUtility::isLoaded( 'impexp')) { $this-> deprecatedIcons['status-status-reference-hard']
Definition: IconRegistry.php:450
‪TYPO3\CMS\Core\Imaging\IconRegistry\$fullInitialized
‪bool $fullInitialized
Definition: IconRegistry.php:41
‪TYPO3\CMS\Core\Imaging\IconRegistry\$moduleIconsInitialized
‪bool $moduleIconsInitialized
Definition: IconRegistry.php:53
‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
Definition: FrontendInterface.php:22
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:23
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:40
‪TYPO3\CMS\Core\Imaging\IconRegistry\$backendIconAllowedExtensionsWithProvider
‪string[] $backendIconAllowedExtensionsWithProvider
Definition: IconRegistry.php:73
‪TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider
Definition: SvgIconProvider.php:27
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Imaging\IconRegistry\initialize
‪initialize()
Definition: IconRegistry.php:470
‪TYPO3\CMS\Core\Imaging\IconRegistry\detectIconProvider
‪string detectIconProvider($iconReference)
Definition: IconRegistry.php:845
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerTCAIcons
‪registerTCAIcons()
Definition: IconRegistry.php:728
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerAlias
‪registerAlias($alias, $identifier)
Definition: IconRegistry.php:604
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded
‪static bool isLoaded($key)
Definition: ExtensionManagementUtility.php:114
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerBackendIcons
‪registerBackendIcons()
Definition: IconRegistry.php:519
‪TYPO3\CMS\Core\Imaging\IconRegistry\setCache
‪static setCache(FrontendInterface $cache)
Definition: IconRegistry.php:460