- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/sitebutton/manager.php
- Класс: Bitrix\Crm\SiteButton\Manager
- Вызов: Manager::getAvatars
static function getAvatars()
{
$list = array();
$listDb = Internals\AvatarTable::getList(array(
'order' => array('DATE_CREATE' => 'DESC')
));
while ($item = $listDb->fetch())
{
$file = \CFile::getFileArray($item['FILE_ID']);
if (!$file)
{
continue;
}
$image = \CFile::resizeImageGet(
$file,
array('width' => 100, 'height' => 100),
BX_RESIZE_IMAGE_PROPORTIONAL, false
);
if($image['src'])
{
$path = $image['src'];
}
else
{
$path = \CFile::getFileSRC($file);
}
if (mb_substr($path, 0, 1) == '/')
{
$path = ResourceManager::getServerAddress() . $path;
}
$list[] = array(
'ID' => $item['FILE_ID'],
'PATH' => $path
);
}
return $list;
}