- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/integration/socialnetwork.php
- Класс: BitrixTasksIntegrationSocialNetwork
- Вызов: SocialNetwork::getUserPictureSrc
static function getUserPictureSrc($photoId, $gender = '?', $width = 100, $height = 100)
{
static $cache = array();
$key = $photoId.'.'.$width.'.'.$height;
if (!array_key_exists($key, $cache))
{
$src = false;
if ($photoId > 0)
{
$imageFile = CFile::GetFileArray($photoId);
if ($imageFile !== false)
{
$tmpImage = CFile::ResizeImageGet(
$imageFile,
array("width" => $width, "height" => $height),
BX_RESIZE_IMAGE_EXACT,
false
);
$src = $tmpImage["src"];
}
$cache[$key] = $src;
}
}
return $cache[$key];
}