1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
avatar.php
См. документацию.
1<?php
8
10
11class Avatar
12{
13 private static $cache = [];
14
15 public static function getSrc($avatarId, $width = 58, $height = 58): ?string
16 {
17 if(empty($avatarId))
18 {
19 return null;
20 }
21
22 $avatarId = (int) $avatarId;
23 $key = $avatarId . " $width $height";
24
25 if (!isset(self::$cache[$key]))
26 {
27 $src = false;
28 if ($avatarId > 0)
29 {
30
31 $imageFile = \CFile::getFileArray($avatarId);
32 if ($imageFile !== false)
33 {
34
35 $fileTmp = \CFile::resizeImageGet(
36 $imageFile,
37 array("width" => $width, "height" => $height),
39 false
40 );
41 $src = $fileTmp["src"];
42 }
43
44 self::$cache[$key] = $src;
45 }
46 }
47
48 return self::$cache[$key];
49 }
50}
static getSrc($avatarId, $width=58, $height=58)
Определения avatar.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
const BX_RESIZE_IMAGE_EXACT
Определения constants.php:12
if(empty($signedUserToken)) $key
Определения quickway.php:257
$width
Определения html.php:68