• Модуль: crmmobile
  • Путь к файлу: ~/bitrix/modules/crmmobile/lib/CustomSections/TabSorter.php
  • Класс: BitrixCrmMobileCustomSectionsTabSorter
  • Вызов: TabSorter::getCustomSectionTabSortIndex
static function getCustomSectionTabSortIndex($entityTypeId, $wTabsOrder, $customSection)
{
	if (isset($customSection) && isset($entityTypeId) && !empty($wTabsOrder))
	{
		foreach ($customSection->getPages() as $page)
		{
			if (IntranetManager::getEntityTypeIdByPageSettings($page->getSettings()) === $entityTypeId)
			{
				$targetPage = $page;
				break;
			}
		}
		if (isset($targetPage))
		{
			$pageCode = (self::CUSTOM_SECTION_TABS_PREFIX . $customSection->getCode())
				. '_'
				. ($targetPage->getCode());
			foreach ($wTabsOrder as $tabKey => $tabValue)
			{
				if ($tabKey === $pageCode)
				{
					return $tabValue['sort'];
				}
			}
		}
	}

	return self::MAX_SORT_ID;
}