‪TYPO3CMS  9.5
IconRegistry.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use Symfony\Component\Finder\Finder;
28 
34 {
38  protected ‪$fullInitialized = false;
39 
43  protected ‪$tcaInitialized = false;
44 
48  protected ‪$flagsInitialized = false;
49 
53  protected ‪$moduleIconsInitialized = false;
54 
58  protected ‪$backendIconsInitialized = false;
59 
65  protected ‪$icons = [];
66 
72  protected ‪$backendIconPaths = [
73  'EXT:backend/Resources/Public/Icons/',
74  'EXT:core/Resources/Public/Icons/T3Icons/',
75  'EXT:impexp/Resources/Public/Icons/',
76  'EXT:install/Resources/Public/Icons/'
77  ];
78 
85  'png' => BitmapIconProvider::class,
86  'svg' => SvgIconProvider::class
87  ];
88 
95  protected ‪$staticIcons = [
96 
104  // Apps
105  'apps-pagetree-category-toggle-hide-checked' => [
106  'provider' => FontawesomeIconProvider::class,
107  'options' => [
108  'name' => 'check-square'
109  ]
110  ],
111 
112  // Module
113  'module-web' => [
114  'provider' => FontawesomeIconProvider::class,
115  'options' => [
116  'name' => 'file-o'
117  ]
118  ],
119  'module-site' => [
120  'provider' => FontawesomeIconProvider::class,
121  'options' => [
122  'name' => 'globe'
123  ]
124  ],
125  'module-file' => [
126  'provider' => FontawesomeIconProvider::class,
127  'options' => [
128  'name' => 'image'
129  ]
130  ],
131  'module-tools' => [
132  'provider' => FontawesomeIconProvider::class,
133  'options' => [
134  'name' => 'rocket'
135  ]
136  ],
137  'module-system' => [
138  'provider' => FontawesomeIconProvider::class,
139  'options' => [
140  'name' => 'plug'
141  ]
142  ],
143  'module-help' => [
144  'provider' => FontawesomeIconProvider::class,
145  'options' => [
146  'name' => 'question-circle'
147  ]
148  ],
149 
150  // Status
151  'status-dialog-information' => [
152  'provider' => FontawesomeIconProvider::class,
153  'options' => [
154  'name' => 'exclamation-circle'
155  ]
156  ],
157  'status-dialog-ok' => [
158  'provider' => FontawesomeIconProvider::class,
159  'options' => [
160  'name' => 'check-circle',
161  ]
162  ],
163  'status-dialog-notification' => [
164  'provider' => FontawesomeIconProvider::class,
165  'options' => [
166  'name' => 'exclamation-circle'
167  ]
168  ],
169  'status-dialog-warning' => [
170  'provider' => FontawesomeIconProvider::class,
171  'options' => [
172  'name' => 'exclamation-triangle'
173  ]
174  ],
175  'status-dialog-error' => [
176  'provider' => FontawesomeIconProvider::class,
177  'options' => [
178  'name' => 'exclamation-circle'
179  ]
180  ],
181  'status-status-checked' => [
182  'provider' => FontawesomeIconProvider::class,
183  'options' => [
184  'name' => 'check',
185  ]
186  ],
187  'status-status-current' => [
188  'provider' => FontawesomeIconProvider::class,
189  'options' => [
190  'name' => 'caret-right',
191  ]
192  ],
193  'status-status-sorting-asc' => [
194  'provider' => FontawesomeIconProvider::class,
195  'options' => [
196  'name' => 'caret-up',
197  ]
198  ],
199  'status-status-sorting-desc' => [
200  'provider' => FontawesomeIconProvider::class,
201  'options' => [
202  'name' => 'caret-down',
203  ]
204  ],
205  'status-status-sorting-light-asc' => [
206  'provider' => FontawesomeIconProvider::class,
207  'options' => [
208  'name' => 'caret-up',
209  ]
210  ],
211  'status-status-sorting-light-desc' => [
212  'provider' => FontawesomeIconProvider::class,
213  'options' => [
214  'name' => 'caret-down',
215  ]
216  ],
217  'status-status-permission-granted' => [
218  'provider' => FontawesomeIconProvider::class,
219  'options' => [
220  'name' => 'check',
221  ]
222  ],
223  'status-status-permission-denied' => [
224  'provider' => FontawesomeIconProvider::class,
225  'options' => [
226  'name' => 'times',
227  ]
228  ],
229 
230  // Empty
231  'empty-empty' => [
232  'provider' => FontawesomeIconProvider::class,
233  'options' => [
234  'name' => 'empty-empty',
235  ]
236  ],
237 
238  // System Information
239  'information-php-version' => [
240  'provider' => FontawesomeIconProvider::class,
241  'options' => [
242  'name' => 'code'
243  ]
244  ],
245  'information-database' => [
246  'provider' => FontawesomeIconProvider::class,
247  'options' => [
248  'name' => 'database'
249  ]
250  ],
251  'information-application-context' => [
252  'provider' => FontawesomeIconProvider::class,
253  'options' => [
254  'name' => 'tasks'
255  ]
256  ],
257  'information-composer-mode' => [
258  'provider' => FontawesomeIconProvider::class,
259  'options' => [
260  'name' => 'music'
261  ]
262  ],
263  'information-git' => [
264  'provider' => FontawesomeIconProvider::class,
265  'options' => [
266  'name' => 'git'
267  ]
268  ],
269  'information-webserver' => [
270  'provider' => FontawesomeIconProvider::class,
271  'options' => [
272  'name' => 'server'
273  ]
274  ],
275  'information-os-linux' => [
276  'provider' => FontawesomeIconProvider::class,
277  'options' => [
278  'name' => 'linux'
279  ]
280  ],
281  'information-os-apple' => [
282  'provider' => FontawesomeIconProvider::class,
283  'options' => [
284  'name' => 'apple'
285  ]
286  ],
287  'information-os-windows' => [
288  'provider' => FontawesomeIconProvider::class,
289  'options' => [
290  'name' => 'windows'
291  ]
292  ],
293 
294  // Sysnote
295  'sysnote-type-0' => [
296  'provider' => FontawesomeIconProvider::class,
297  'options' => [
298  'name' => 'sticky-note-o'
299  ]
300  ],
301  'sysnote-type-1' => [
302  'provider' => FontawesomeIconProvider::class,
303  'options' => [
304  'name' => 'cog'
305  ]
306  ],
307  'sysnote-type-2' => [
308  'provider' => FontawesomeIconProvider::class,
309  'options' => [
310  'name' => 'code'
311  ]
312  ],
313  'sysnote-type-3' => [
314  'provider' => FontawesomeIconProvider::class,
315  'options' => [
316  'name' => 'thumb-tack'
317  ]
318  ],
319  'sysnote-type-4' => [
320  'provider' => FontawesomeIconProvider::class,
321  'options' => [
322  'name' => 'check-square'
323  ]
324  ]
325  ];
326 
332  protected ‪$fileExtensionMapping = [
333  'htm' => 'mimetypes-text-html',
334  'html' => 'mimetypes-text-html',
335  'css' => 'mimetypes-text-css',
336  'js' => 'mimetypes-text-js',
337  'csv' => 'mimetypes-text-csv',
338  'php' => 'mimetypes-text-php',
339  'php6' => 'mimetypes-text-php',
340  'php5' => 'mimetypes-text-php',
341  'php4' => 'mimetypes-text-php',
342  'php3' => 'mimetypes-text-php',
343  'inc' => 'mimetypes-text-php',
344  'ts' => 'mimetypes-text-ts',
345  'typoscript' => 'mimetypes-text-typoscript',
346  'txt' => 'mimetypes-text-text',
347  'class' => 'mimetypes-text-text',
348  'tmpl' => 'mimetypes-text-text',
349  'jpg' => 'mimetypes-media-image',
350  'jpeg' => 'mimetypes-media-image',
351  'gif' => 'mimetypes-media-image',
352  'png' => 'mimetypes-media-image',
353  'bmp' => 'mimetypes-media-image',
354  'tif' => 'mimetypes-media-image',
355  'tiff' => 'mimetypes-media-image',
356  'tga' => 'mimetypes-media-image',
357  'psd' => 'mimetypes-media-image',
358  'eps' => 'mimetypes-media-image',
359  'ai' => 'mimetypes-media-image',
360  'svg' => 'mimetypes-media-image',
361  'pcx' => 'mimetypes-media-image',
362  'avi' => 'mimetypes-media-video',
363  'mpg' => 'mimetypes-media-video',
364  'mpeg' => 'mimetypes-media-video',
365  'mov' => 'mimetypes-media-video',
366  'vimeo' => 'mimetypes-media-video-vimeo',
367  'youtube' => 'mimetypes-media-video-youtube',
368  'wav' => 'mimetypes-media-audio',
369  'mp3' => 'mimetypes-media-audio',
370  'ogg' => 'mimetypes-media-audio',
371  'flac' => 'mimetypes-media-audio',
372  'opus' => 'mimetypes-media-audio',
373  'mid' => 'mimetypes-media-audio',
374  'swf' => 'mimetypes-media-flash',
375  'swa' => 'mimetypes-media-flash',
376  'exe' => 'mimetypes-application',
377  'com' => 'mimetypes-application',
378  't3x' => 'mimetypes-compressed',
379  't3d' => 'mimetypes-compressed',
380  'zip' => 'mimetypes-compressed',
381  'tgz' => 'mimetypes-compressed',
382  'gz' => 'mimetypes-compressed',
383  'pdf' => 'mimetypes-pdf',
384  'doc' => 'mimetypes-word',
385  'dot' => 'mimetypes-word',
386  'docm' => 'mimetypes-word',
387  'docx' => 'mimetypes-word',
388  'dotm' => 'mimetypes-word',
389  'dotx' => 'mimetypes-word',
390  'sxw' => 'mimetypes-word',
391  'rtf' => 'mimetypes-word',
392  'xls' => 'mimetypes-excel',
393  'xlsm' => 'mimetypes-excel',
394  'xlsx' => 'mimetypes-excel',
395  'xltm' => 'mimetypes-excel',
396  'xltx' => 'mimetypes-excel',
397  'sxc' => 'mimetypes-excel',
398  'pps' => 'mimetypes-powerpoint',
399  'ppsx' => 'mimetypes-powerpoint',
400  'ppt' => 'mimetypes-powerpoint',
401  'pptm' => 'mimetypes-powerpoint',
402  'pptx' => 'mimetypes-powerpoint',
403  'potm' => 'mimetypes-powerpoint',
404  'potx' => 'mimetypes-powerpoint',
405  'mount' => 'apps-filetree-mount',
406  'folder' => 'apps-filetree-folder-default',
407  'default' => 'mimetypes-other-other',
408  ];
409 
415  protected ‪$mimeTypeMapping = [
416  'video/*' => 'mimetypes-media-video',
417  'audio/*' => 'mimetypes-media-audio',
418  'image/*' => 'mimetypes-media-image',
419  'text/*' => 'mimetypes-text-text',
420  ];
421 
435  protected ‪$deprecatedIcons = [
436  'module-workspaces-action-preview-link' => 'actions-version-workspaces-preview-link',
437  'generate-ws-preview-link' => 'actions-version-workspaces-preview-link',
438  'extensions-workspaces-generatepreviewlink' => 'actions-version-workspaces-preview-link',
439  'extensions-extensionmanager-update-script' => 'actions-refresh',
440  'extensions-scheduler-run-task' => 'actions-play',
441  'extensions-scheduler-run-task-cron' => 'actions-clock',
442  'status-warning-lock' => 'warning-lock',
443  'status-warning-in-use' => 'warning-in-use',
444  'status-status-reference-hard' => 'status-reference-hard',
445  'status-status-reference-soft' => 'status-reference-soft',
446  'status-status-edit-read-only' => 'status-edit-read-only',
447  't3-form-icon-advanced-password' => 'form-advanced-password',
448  't3-form-icon-checkbox' => 'form-checkbox',
449  't3-form-icon-content-element' => 'form-content-element',
450  't3-form-icon-date-picker' => 'form-date-picker',
451  't3-form-icon-duplicate' => 'actions-duplicate',
452  't3-form-icon-email' => 'form-email',
453  't3-form-icon-fieldset' => 'form-fieldset',
454  't3-form-icon-file-upload' => 'form-file-upload',
455  't3-form-icon-finisher' => 'form-finisher',
456  't3-form-icon-form-element-selector' => 'actions-variable-select',
457  't3-form-icon-gridcontainer' => 'form-gridcontainer',
458  't3-form-icon-gridrow' => 'form-gridrow',
459  't3-form-icon-hidden' => 'form-hidden',
460  't3-form-icon-image-upload' => 'form-image-upload',
461  't3-form-icon-insert-after' => 'actions-form-insert-after',
462  't3-form-icon-insert-in' => 'actions-form-insert-in',
463  't3-form-icon-multi-checkbox' => 'form-multi-checkbox',
464  't3-form-icon-multi-select' => 'form-multi-select',
465  't3-form-icon-number' => 'form-number',
466  't3-form-icon-page' => 'form-page',
467  't3-form-icon-password' => 'form-password',
468  't3-form-icon-radio-button' => 'form-radio-button',
469  't3-form-icon-single-select' => 'form-single-select',
470  't3-form-icon-static-text' => 'form-static-text',
471  't3-form-icon-summary-page' => 'form-summary-page',
472  't3-form-icon-telephone' => 'form-telephone',
473  't3-form-icon-text' => 'form-text',
474  't3-form-icon-textarea' => 'form-textarea',
475  't3-form-icon-url' => 'form-url',
476  't3-form-icon-validator' => 'form-validator',
477  ];
478 
482  protected ‪$defaultIconIdentifier = 'default-not-found';
483 
487  protected static ‪$cache = null;
488 
492  public function ‪__construct()
493  {
494  $this->‪initialize();
495  }
496 
501  public static function ‪setCache(‪FrontendInterface ‪$cache)
502  {
503  static::$cache = ‪$cache;
504  }
505 
511  protected function ‪initialize()
512  {
513  if (!$this->backendIconsInitialized) {
514  $this->‪getCachedBackendIcons();
515  }
516  if (!$this->tcaInitialized && !empty(‪$GLOBALS['TCA'])) {
517  $this->‪registerTCAIcons();
518  }
519  if (!$this->moduleIconsInitialized && !empty(‪$GLOBALS['TBE_MODULES'])) {
520  $this->‪registerModuleIcons();
521  }
522  if (!$this->flagsInitialized) {
523  $this->‪registerFlags();
524  }
525  if ($this->backendIconsInitialized
526  && $this->tcaInitialized
527  && $this->moduleIconsInitialized
528  && $this->flagsInitialized) {
529  $this->fullInitialized = true;
530  }
531  }
532 
536  protected function ‪getCachedBackendIcons()
537  {
538  $cacheIdentifier = 'BackendIcons_' . sha1(TYPO3_version . ‪Environment::getProjectPath() . 'BackendIcons');
540  $assetsCache = static::$cache ?? GeneralUtility::makeInstance(CacheManager::class)->getCache('assets');
541  $cacheEntry = $assetsCache->get($cacheIdentifier);
542 
543  if ($cacheEntry !== false) {
544  $this->icons = $cacheEntry;
545  } else {
547  // all found icons should now be present, for historic reasons now merge w/ the statically declared icons
548  $this->icons = array_merge($this->icons, $this->staticIcons);
549  $assetsCache->set($cacheIdentifier, $this->icons);
550  }
551  // if there's now at least one icon registered, consider it successful
552  if (is_array($this->icons) && (count($this->icons) >= count($this->staticIcons))) {
553  $this->backendIconsInitialized = true;
554  }
555  }
556 
560  protected function ‪registerBackendIcons()
561  {
562  foreach ($this->backendIconPaths as $iconPath) {
563  $absoluteIconFolderPath = GeneralUtility::getFileAbsFileName($iconPath);
564  if ($absoluteIconFolderPath === '' || !is_readable($absoluteIconFolderPath)) {
565  // maybe EXT:path could not be resolved, then ignore
566  continue;
567  }
568 
569  ‪$finder = new Finder();
570  ‪$finder
571  ->files()
572  ->in($absoluteIconFolderPath)
573  ->name('/\.(' . implode('|', array_keys($this->backendIconAllowedExtensionsWithProvider)) . ')$/');
574 
575  foreach (‪$finder as $iconFile) {
576  // ignore icons that are used as extension icon in extension manager
577  // @see ExtensionManagementUtility::getExtensionIcon()
578  if (strpos($iconFile->getRelativePathname(), 'Extension.') === 0) {
579  continue;
580  }
581  $iconOptions = [
582  'source' => $iconPath . GeneralUtility::fixWindowsFilePath($iconFile->getRelativePathname())
583  ];
584  // kind of hotfix for now, needs a nicer concept later
585  if (strpos($iconFile->getFilename(), 'spinner') === 0) {
586  $iconOptions['spinning'] = true;
587  }
588 
589  $this->‪registerIcon(
590  $iconFile->getBasename('.' . $iconFile->getExtension()),
591  $this->backendIconAllowedExtensionsWithProvider[$iconFile->getExtension()],
592  $iconOptions
593  );
594  }
595  }
596  }
597 
602  public function ‪isRegistered($identifier)
603  {
604  if (!$this->fullInitialized) {
605  $this->‪initialize();
606  }
607  return isset($this->icons[$identifier]);
608  }
609 
614  public function ‪isDeprecated($identifier)
615  {
616  return isset($this->deprecatedIcons[$identifier]);
617  }
618 
622  public function ‪getDefaultIconIdentifier()
623  {
625  }
626 
636  public function ‪registerIcon($identifier, $iconProviderClassName, array $options = [])
637  {
638  if (!in_array(IconProviderInterface::class, class_implements($iconProviderClassName), true)) {
639  throw new \InvalidArgumentException('An IconProvider must implement '
640  . IconProviderInterface::class, 1437425803);
641  }
642  $this->icons[$identifier] = [
643  'provider' => $iconProviderClassName,
644  'options' => $options
645  ];
646  }
647 
654  public function ‪registerFileExtension($fileExtension, $iconIdentifier)
655  {
656  $this->fileExtensionMapping[$fileExtension] = $iconIdentifier;
657  }
658 
665  public function ‪registerMimeTypeIcon($mimeType, $iconIdentifier)
666  {
667  $this->mimeTypeMapping[$mimeType] = $iconIdentifier;
668  }
669 
677  public function ‪getIconConfigurationByIdentifier($identifier)
678  {
679  if (!$this->fullInitialized) {
680  $this->‪initialize();
681  }
682  if ($this->‪isDeprecated($identifier)) {
683  $replacement = $this->deprecatedIcons[$identifier] ?? null;
684  if (!empty($replacement)) {
685  $message = 'The icon "%s" is deprecated since TYPO3 v9 and will be removed in TYPO3 v10.0. Please use "%s" instead.';
686  $arguments = [$identifier, $replacement];
687  $identifier = $replacement;
688  } else {
689  $message = 'The icon "%s" is deprecated since TYPO3 v9 and will be removed in TYPO3 v10.0.';
690  $arguments = [$identifier];
691  }
692  trigger_error(vsprintf($message, $arguments), E_USER_DEPRECATED);
693  }
694  if (!$this->‪isRegistered($identifier)) {
695  throw new ‪Exception('Icon with identifier "' . $identifier . '" is not registered"', 1437425804);
696  }
697  return $this->icons[$identifier];
698  }
699 
703  public function ‪getAllRegisteredIconIdentifiers()
704  {
705  if (!$this->fullInitialized) {
706  $this->‪initialize();
707  }
708  return array_keys($this->icons);
709  }
710 
714  public function ‪getDeprecatedIcons(): array
715  {
717  }
718 
723  public function ‪getIconIdentifierForFileExtension($fileExtension)
724  {
725  // If the file extension is not valid use the default one
726  if (!isset($this->fileExtensionMapping[$fileExtension])) {
727  $fileExtension = 'default';
728  }
729  return $this->fileExtensionMapping[$fileExtension];
730  }
731 
738  public function ‪getIconIdentifierForMimeType($mimeType)
739  {
740  if (!isset($this->mimeTypeMapping[$mimeType])) {
741  return null;
742  }
743  return $this->mimeTypeMapping[$mimeType];
744  }
745 
752  public function ‪getCacheIdentifier(): string
753  {
754  if (!$this->fullInitialized) {
755  $this->‪initialize();
756  }
757 
758  return sha1(json_encode($this->icons));
759  }
760 
764  protected function ‪registerTCAIcons()
765  {
766  $resultArray = [];
767 
768  $tcaTables = array_keys(‪$GLOBALS['TCA'] ?? []);
769  // check every table in the TCA, if an icon is needed
770  foreach ($tcaTables as $tableName) {
771  // This method is only needed for TCA tables where typeicon_classes are not configured
772  $iconIdentifier = 'tcarecords-' . $tableName . '-default';
773  if (
774  isset($this->icons[$iconIdentifier])
775  || !isset(‪$GLOBALS['TCA'][$tableName]['ctrl']['iconfile'])
776  ) {
777  continue;
778  }
779  $resultArray[$iconIdentifier] = ‪$GLOBALS['TCA'][$tableName]['ctrl']['iconfile'];
780  }
781 
782  foreach ($resultArray as $iconIdentifier => $iconFilePath) {
783  $iconProviderClass = $this->‪detectIconProvider($iconFilePath);
784  $this->icons[$iconIdentifier] = [
785  'provider' => $iconProviderClass,
786  'options' => [
787  'source' => $iconFilePath
788  ]
789  ];
790  }
791  $this->tcaInitialized = true;
792  }
793 
797  protected function ‪registerModuleIcons()
798  {
799  $moduleConfiguration = ‪$GLOBALS['TBE_MODULES']['_configuration'] ?? [];
800  foreach ($moduleConfiguration as $moduleKey => $singleModuleConfiguration) {
801  $iconIdentifier = !empty($singleModuleConfiguration['iconIdentifier'])
802  ? $singleModuleConfiguration['iconIdentifier']
803  : null;
804 
805  if ($iconIdentifier !== null) {
806  // iconIdentifier found, icon is registered, continue
807  continue;
808  }
809 
810  $iconPath = !empty($singleModuleConfiguration['icon'])
811  ? $singleModuleConfiguration['icon']
812  : null;
813  $iconProviderClass = $this->‪detectIconProvider($iconPath);
814  $iconIdentifier = 'module-icon-' . $moduleKey;
815 
816  $this->icons[$iconIdentifier] = [
817  'provider' => $iconProviderClass,
818  'options' => [
819  'source' => $iconPath
820  ]
821  ];
822  }
823  $this->moduleIconsInitialized = true;
824  }
825 
829  protected function ‪registerFlags()
830  {
831  $iconFolder = 'EXT:core/Resources/Public/Icons/Flags/';
832  $files = [
833  'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AN', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ',
834  'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ',
835  'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CS', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ',
836  'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ',
837  'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'EU',
838  'FI', 'FJ', 'FK', 'FM', 'FO', 'FR',
839  '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',
840  'HK', 'HM', 'HN', 'HR', 'HT', 'HU',
841  'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT',
842  'JE', 'JM', 'JO', 'JP',
843  'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ',
844  'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY',
845  'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MI', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ',
846  'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ',
847  'OM',
848  'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY',
849  'QA', 'QC',
850  'RE', 'RO', 'RS', 'RU', 'RW',
851  'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ',
852  'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ',
853  'UA', 'UG', 'UM', 'US', 'UY', 'UZ',
854  'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU',
855  'WF', 'WS',
856  'YE', 'YT',
857  'ZA', 'ZM', 'ZW',
858  // Special Flags
859  'catalonia',
860  'multiple',
861  'en-us-gb'
862  ];
863  foreach ($files as $file) {
864  $identifier = strtolower($file);
865  $this->icons['flags-' . $identifier] = [
866  'provider' => BitmapIconProvider::class,
867  'options' => [
868  'source' => $iconFolder . $file . '.png'
869  ]
870  ];
871  }
872  $this->flagsInitialized = true;
873  }
874 
881  public function ‪detectIconProvider($iconReference)
882  {
883  if (‪StringUtility::endsWith(strtolower($iconReference), 'svg')) {
884  return SvgIconProvider::class;
885  }
886  return BitmapIconProvider::class;
887  }
888 }
‪TYPO3\CMS\Core\Imaging\IconRegistry\$staticIcons
‪array $staticIcons
Definition: IconRegistry.php:86
‪TYPO3\CMS\Core\Imaging\IconRegistry\getCacheIdentifier
‪string getCacheIdentifier()
Definition: IconRegistry.php:738
‪TYPO3\CMS\Core\Imaging\IconRegistry\$cache
‪static FrontendInterface $cache
Definition: IconRegistry.php:473
‪TYPO3\CMS\Core\Imaging
Definition: Dimension.php:2
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerMimeTypeIcon
‪registerMimeTypeIcon($mimeType, $iconIdentifier)
Definition: IconRegistry.php:651
‪TYPO3\CMS\Core\Imaging\IconRegistry\getIconIdentifierForMimeType
‪string null getIconIdentifierForMimeType($mimeType)
Definition: IconRegistry.php:724
‪TYPO3\CMS\Core\Imaging\IconRegistry\getIconIdentifierForFileExtension
‪string getIconIdentifierForFileExtension($fileExtension)
Definition: IconRegistry.php:709
‪TYPO3\CMS\Core\Imaging\IconRegistry\$icons
‪array $icons
Definition: IconRegistry.php:59
‪TYPO3\CMS\Core\Utility\StringUtility\endsWith
‪static bool endsWith($haystack, $needle)
Definition: StringUtility.php:60
‪TYPO3\CMS\Core\Imaging\IconRegistry\getCachedBackendIcons
‪getCachedBackendIcons()
Definition: IconRegistry.php:522
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerFlags
‪registerFlags()
Definition: IconRegistry.php:815
‪TYPO3\CMS\Core\Exception
Definition: Exception.php:21
‪TYPO3\CMS\Core\Imaging\IconRegistry\$backendIconsInitialized
‪bool $backendIconsInitialized
Definition: IconRegistry.php:53
‪TYPO3\CMS\Core\Imaging\IconRegistry\$tcaInitialized
‪bool $tcaInitialized
Definition: IconRegistry.php:41
‪$finder
‪$finder
Definition: annotationChecker.php:102
‪TYPO3\CMS\Core\Exception
‪TYPO3\CMS\Core\Imaging\IconRegistry\getDeprecatedIcons
‪array getDeprecatedIcons()
Definition: IconRegistry.php:700
‪TYPO3\CMS\Core\Imaging\IconRegistry\$fileExtensionMapping
‪string[] $fileExtensionMapping
Definition: IconRegistry.php:322
‪TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider
Definition: BitmapIconProvider.php:26
‪TYPO3\CMS\Core\Imaging\IconRegistry\getDefaultIconIdentifier
‪string getDefaultIconIdentifier()
Definition: IconRegistry.php:608
‪TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider
Definition: FontawesomeIconProvider.php:24
‪TYPO3\CMS\Core\Core\Environment\getProjectPath
‪static string getProjectPath()
Definition: Environment.php:142
‪TYPO3\CMS\Core\Imaging\IconRegistry\$flagsInitialized
‪bool $flagsInitialized
Definition: IconRegistry.php:45
‪TYPO3\CMS\Core\Imaging\IconRegistry\isRegistered
‪bool isRegistered($identifier)
Definition: IconRegistry.php:588
‪TYPO3\CMS\Core\Imaging\IconRegistry\$mimeTypeMapping
‪string[] $mimeTypeMapping
Definition: IconRegistry.php:404
‪TYPO3\CMS\Core\Imaging\IconRegistry\isDeprecated
‪bool isDeprecated($identifier)
Definition: IconRegistry.php:600
‪TYPO3\CMS\Core\Imaging\IconRegistry\__construct
‪__construct()
Definition: IconRegistry.php:478
‪TYPO3\CMS\Core\Imaging\IconRegistry\getIconConfigurationByIdentifier
‪mixed getIconConfigurationByIdentifier($identifier)
Definition: IconRegistry.php:663
‪TYPO3\CMS\Core\Imaging\IconRegistry\getAllRegisteredIconIdentifiers
‪array getAllRegisteredIconIdentifiers()
Definition: IconRegistry.php:689
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerIcon
‪registerIcon($identifier, $iconProviderClassName, array $options=[])
Definition: IconRegistry.php:622
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerModuleIcons
‪registerModuleIcons()
Definition: IconRegistry.php:783
‪TYPO3\CMS\Core\Imaging\IconRegistry
Definition: IconRegistry.php:34
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:34
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerFileExtension
‪registerFileExtension($fileExtension, $iconIdentifier)
Definition: IconRegistry.php:640
‪TYPO3\CMS\Core\Imaging\IconRegistry\$fullInitialized
‪bool $fullInitialized
Definition: IconRegistry.php:37
‪TYPO3\CMS\Core\Imaging\IconRegistry\$deprecatedIcons
‪array $deprecatedIcons
Definition: IconRegistry.php:423
‪TYPO3\CMS\Core\Imaging\IconRegistry\$moduleIconsInitialized
‪bool $moduleIconsInitialized
Definition: IconRegistry.php:49
‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
Definition: FrontendInterface.php:21
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:22
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:39
‪TYPO3\CMS\Core\Imaging\IconRegistry\$backendIconAllowedExtensionsWithProvider
‪string[] $backendIconAllowedExtensionsWithProvider
Definition: IconRegistry.php:76
‪TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider
Definition: SvgIconProvider.php:26
‪TYPO3\CMS\Core\Imaging\IconRegistry\$backendIconPaths
‪string[] $backendIconPaths
Definition: IconRegistry.php:65
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Imaging\IconRegistry\initialize
‪initialize()
Definition: IconRegistry.php:497
‪TYPO3\CMS\Core\Imaging\IconRegistry\detectIconProvider
‪string detectIconProvider($iconReference)
Definition: IconRegistry.php:867
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerTCAIcons
‪registerTCAIcons()
Definition: IconRegistry.php:750
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:21
‪TYPO3\CMS\Core\Imaging\IconRegistry\registerBackendIcons
‪registerBackendIcons()
Definition: IconRegistry.php:546
‪TYPO3\CMS\Core\Imaging\IconRegistry\setCache
‪static setCache(FrontendInterface $cache)
Definition: IconRegistry.php:487
‪TYPO3\CMS\Core\Imaging\IconRegistry\$defaultIconIdentifier
‪string $defaultIconIdentifier
Definition: IconRegistry.php:469