1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
util.php
См. документацию.
1<?php
2namespace Bitrix\Report\VisualConstructor\Helper;
3
8class Util
9{
16 public static function generateUserUniqueId($prefix = '')
17 {
18 global $USER;
19 $gid = ($prefix ? $prefix . '_' : '') . randString(25) . '_' . $USER->getId() . randString(8);
20 return $gid;
21 }
22
23
32 public static function getAvatarSrc($avatarId, $width = 21, $height = 21)
33 {
34 static $cache = array();
35
36 if(empty($avatarId))
37 {
38 return null;
39 }
40
41 $avatarId = (int) $avatarId;
42 $key = $avatarId . " $width $height";
43
44 if (!isset($cache[$key]))
45 {
46 $src = false;
47 if ($avatarId > 0)
48 {
49
50 $imageFile = \CFile::getFileArray($avatarId);
51 if ($imageFile !== false)
52 {
53
54 $fileTmp = \CFile::resizeImageGet(
55 $imageFile,
56 array("width" => $width, "height" => $height),
58 false
59 );
60 $src = $fileTmp["src"];
61 }
62
63 $cache[$key] = $src;
64 }
65 }
66
67 return $cache[$key];
68 }
69}
static getAvatarSrc($avatarId, $width=21, $height=21)
Определения util.php:32
static generateUserUniqueId($prefix='')
Определения util.php:16
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
global $USER
Определения csv_new_run.php:40
const BX_RESIZE_IMAGE_EXACT
Определения constants.php:12
randString($pass_len=10, $pass_chars=false)
Определения tools.php:2154
if(empty($signedUserToken)) $key
Определения quickway.php:257
$width
Определения html.php:68