- Модуль: intranet
- Путь к файлу: ~/bitrix/modules/intranet/classes/general/ws_contacts.php
- Класс: CIntranetContactsWS
- Вызов: CIntranetContactsWS::InitImage
protected function InitImage($imageID, $imageWidth, $imageHeight = 0)
{
$imageFile = false;
$imageImg = "";
if(($imageWidth = intval($imageWidth)) <= 0) $imageWidth = 100;
if(($imageHeight = intval($imageHeight)) <= 0) $imageHeight = $imageWidth;
$imageID = intval($imageID);
if($imageID > 0)
{
$imageFile = CFile::GetFileArray($imageID);
if ($imageFile !== false)
{
$arFileTmp = CFile::ResizeImageGet(
$imageFile,
array("width" => $imageWidth, "height" => $imageHeight),
BX_RESIZE_IMAGE_PROPORTIONAL,
false, false, true
);
$imageImg = CFile::ShowImage($arFileTmp["src"], $imageWidth, $imageHeight, "border=0", "");
}
}
return array("FILE" => $imageFile, "CACHE" => $arFileTmp, "IMG" => $imageImg);
}