CCrmMobileHelper::PrepareImageUrl

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmMobileHelper
  4. PrepareImageUrl
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/mobile_helper.php
  • Класс: \CCrmMobileHelper
  • Вызов: CCrmMobileHelper::PrepareImageUrl
static function PrepareImageUrl(&$fields, $fieldID, $size)
{
	$fieldID = strval($fieldID);
	if($fieldID === '')
	{
		return '';
	}

	$width = is_array($size) && isset($size['WIDTH']) ? intval($size['WIDTH']) : 50;
	$height = is_array($size) && isset($size['HEIGHT']) ? intval($size['HEIGHT']) : 50;

	if($fieldID)
		$imageID = isset($fields[$fieldID]) ? intval($fields[$fieldID]) : 0;
	if($imageID > 0)
	{
		$info = CFile::ResizeImageGet(
			$imageID, array('width' => $width, 'height' => $height), BX_RESIZE_IMAGE_EXACT);

		return isset($info['src']) ? $info['src'] : '';
	}

	return '';
}

Добавить комментарий