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