• Модуль: extranet
  • Путь к файлу: ~/bitrix/modules/extranet/classes/general/wizard_utils.php
  • Класс: CExtranetWizardServices
  • Вызов: CExtranetWizardServices::GetServices
static function GetServices($wizardPath, $serviceFolder = "", $arFilter = Array())
{
	$arServices = Array();

	$wizardPath = rtrim($wizardPath, "/");
	$serviceFolder = rtrim($serviceFolder, "/");

	if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru")
	{
		if (file_exists($wizardPath."/lang/en".$serviceFolder."/.services.php"))
			__IncludeLang($wizardPath."/lang/en".$serviceFolder."/.services.php");
	}
	if (file_exists($wizardPath."/lang/".LANGUAGE_ID.$serviceFolder."/.services.php"))
		__IncludeLang($wizardPath."/lang/".LANGUAGE_ID.$serviceFolder."/.services.php");

	$servicePath = $wizardPath."/".$serviceFolder;
	include($servicePath."/.services.php");

	if (empty($arServices))
		return $arServices;

	$servicePosition = 1;
	foreach ($arServices as $serviceID => $arService)
	{
		if (isset($arFilter["SKIP_INSTALL_ONLY"]) && array_key_exists("INSTALL_ONLY", $arService) && $arService["INSTALL_ONLY"] == $arFilter["SKIP_INSTALL_ONLY"])
		{
			unset($arServices[$serviceID]);
			continue;
		}

		if (isset($arFilter["SERVICES"]) && is_array($arFilter["SERVICES"]) && !in_array($serviceID, $arFilter["SERVICES"]) && !array_key_exists("INSTALL_ONLY", $arService))
		{
			unset($arServices[$serviceID]);
			continue;
		}

		//Check service dependencies
		$modulesCheck = Array($serviceID);
		if (array_key_exists("MODULE_ID", $arService))
			$modulesCheck = (is_array($arService["MODULE_ID"]) ? $arService["MODULE_ID"] : Array($arService["MODULE_ID"]));

		foreach ($modulesCheck as $moduleID)
		{
			if (!IsModuleInstalled($moduleID))
			{
				unset($arServices[$serviceID]);
				continue 2;
			}
		}

		$arServices[$serviceID]["POSITION"] = $servicePosition;
		$servicePosition += (!empty($arService["STAGES"]) ? count($arService["STAGES"]) : 1);
	}

	return $arServices;
}