File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ * This file is part of the TYPO3 CMS project.
5+ *
6+ * It is free software; you can redistribute it and/or modify it under
7+ * the terms of the GNU General Public License, either version 2
8+ * of the License, or any later version.
9+ *
10+ * For the full copyright and license information, please read the
11+ * LICENSE.txt file that was distributed with this source code.
12+ *
13+ * The TYPO3 project - inspiring people to share!
14+ */
15+
16+ namespace T3docs \Examples \Backend \Avatar ;
17+
18+ use TYPO3 \CMS \Backend \Attribute \AsAvatarProvider ;
19+ use TYPO3 \CMS \Backend \Backend \Avatar \AvatarProviderInterface ;
20+ use TYPO3 \CMS \Backend \Backend \Avatar \Image ;
21+ use TYPO3 \CMS \Core \Utility \GeneralUtility ;
22+
23+ #[AsAvatarProvider('exampleAvatarProvider ' )]
24+ class ExampleAvatarProvider implements AvatarProviderInterface
25+ {
26+ /**
27+ * Returns an Image object, prepared for output, based on a given be_users record
28+ *
29+ * @param array<string, scalar> $backendUser be_users record
30+ * @param int $size
31+ */
32+ public function getImage (array $ backendUser , $ size ): ?Image
33+ {
34+ return GeneralUtility::makeInstance (
35+ Image::class,
36+ '/typo3conf/ext/examples/Resources/Public/Icons/Extension.png ' ,
37+ 20 ,
38+ 20 ,
39+ );
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments