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