259 if (!\CIMDisk::Enabled())
270 $securityContext = new \Bitrix\Disk\Security\DiskSecurityContext(
Common::getUserId());
274 'PARENT_ID' => $folderModel->getId(),
275 'STORAGE_ID' => $folderModel->getStorageId()
277 'order' => [
'UPDATE_TIME' =>
'DESC']
279 $parameters = \Bitrix\Disk\Driver::getInstance()->getRightsManager()->addRightsCheck($securityContext, $parameters, array(
'ID',
'CREATED_BY'));
281 $fileCollection = \Bitrix\Disk\File::getModelList($parameters);
283 foreach ($fileCollection as $fileModel)
285 if ($fileModel->getTypeFile() == \
Bitrix\Disk\TypeFile::IMAGE)
287 $supported = in_array(mb_strtolower($fileModel->getExtension()), [
'png',
'jpg',
'jpeg'],
true);
289 else if ($fileModel->getTypeFile() == \
Bitrix\Disk\TypeFile::VIDEO)
291 $supported = in_array(mb_strtolower($fileModel->getExtension()), [
'mp4',
'mov',
'avi'],
true);
299 'id' => (int)$fileModel->getId(),
300 'title' => $fileModel->getName(),
301 'preview' => $supported? \CIMDisk::GetPublicPath(\CIMDisk::PATH_TYPE_PREVIEW, $fileModel,
false):
'',
302 'background' => $supported? \CIMDisk::GetPublicPath(\CIMDisk::PATH_TYPE_SHOW, $fileModel,
false):
'',
303 'isVideo' => $fileModel->getTypeFile() == \Bitrix\Disk\TypeFile::VIDEO,
304 'isSupported' => $supported,