use Bitrix\Main\Loader;
Loader::includeModule('fileman');
CMedialib::Init();
// Папки, разделы
$ar = CMedialibCollection::GetList(
[
'filter' => ['ACTIVE' => 'Y']
]
);
\Bitrix\Main\Diag\Debug::dump($ar);
// Элементы
$ar = CMedialibItem::GetList(
[
'filter' => ['ACTIVE' => 'Y']
]
);
\Bitrix\Main\Diag\Debug::dump($ar);