• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/CustomSection/Manager.php
  • Класс: BitrixIntranetCustomSectionManager
  • Вызов: Manager::getUserSelectedFirstPage
protected function getUserSelectedFirstPage(string $sectionCode, array $pages): ?CustomSectionPage
{
	$option = $this->loadInterfaceButtonsSettings($sectionCode);
	$firstPageLink = empty($option['firstPageLink']) ? null : (string)$option['firstPageLink'];
	if (!$firstPageLink)
	{
		return null;
	}

	$url = new Uri($firstPageLink);

	if (!preg_match(static::PAGE_URL_REGEX, $url->getPath(), $matches))
	{
		return null;
	}

	$pageCode = (string)$matches['pageCode'];

	foreach ($pages as $page)
	{
		if ($page->getCode() === $pageCode)
		{
			return $page;
		}
	}

	return null;
}