• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/component/controlpanel/controlpanelmenumapper.php
  • Класс: Bitrix\Crm\Component\ControlPanel\ControlPanelMenuMapper
  • Вызов: ControlPanelMenuMapper::getCrmTabMenuIdById
static function getCrmTabMenuIdById(
	string $id,
	?bool $withCRMMenuCodeNamePrefix = false,
	?bool $withParentTabMenuId = false
): ?string
{
	if (!empty($id))
	{
		$result = '';
		if ($withCRMMenuCodeNamePrefix)
		{
			$result = self::CONTROL_PANEL_CODE_NAME . '_';
		}
		foreach (self::MENU_ID_MAP as $item)
		{
			if ($item['Id'] === $id)
			{
				if ($withParentTabMenuId)
				{
					$parentTabMenuId = self::getParentMenuId($item['MenuId']);
					if (isset($parentTabMenuId))
					{
						$result .= $parentTabMenuId . ':';
					}
				}
				$result .= $item['MenuId'];

				return $result;
			}
		}
	}

	return null;
}