• Модуль: mobile
  • Путь к файлу: ~/bitrix/modules/mobile/lib/livefeed/helper.php
  • Класс: BitrixMobileLivefeedHelper
  • Вызов: Helper::getBackgroundData
static function getBackgroundData(): array
{
	$result = [];

	$sourceDir = Application::getInstance()->getPersonalRoot() . '/js/ui/livefeed/background/src/css/images';
	$sourceDirPath = Application::getDocumentRoot() . $sourceDir;
	$folder = new IODirectory($sourceDirPath);

	if(!$folder->isExists())
	{
		return $result;
	}

	$result['folder'] = $sourceDir;
	$result['images'] = [];

	$items = $folder->getChildren();
	foreach ($items as $item)
	{
		if (!$item->isDirectory())
		{
			continue;
		}

		$folderName = $item->getName();

		$result['images'][$folderName] =  [
			'originalUrl' => $sourceDir . '/' . $folderName . '/full.jpg',
			'resizedUrl' => $sourceDir . '/' . $folderName . '/half.jpg'
		];
	}

	ksort($result['images']);

	return $result;
}