3020d00ccd5dde179388f73e89aa5f8752d809cb
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Imaging / IconRegistry.php
1 <?php
2 namespace TYPO3\CMS\Core\Imaging;
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 TYPO3\CMS\Core\Exception;
18 use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider;
19 use TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider;
20 use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
21 use TYPO3\CMS\Core\Utility\GeneralUtility;
22
23 /**
24 * Class IconRegistry, which makes it possible to register custom icons
25 * from within an extension.
26 */
27 class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
28
29 /**
30 * Registered icons
31 *
32 * @var array
33 */
34 protected $icons = array(
35 // Default icon, fallback
36 'default-not-found' => array(
37 'provider' => SvgIconProvider::class,
38 'options' => array(
39 'source' => 'EXT:backend/Resources/Public/Icons/Default/default-not-found.svg',
40 )
41 ),
42
43 // Action icons
44 'apps-filetree-folder-default' => array(
45 'provider' => BitmapIconProvider::class,
46 'options' => array(
47 'source' => 'EXT:t3skin/images/icons/apps/filetree-folder-default.png',
48 )
49 ),
50 'apps-filetree-mount' => array(
51 'provider' => BitmapIconProvider::class,
52 'options' => array(
53 'source' => 'EXT:backend/Resources/Public/Icons/App/apps-filetree-mount.png'
54 )
55 ),
56 'apps-filetree-root' => array(
57 'provider' => BitmapIconProvider::class,
58 'options' => array(
59 'source' => 'EXT:t3skin/images/icons/apps/filetree-root.png',
60 )
61 ),
62 'apps-toolbar-menu-cache' => array(
63 'provider' => FontawesomeIconProvider::class,
64 'options' => array(
65 'name' => 'bolt',
66 )
67 ),
68 'apps-toolbar-menu-shortcut' => array(
69 'provider' => FontawesomeIconProvider::class,
70 'options' => array(
71 'name' => 'star',
72 )
73 ),
74 'apps-toolbar-menu-workspace' => array(
75 'provider' => FontawesomeIconProvider::class,
76 'options' => array(
77 'name' => 'th-large',
78 )
79 ),
80 'apps-toolbar-menu-actions' => array(
81 'provider' => FontawesomeIconProvider::class,
82 'options' => array(
83 'name' => 'cog',
84 )
85 ),
86 'apps-pagetree-page-domain' => array(
87 'provider' => BitmapIconProvider::class,
88 'options' => array(
89 'source' => 'EXT:t3skin/images/icons/apps/pagetree-page-domain.png',
90 )
91 ),
92 'apps-pagetree-page-default' => array(
93 'provider' => BitmapIconProvider::class,
94 'options' => array(
95 'source' => 'EXT:t3skin/images/icons/apps/pagetree-page-default.png',
96 )
97 ),
98 'apps-pagetree-root' => array(
99 'provider' => SvgIconProvider::class,
100 'options' => array(
101 'source' => 'EXT:backend/Resources/Public/Icons/App/apps-pagetree-root.svg',
102 )
103 ),
104 'apps-toolbar-menu-opendocs' => array(
105 'provider' => FontawesomeIconProvider::class,
106 'options' => array(
107 'name' => 'file',
108 )
109 ),
110 'apps-toolbar-menu-search' => array(
111 'provider' => SvgIconProvider::class,
112 'options' => array(
113 'source' => 'EXT:backend/Resources/Public/Icons/App/apps-toolbar-menu-search.svg',
114 )
115 ),
116 'actions-document-close' => array(
117 'provider' => FontawesomeIconProvider::class,
118 'options' => array(
119 'name' => 'close',
120 )
121 ),
122 'actions-actions-document-duplicates-select' => array(
123 'provider' => BitmapIconProvider::class,
124 'options' => array(
125 'source' => 'EXT:t3skin/images/icons/actions/document-duplicates-select.png',
126 )
127 ),
128 'actions-document-edit-access' => array(
129 'provider' => FontawesomeIconProvider::class,
130 'options' => array(
131 'name' => 'clock-o',
132 )
133 ),
134 'actions-document-export-t3d' => array(
135 'provider' => FontawesomeIconProvider::class,
136 'options' => array(
137 'name' => 'download',
138 )
139 ),
140 'actions-document-history-open' => array(
141 'provider' => FontawesomeIconProvider::class,
142 'options' => array(
143 'name' => 'history',
144 )
145 ),
146 'actions-document-info' => array(
147 'provider' => FontawesomeIconProvider::class,
148 'options' => array(
149 'name' => 'info-circle',
150 )
151 ),
152 'actions-document-import-t3d' => array(
153 'provider' => FontawesomeIconProvider::class,
154 'options' => array(
155 'name' => 'upload',
156 )
157 ),
158 'actions-document-localize' => array(
159 'provider' => BitmapIconProvider::class,
160 'options' => array(
161 'source' => 'EXT:t3skin/images/icons/actions/document-localize.png',
162 )
163 ),
164 'actions-document-move' => array(
165 'provider' => FontawesomeIconProvider::class,
166 'options' => array(
167 'name' => 'arrows',
168 )
169 ),
170 'actions-document-new' => array(
171 'provider' => FontawesomeIconProvider::class,
172 'options' => array(
173 'name' => 'plus-square',
174 )
175 ),
176 'actions-document-open' => array(
177 'provider' => FontawesomeIconProvider::class,
178 'options' => array(
179 'name' => 'pencil',
180 )
181 ),
182 'actions-document-paste' => array(
183 'provider' => SvgIconProvider::class,
184 'options' => array(
185 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-document-paste.svg',
186 )
187 ),
188 'actions-document-paste-after' => array(
189 'provider' => SvgIconProvider::class,
190 'options' => array(
191 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-document-paste-after.svg',
192 )
193 ),
194 'actions-document-paste-before' => array(
195 'provider' => SvgIconProvider::class,
196 'options' => array(
197 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-document-paste-before.svg',
198 )
199 ),
200 'actions-document-paste-into' => array(
201 'provider' => SvgIconProvider::class,
202 'options' => array(
203 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-document-paste-into.svg',
204 )
205 ),
206 'actions-document-select' => array(
207 'provider' => FontawesomeIconProvider::class,
208 'options' => array(
209 'name' => 'check-square-o',
210 )
211 ),
212 'actions-document-save' => array(
213 'provider' => SvgIconProvider::class,
214 'options' => array(
215 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-document-save.svg',
216 )
217 ),
218 'actions-document-save-cleartranslationcache' => array(
219 'provider' => SvgIconProvider::class,
220 'options' => array(
221 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-document-save-cleartranslationcache.svg',
222 )
223 ),
224 'actions-document-save-close' => array(
225 'provider' => SvgIconProvider::class,
226 'options' => array(
227 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-document-save-close.svg',
228 )
229 ),
230 'actions-document-save-new' => array(
231 'provider' => SvgIconProvider::class,
232 'options' => array(
233 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-document-save-new.svg',
234 )
235 ),
236 'actions-document-save-translation' => array(
237 'provider' => SvgIconProvider::class,
238 'options' => array(
239 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-document-save-translation.svg',
240 )
241 ),
242 'actions-document-save-view' => array(
243 'provider' => SvgIconProvider::class,
244 'options' => array(
245 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-document-save-view.svg',
246 )
247 ),
248 'actions-document-synchronize' => array(
249 'provider' => BitmapIconProvider::class,
250 'options' => array(
251 'source' => 'EXT:t3skin/images/icons/actions/document-synchronize.png'
252 )
253 ),
254 'actions-document-view' => array(
255 'provider' => FontawesomeIconProvider::class,
256 'options' => array(
257 'name' => 'desktop',
258 )
259 ),
260 'actions-edit-copy' => array(
261 'provider' => FontawesomeIconProvider::class,
262 'options' => array(
263 'name' => 'copy',
264 )
265 ),
266 'actions-edit-copy-release' => array(
267 'provider' => FontawesomeIconProvider::class,
268 'options' => array(
269 'name' => 'copy',
270 )
271 ),
272 'actions-edit-cut' => array(
273 'provider' => FontawesomeIconProvider::class,
274 'options' => array(
275 'name' => 'scissors',
276 )
277 ),
278 'actions-edit-cut-release' => array(
279 'provider' => FontawesomeIconProvider::class,
280 'options' => array(
281 'name' => 'scissors',
282 )
283 ),
284 'actions-edit-download' => array(
285 'provider' => FontawesomeIconProvider::class,
286 'options' => array(
287 'name' => 'download',
288 )
289 ),
290 'actions-edit-add' => array(
291 'provider' => FontawesomeIconProvider::class,
292 'options' => array(
293 'name' => 'plus-circle',
294 )
295 ),
296 'actions-edit-delete' => array(
297 'provider' => FontawesomeIconProvider::class,
298 'options' => array(
299 'name' => 'trash',
300 )
301 ),
302 'actions-edit-localize-status-low' => array(
303 'provider' => BitmapIconProvider::class,
304 'options' => array(
305 'source' => 'EXT:t3skin/images/icons/actions/edit-localize-status-low.png',
306 )
307 ),
308 'actions-edit-localize-status-high' => array(
309 'provider' => BitmapIconProvider::class,
310 'options' => array(
311 'source' => 'EXT:t3skin/images/icons/actions/edit-localize-status-high.png',
312 )
313 ),
314 'actions-edit-merge-localization' => array(
315 'provider' => BitmapIconProvider::class,
316 'options' => array(
317 'source' => 'EXT:t3skin/images/icons/actions/edit-merge-localization.png',
318 )
319 ),
320 'actions-edit-pick-date' => array(
321 'provider' => FontawesomeIconProvider::class,
322 'options' => array(
323 'name' => 'calendar',
324 )
325 ),
326 'actions-edit-rename' => array(
327 'provider' => FontawesomeIconProvider::class,
328 'options' => array(
329 'name' => 'quote-right',
330 )
331 ),
332 'actions-edit-hide' => array(
333 'provider' => FontawesomeIconProvider::class,
334 'options' => array(
335 'name' => 'toggle-on',
336 )
337 ),
338 'actions-edit-replace' => array(
339 'provider' => FontawesomeIconProvider::class,
340 'options' => array(
341 'name' => 'retweet',
342 )
343 ),
344 'actions-edit-restore' => array(
345 'provider' => BitmapIconProvider::class,
346 'options' => array(
347 'source' => 'EXT:t3skin/images/icons/actions/edit-restore.png',
348 )
349 ),
350 'actions-edit-restore-edit' => array(
351 'provider' => BitmapIconProvider::class,
352 'options' => array(
353 'source' => 'EXT:t3skin/images/icons/actions/edit-undelete-edit.png',
354 )
355 ),
356 'actions-edit-undo' => array(
357 'provider' => FontawesomeIconProvider::class,
358 'options' => array(
359 'name' => 'undo',
360 )
361 ),
362 'actions-edit-unhide' => array(
363 'provider' => FontawesomeIconProvider::class,
364 'options' => array(
365 'name' => 'toggle-off',
366 )
367 ),
368 'actions-edit-upload' => array(
369 'provider' => FontawesomeIconProvider::class,
370 'options' => array(
371 'name' => 'upload',
372 )
373 ),
374 'actions-filter' => array(
375 'provider' => SvgIconProvider::class,
376 'options' => array(
377 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-filter.svg',
378 )
379 ),
380 'actions-insert-record' => array(
381 'provider' => BitmapIconProvider::class,
382 'options' => array(
383 'source' => 'EXT:t3skin/images/icons/actions/insert-record.png',
384 )
385 ),
386 'actions-insert-reference' => array(
387 'provider' => BitmapIconProvider::class,
388 'options' => array(
389 'source' => 'EXT:t3skin/images/icons/actions/insert-reference.png',
390 )
391 ),
392 'actions-markstate' => array(
393 'provider' => FontawesomeIconProvider::class,
394 'options' => array(
395 'name' => 'square-o',
396 )
397 ),
398 'actions-page-new' => array(
399 'provider' => SvgIconProvider::class,
400 'options' => array(
401 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-page-new.svg',
402 )
403 ),
404 'actions-page-move' => array(
405 'provider' => SvgIconProvider::class,
406 'options' => array(
407 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-page-move.svg',
408 ),
409 ),
410 'actions-move' => array(
411 'provider' => FontawesomeIconProvider::class,
412 'options' => array(
413 'name' => 'arrows',
414 )
415 ),
416 'actions-move-down' => array(
417 'provider' => FontawesomeIconProvider::class,
418 'options' => array(
419 'name' => 'angle-down',
420 )
421 ),
422 'actions-move-left' => array(
423 'provider' => FontawesomeIconProvider::class,
424 'options' => array(
425 'name' => 'angle-left',
426 )
427 ),
428 'actions-move-move' => array(
429 'provider' => FontawesomeIconProvider::class,
430 'options' => array(
431 'name' => 'bars',
432 )
433 ),
434 'actions-move-right' => array(
435 'provider' => FontawesomeIconProvider::class,
436 'options' => array(
437 'name' => 'angle-right',
438 )
439 ),
440 'actions-move-to-bottom' => array(
441 'provider' => FontawesomeIconProvider::class,
442 'options' => array(
443 'name' => 'angle-double-down',
444 )
445 ),
446 'actions-move-to-top' => array(
447 'provider' => FontawesomeIconProvider::class,
448 'options' => array(
449 'name' => 'angle-double-up',
450 )
451 ),
452 'actions-move-up' => array(
453 'provider' => FontawesomeIconProvider::class,
454 'options' => array(
455 'name' => 'angle-up',
456 )
457 ),
458 'actions-page-open' => array(
459 'provider' => SvgIconProvider::class,
460 'options' => array(
461 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-page-open.svg',
462 )
463 ),
464 'actions-pagetree-collapse' => array(
465 'provider' => FontawesomeIconProvider::class,
466 'options' => array(
467 'name' => 'caret-right',
468 )
469 ),
470 'actions-pagetree-expand' => array(
471 'provider' => FontawesomeIconProvider::class,
472 'options' => array(
473 'name' => 'caret-down',
474 )
475 ),
476 'actions-pagetree-mountroot' => array(
477 'provider' => FontawesomeIconProvider::class,
478 'options' => array(
479 'name' => 'anchor',
480 )
481 ),
482 'actions-refresh' => array(
483 'provider' => SvgIconProvider::class,
484 'options' => array(
485 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-refresh.svg',
486 )
487 ),
488 'actions-selection-delete' => array(
489 'provider' => FontawesomeIconProvider::class,
490 'options' => array(
491 'name' => 'trash',
492 )
493 ),
494 'actions-search' => array(
495 'provider' => SvgIconProvider::class,
496 'options' => array(
497 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-search.svg',
498 )
499 ),
500 'actions-system-backend-user-switch' => array(
501 'provider' => FontawesomeIconProvider::class,
502 'options' => array(
503 'name' => 'sign-out',
504 )
505 ),
506 'actions-system-cache-clear' => array(
507 'provider' => FontawesomeIconProvider::class,
508 'options' => array(
509 'name' => 'bolt',
510 )
511 ),
512 'actions-system-cache-clear-impact-low' => array(
513 'provider' => SvgIconProvider::class,
514 'options' => array(
515 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-low.svg',
516 )
517 ),
518 'actions-system-cache-clear-impact-medium' => array(
519 'provider' => SvgIconProvider::class,
520 'options' => array(
521 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-medium.svg',
522 )
523 ),
524 'actions-system-cache-clear-impact-high' => array(
525 'provider' => SvgIconProvider::class,
526 'options' => array(
527 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-system-cache-clear-impact-high.svg',
528 )
529 ),
530 'actions-system-help-open' => array(
531 'provider' => SvgIconProvider::class,
532 'options' => array(
533 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-system-help-open.svg',
534 )
535 ),
536 'actions-system-extension-configure' => array(
537 'provider' => FontawesomeIconProvider::class,
538 'options' => array(
539 'name' => 'gear',
540 )
541 ),
542 'actions-system-extension-download' => array(
543 'provider' => FontawesomeIconProvider::class,
544 'options' => array(
545 'name' => 'download',
546 )
547 ),
548 'actions-system-extension-install' => array(
549 'provider' => FontawesomeIconProvider::class,
550 'options' => array(
551 'name' => 'plus-circle',
552 )
553 ),
554 'actions-system-extension-import' => array(
555 'provider' => FontawesomeIconProvider::class,
556 'options' => array(
557 'name' => 'cloud-download',
558 )
559 ),
560 'actions-system-extension-uninstall' => array(
561 'provider' => FontawesomeIconProvider::class,
562 'options' => array(
563 'name' => 'minus-square',
564 )
565 ),
566 'actions-system-extension-sqldump' => array(
567 'provider' => FontawesomeIconProvider::class,
568 'options' => array(
569 'name' => 'database',
570 )
571 ),
572 'actions-system-extension-update' => array(
573 'provider' => FontawesomeIconProvider::class,
574 'options' => array(
575 'name' => 'refresh',
576 )
577 ),
578 'actions-system-list-open' => array(
579 'provider' => FontawesomeIconProvider::class,
580 'options' => array(
581 'name' => 'list-alt',
582 )
583 ),
584 'actions-system-shortcut-new' => array(
585 'provider' => FontawesomeIconProvider::class,
586 'options' => array(
587 'name' => 'star',
588 )
589 ),
590 'actions-version-open' => array(
591 'provider' => FontawesomeIconProvider::class,
592 'options' => array(
593 'name' => 'refresh',
594 )
595 ),
596 'actions-system-tree-search-open' => array(
597 'provider' => SvgIconProvider::class,
598 'options' => array(
599 'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-system-tree-search-open.svg',
600 )
601 ),
602 'actions-version-swap-version' => array(
603 'provider' => FontawesomeIconProvider::class,
604 'options' => array(
605 'name' => 'exchange',
606 )
607 ),
608 'actions-unmarkstate' => array(
609 'provider' => FontawesomeIconProvider::class,
610 'options' => array(
611 'name' => 'check-square-o',
612 )
613 ),
614 'actions-view-list-collapse' => array(
615 'provider' => FontawesomeIconProvider::class,
616 'options' => array(
617 'name' => 'chevron-up',
618 )
619 ),
620 'actions-view-list-expand' => array(
621 'provider' => FontawesomeIconProvider::class,
622 'options' => array(
623 'name' => 'chevron-down',
624 )
625 ),
626 'actions-view-go-back' => array(
627 'provider' => FontawesomeIconProvider::class,
628 'options' => array(
629 'name' => 'angle-double-left',
630 )
631 ),
632 'actions-view-go-forward' => array(
633 'provider' => FontawesomeIconProvider::class,
634 'options' => array(
635 'name' => 'angle-double-right',
636 )
637 ),
638 'actions-view-go-up' => array(
639 'provider' => FontawesomeIconProvider::class,
640 'options' => array(
641 'name' => 'level-up',
642 )
643 ),
644 'actions-view-paging-first' => array(
645 'provider' => FontawesomeIconProvider::class,
646 'options' => array(
647 'name' => 'step-backward',
648 )
649 ),
650 'actions-view-paging-last' => array(
651 'provider' => FontawesomeIconProvider::class,
652 'options' => array(
653 'name' => 'step-forward',
654 )
655 ),
656 'actions-view-paging-previous' => array(
657 'provider' => FontawesomeIconProvider::class,
658 'options' => array(
659 'name' => 'arrow-left',
660 )
661 ),
662 'actions-view-paging-next' => array(
663 'provider' => FontawesomeIconProvider::class,
664 'options' => array(
665 'name' => 'arrow-right',
666 )
667 ),
668 'actions-view-table-collapse' => array(
669 'provider' => FontawesomeIconProvider::class,
670 'options' => array(
671 'name' => 'chevron-left',
672 )
673 ),
674 'actions-view-table-expand' => array(
675 'provider' => FontawesomeIconProvider::class,
676 'options' => array(
677 'name' => 'chevron-right',
678 )
679 ),
680 'actions-window-open' => array(
681 'provider' => FontawesomeIconProvider::class,
682 'options' => array(
683 'name' => 'arrows-alt',
684 )
685 ),
686 'actions-template-new' => array(
687 'provider' => BitmapIconProvider::class,
688 'options' => array(
689 'source' => 'EXT:t3skin/images/icons/actions/template-new.png',
690 )
691 ),
692
693 // Extensions
694 'extensions-extensionmanager-update-script' => array(
695 'provider' => FontawesomeIconProvider::class,
696 'options' => array(
697 'name' => 'refresh',
698 )
699 ),
700 'extensions-scheduler-run-task' => array(
701 'provider' => FontawesomeIconProvider::class,
702 'options' => array(
703 'name' => 'play-circle',
704 )
705 ),
706
707 // specials
708 'empty-empty' => array(
709 'provider' => FontawesomeIconProvider::class,
710 'options' => array(
711 'name' => 'empty-empty',
712 )
713 ),
714
715 // Miscellaneous icons
716 'miscellaneous-placeholder' => array(
717 'provider' => SvgIconProvider::class,
718 'options' => array(
719 'source' => 'EXT:backend/Resources/Public/Icons/Miscellaneous/miscellaneous-placeholder.svg',
720 )
721 ),
722
723 // Status
724 'status-status-checked' => array(
725 'provider' => FontawesomeIconProvider::class,
726 'options' => array(
727 'name' => 'check',
728 )
729 ),
730 'status-status-current' => array(
731 'provider' => FontawesomeIconProvider::class,
732 'options' => array(
733 'name' => 'caret-right',
734 )
735 ),
736 'status-status-locked' => array(
737 'provider' => FontawesomeIconProvider::class,
738 'options' => array(
739 'name' => 'lock',
740 )
741 ),
742 'status-status-reference-hard' => array(
743 'provider' => BitmapIconProvider::class,
744 'options' => array(
745 'source' => 'EXT:t3skin/images/icons/status/status-reference-hard.png',
746 )
747 ),
748 'status-status-sorting-asc' => array(
749 'provider' => FontawesomeIconProvider::class,
750 'options' => array(
751 'name' => 'caret-up',
752 )
753 ),
754 'status-status-sorting-desc' => array(
755 'provider' => FontawesomeIconProvider::class,
756 'options' => array(
757 'name' => 'caret-down',
758 )
759 ),
760 'status-status-sorting-light-asc' => array(
761 'provider' => FontawesomeIconProvider::class,
762 'options' => array(
763 'name' => 'caret-up',
764 )
765 ),
766 'status-status-sorting-light-desc' => array(
767 'provider' => FontawesomeIconProvider::class,
768 'options' => array(
769 'name' => 'caret-down',
770 )
771 ),
772 'status-dialog-ok' => array(
773 'provider' => FontawesomeIconProvider::class,
774 'options' => array(
775 'name' => 'check-circle',
776 )
777 ),
778 'status-dialog-notification' => array(
779 'provider' => FontawesomeIconProvider::class,
780 'options' => array(
781 'name' => 'exclamation-circle',
782 )
783 ),
784 'status-dialog-warning' => array(
785 'provider' => FontawesomeIconProvider::class,
786 'options' => array(
787 'name' => 'exclamation-triangle',
788 )
789 ),
790 'status-dialog-error' => array(
791 'provider' => FontawesomeIconProvider::class,
792 'options' => array(
793 'name' => 'exclamation-circle',
794 )
795 ),
796 'status-warning-lock' => array(
797 'provider' => BitmapIconProvider::class,
798 'options' => array(
799 'source' => 'EXT:t3skin/images/icons/status/warning-lock.png',
800 )
801 ),
802 'status-warning-in-use' => array(
803 'provider' => BitmapIconProvider::class,
804 'options' => array(
805 'source' => 'EXT:t3skin/images/icons/status/warning-in-use.png',
806 )
807 ),
808 'status-status-permission-granted' => array(
809 'provider' => FontawesomeIconProvider::class,
810 'options' => array(
811 'name' => 'check',
812 )
813 ),
814 'status-status-permission-denied' => array(
815 'provider' => FontawesomeIconProvider::class,
816 'options' => array(
817 'name' => 'times',
818 )
819 ),
820 'status-status-reference-soft' => array(
821 'provider' => BitmapIconProvider::class,
822 'options' => array(
823 'source' => 'EXT:t3skin/images/icons/status/status-reference-soft.png',
824 )
825 ),
826 'status-status-edit-read-only' => array(
827 'provider' => BitmapIconProvider::class,
828 'options' => array(
829 'source' => 'EXT:t3skin/images/icons/status/status-edit-read-only.png',
830 )
831 ),
832
833 // Mimetypes
834 'mimetypes-text-html' => array(
835 'provider' => FontawesomeIconProvider::class,
836 'options' => array(
837 'name' => 'file-text-o',
838 )
839 ),
840 'mimetypes-text-csv' => array(
841 'provider' => BitmapIconProvider::class,
842 'options' => array(
843 'source' => 'EXT:t3skin/images/icons/mimetypes/text-csv.png',
844 )
845 ),
846 'mimetypes-word' => array(
847 'provider' => FontawesomeIconProvider::class,
848 'options' => array(
849 'name' => 'file-word-o',
850 )
851 ),
852 'mimetypes-x-content-page-language-overlay' => array(
853 'provider' => BitmapIconProvider::class,
854 'options' => array(
855 'source' => 'EXT:t3skin/images/icons/mimetypes/x-content-page-language-overlay.gif',
856 )
857 ),
858 'mimetypes-x-content-template-static' => array(
859 'provider' => BitmapIconProvider::class,
860 'options' => array(
861 'source' => 'EXT:t3skin/images/icons/mimetypes/x-content-template-static.png',
862 )
863 ),
864
865 // Spinner
866 'spinner-circle-dark' => array(
867 'provider' => SvgIconProvider::class,
868 'options' => array(
869 'source' => 'EXT:backend/Resources/Public/Icons/Spinner/spinner-circle-dark.svg',
870 'spinning' => TRUE
871 )
872 ),
873 'spinner-circle-light' => array(
874 'provider' => SvgIconProvider::class,
875 'options' => array(
876 'source' => 'EXT:backend/Resources/Public/Icons/Spinner/spinner-circle-light.svg',
877 'spinning' => TRUE
878 )
879 ),
880
881 // Overlays
882 'overlay-deleted' => array(
883 'provider' => SvgIconProvider::class,
884 'options' => array(
885 'source' => 'EXT:backend/Resources/Public/Icons/Overlay/overlay-deleted.svg'
886 )
887 ),
888 'overlay-hidden' => array(
889 'provider' => SvgIconProvider::class,
890 'options' => array(
891 'source' => 'EXT:backend/Resources/Public/Icons/Overlay/overlay-hidden.svg'
892 )
893 ),
894 'overlay-includes-subpages' => array(
895 'provider' => SvgIconProvider::class,
896 'options' => array(
897 'source' => 'EXT:backend/Resources/Public/Icons/Overlay/overlay-includes-subpages.svg'
898 )
899 ),
900 'overlay-locked' => array(
901 'provider' => SvgIconProvider::class,
902 'options' => array(
903 'source' => 'EXT:backend/Resources/Public/Icons/Overlay/overlay-locked.svg'
904 )
905 ),
906 'overlay-readonly' => array(
907 'provider' => SvgIconProvider::class,
908 'options' => array(
909 'source' => 'EXT:backend/Resources/Public/Icons/Overlay/overlay-readonly.svg',
910 )
911 ),
912 'overlay-restricted' => array(
913 'provider' => SvgIconProvider::class,
914 'options' => array(
915 'source' => 'EXT:backend/Resources/Public/Icons/Overlay/overlay-restricted.svg'
916 )
917 ),
918 'overlay-scheduled' => array(
919 'provider' => SvgIconProvider::class,
920 'options' => array(
921 'source' => 'EXT:backend/Resources/Public/Icons/Overlay/overlay-scheduled.svg'
922 )
923 ),
924 'overlay-translated' => array(
925 'provider' => SvgIconProvider::class,
926 'options' => array(
927 'source' => 'EXT:backend/Resources/Public/Icons/Overlay/overlay-translated.svg'
928 )
929 )
930 );
931
932 /**
933 * Array of deprecated icons, add deprecated icons to this array and remove it from registry
934 * - Index of this array contains the deprecated icon
935 * - Value of each entry must contain the deprecation message and can contain an identifier which replaces the old identifier
936 *
937 * Example:
938 * array(
939 * 'deprecated-icon-identifier' => array(
940 * 'message' => '%s is deprecated since TYPO3 CMS 7, this icon will be removed in TYPO3 CMS 8',
941 * 'replacement' => 'alternative-icon-identifier' // must be registered
942 * )
943 * )
944 *
945 * @var array
946 */
947 protected $deprecatedIcons = array(
948 'actions-system-refresh' => array(
949 'replacement' => 'actions-refresh',
950 'message' => '%s is deprecated since TYPO3 CMS 7, this icon will be removed in TYPO3 CMS 8'
951 )
952 );
953
954 /**
955 * @var string
956 */
957 protected $defaultIconIdentifier = 'default-not-found';
958
959 /**
960 * @param string $identifier
961 *
962 * @return bool
963 */
964 public function isRegistered($identifier) {
965 return isset($this->icons[$identifier]);
966 }
967
968 /**
969 * @param string $identifier
970 *
971 * @return bool
972 */
973 public function isDeprecated($identifier) {
974 return isset($this->deprecatedIcons[$identifier]);
975 }
976
977 /**
978 * @return string
979 */
980 public function getDefaultIconIdentifier() {
981 return $this->defaultIconIdentifier;
982 }
983
984 /**
985 * Registers an icon to be available inside the Icon Factory
986 *
987 * @param string $identifier
988 * @param string $iconProviderClassName
989 * @param array $options
990 *
991 * @throws \InvalidArgumentException
992 */
993 public function registerIcon($identifier, $iconProviderClassName, array $options = array()) {
994 if (!in_array(IconProviderInterface::class, class_implements($iconProviderClassName), TRUE)) {
995 throw new \InvalidArgumentException('An IconProvider must implement ' . IconProviderInterface::class, 1437425803);
996 }
997 $this->icons[$identifier] = array(
998 'provider' => $iconProviderClassName,
999 'options' => $options
1000 );
1001 }
1002
1003 /**
1004 * Fetches the configuration provided by registerIcon()
1005 *
1006 * @param string $identifier the icon identifier
1007 * @return mixed
1008 * @throws Exception
1009 */
1010 public function getIconConfigurationByIdentifier($identifier) {
1011 if (!$this->isRegistered($identifier)) {
1012 throw new Exception('Icon with identifier "' . $identifier . '" is not registered"', 1437425804);
1013 }
1014 if ($this->isDeprecated($identifier)) {
1015 $deprecationSettings = $this->getDeprecationSettings($identifier);
1016 GeneralUtility::deprecationLog(sprintf($deprecationSettings['message'], $identifier));
1017 if (!empty($deprecationSettings['replacement'])) {
1018 $identifier = $deprecationSettings['replacement'];
1019 }
1020 }
1021 return $this->icons[$identifier];
1022 }
1023
1024 /**
1025 * @param string $identifier
1026 *
1027 * @return array
1028 * @throws Exception
1029 */
1030 public function getDeprecationSettings($identifier) {
1031 if (!$this->isDeprecated($identifier)) {
1032 throw new Exception('Icon with identifier "' . $identifier . '" is not deprecated"', 1437425804);
1033 }
1034 return $this->deprecatedIcons[$identifier];
1035 }
1036
1037 /**
1038 * @return array
1039 * @internal
1040 */
1041 public function getAllRegisteredIconIdentifiers() {
1042 return array_keys($this->icons);
1043 }
1044
1045 }