MODULE_VERSION = $arModuleVersion['VERSION']; $this->MODULE_VERSION_DATE = $arModuleVersion['VERSION_DATE']; } $this->PARTNER_NAME = GetMessage("ASD_ROBOTS_PARTNER_NAME"); $this->PARTNER_URI = 'http://www.d-it.ru/solutions/modules/'; $this->MODULE_NAME = GetMessage('ASD_ROBOTS_MODULE_NAME'); $this->MODULE_DESCRIPTION = GetMessage('ASD_ROBOTS_MODULE_DESCRIPTION'); $this->bNotOutput = false; } public function InstallDB() { RegisterModuleDependences('main', 'OnAfterUnRegisterModule', $this->MODULE_ID, 'CASDRobots', 'OnAfterUnRegisterModule'); RegisterModuleDependences('search', 'BeforeIndex', $this->MODULE_ID, 'CASDRobots', 'BeforeIndex'); RegisterModule($this->MODULE_ID); } public function UnInstallDB() { UnRegisterModuleDependences('main', 'OnAfterUnRegisterModule', $this->MODULE_ID, 'CASDRobots', 'OnAfterUnRegisterModule'); UnRegisterModuleDependences('search', 'BeforeIndex', $this->MODULE_ID, 'CASDRobots', 'BeforeIndex'); UnRegisterModule($this->MODULE_ID); } public function DoInstall() { global $APPLICATION, $adminPage, $USER, $adminMenu, $adminChain; if ($GLOBALS['APPLICATION']->GetGroupRight('main') < 'W') { return; } if (is_array($this->NEED_MODULES) && !empty($this->NEED_MODULES)) { foreach ($this->NEED_MODULES as $module) { if (!IsModuleInstalled($module)) { $this->ShowForm('ERROR', GetMessage('ASD_ROBOTS_NEED_MODULES', array('#MODULE#' => $module))); } } } if (strlen($this->NEED_MAIN_VERSION)<=0 || version_compare(SM_VERSION, $this->NEED_MAIN_VERSION)>=0) { $this->InstallDB(); $this->ShowForm('OK', GetMessage('MOD_INST_OK')); } else { $this->ShowForm('ERROR', GetMessage('ASD_ROBOTS_NEED_RIGHT_VER', array('#NEED#' => $this->NEED_MAIN_VERSION))); } } public function DoUninstall() { global $APPLICATION, $adminPage, $USER, $adminMenu, $adminChain; if ($GLOBALS['APPLICATION']->GetGroupRight('main') < 'W') { return; } $this->UnInstallDB(); $this->ShowForm('OK', GetMessage('MOD_UNINST_OK')); } private function ShowForm($type, $message, $buttonName='') { if ($this->bNotOutput) { return; } global $APPLICATION, $adminPage, $USER, $adminMenu, $adminChain; $keys = array_keys($GLOBALS); for($i=0; $iSetTitle(GetMessage('ASD_ROBOTS_MODULE_NAME')); include($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_admin_after.php'); echo CAdminMessage::ShowMessage(array('MESSAGE' => $message, 'TYPE' => $type)); ?>

SetTitle(GetMessage('ASD_ROBOTS_MODULE_NAME')); include($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_admin_after.php'); ?>