• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/item/logindex.php
  • Класс: BitrixSocialnetworkItemLogIndex
  • Вызов: LogIndex::getDiskUFFileNameList
static function getDiskUFFileNameList($valueList = []): array
{
	$result = [];

	if (
		!empty($valueList)
		&& is_array($valueList)
		&& Loader::includeModule('disk')
	)
	{
		$attachedIdList = [];
		foreach ($valueList as $value)
		{
			list($type, $realValue) = FileUserType::detectType($value);
			if ($type == FileUserType::TYPE_NEW_OBJECT)
			{
				$file = BitrixDiskFile::loadById($realValue, [ 'STORAGE' ]);
				$result[] = strip_tags($file->getName());
			}
			else
			{
				$attachedIdList[] = $realValue;
			}
		}

		if (!empty($attachedIdList))
		{
			$attachedObjects = AttachedObject::getModelList([
				'with' => [ 'OBJECT' ],
				'filter' => [
					'ID' => $attachedIdList,
				],
			]);
			foreach ($attachedObjects as $attachedObject)
			{
				$file = $attachedObject->getFile();
				$result[] = strip_tags($file->getName());
			}
		}
	}

	return $result;
}