CCrmViewHelper::PrepareClientInfoV2

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmViewHelper
  4. PrepareClientInfoV2
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_view_helper.php
  • Класс: \CCrmViewHelper
  • Вызов: CCrmViewHelper::PrepareClientInfoV2
static function PrepareClientInfoV2($arParams)
{
	$showUrl = isset($arParams['SHOW_URL']) ? $arParams['SHOW_URL'] : '';
	if($showUrl === '')
	{
		$entityTypeID = isset($arParams['ENTITY_TYPE_ID']) ? intval($arParams['ENTITY_TYPE_ID']) : 0;
		$entityID = isset($arParams['ENTITY_ID']) ? intval($arParams['ENTITY_ID']) : 0;
		if($entityTypeID > 0 && $entityID > 0)
		{
			$showUrl = CCrmOwnerType::GetEntityShowPath($entityTypeID, $entityID);
		}
	}

	$photoID = isset($arParams['PHOTO_ID']) ? intval($arParams['PHOTO_ID']) : 0;
	$photoUrl = $photoID > 0
		? CFile::ResizeImageGet($photoID, array('width' => 30, 'height' => 30), BX_RESIZE_IMAGE_EXACT)
		: '';

	$name = isset($arParams['NAME']) ? $arParams['NAME'] : '';
	$description = isset($arParams['DESCRIPTION']) ? $arParams['DESCRIPTION'] : '';
	$html = isset($arParams['ADDITIONAL_HTML']) ? $arParams['ADDITIONAL_HTML'] : '';

	if($showUrl !== '')
	{
		return '
' .(isset($photoUrl['src']) ? '' : '') .'
' .'' .'' .'
' .htmlspecialcharsbx($name).'
' .htmlspecialcharsbx($description).$html.'
'; } return '
' .(isset($photoUrl['src']) ? '' : '') .'
' .'' .'' .'
' .htmlspecialcharsbx($name).'
' .htmlspecialcharsbx($description).$html.'
'; }

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