示例#1
0
	function __CheckDepends()
	{
		$success = true;
		if (array_key_exists("DEPENDENCIES", $this->arDescription) && is_array($this->arDescription["DEPENDENCIES"]))
		{
			$arModules = CWizardUtil::GetModules();

			foreach ($this->arDescription["DEPENDENCIES"] as $module => $version)
			{
				if (!array_key_exists($module, $arModules))
				{
					$this->SetError(
						str_replace("#MODULE#", htmlspecialcharsbx($module), GetMessage("MAIN_WIZARD_ERROR_MODULE_REQUIRED"))
					);
					$success = false;
				}
				elseif (!$arModules[$module]["IsInstalled"])
				{
					$this->SetError(
						str_replace("#MODULE#", $arModules[$module]["MODULE_NAME"], GetMessage("MAIN_WIZARD_ERROR_MODULE_REQUIRED"))
					);
					$success = false;
				}
				elseif (!CheckVersion($arModules[$module]["MODULE_VERSION"], $version))
				{
					$this->SetError(
						str_replace(Array("#MODULE#", "#VERSION#"),
										Array($arModules[$module]["MODULE_NAME"], htmlspecialcharsbx($version)),
										GetMessage("MAIN_WIZARD_ERROR_MODULE_REQUIRED2"))
					);
					$success = false;
				}
			}
		}

		return $success;
	}