• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/classes/general/rest_util.php
  • Класс: CRestUtil
  • Вызов: CRestUtil::getApplicationPage
static function getApplicationPage($id, $type = 'ID', $appInfo = null)
{
	if($appInfo === null)
	{
		$appInfo = BitrixRestAppTable::getByClientId($id);
	}

	if($type !== 'ID' && $type !== 'CODE' && $type !== 'CLIENT_ID')
	{
		$type = 'ID';
	}

	if(
		empty($appInfo['MENU_NAME'])
		&& empty($appInfo['MENU_NAME_DEFAULT'])
		&& empty($appInfo['MENU_NAME_LICENSE'])
		|| $appInfo['ACTIVE'] === BitrixRestAppTable::INACTIVE
		|| (isset($appInfo['TYPE']) && $appInfo['TYPE'] === BitrixRestAppTable::TYPE_CONFIGURATION)
	)
	{
		$url = BitrixRestMarketplaceUrl::getApplicationDetailUrl(urlencode($appInfo['CODE']));
	}
	elseif($appInfo['CODE'] === static::BITRIX_1C_APP_CODE)
	{
		$url = SITE_DIR.'onec/';
	}
	else
	{
		$url = BitrixRestMarketplaceUrl::getApplicationUrl(urlencode($appInfo[$type]));
	}
	return $url;
}