• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_event.php
  • Класс: CCalendarEvent
  • Вызов: CCalendarEvent::getDiskUFFileNameList
static function getDiskUFFileNameList($valueList = [])
{
	$result = [];

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

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

	return $result;
}