function UnRegisterModule($id) { global $DB; $DB->Query("DELETE FROM b_agent WHERE MODULE_ID='" . $DB->ForSQL($id) . "'"); CMain::DelGroupRight($id); $m = new CModule(); $m->MODULE_ID = $id; $m->Remove(); $res = GetModuleEvents("main", "OnAfterUnRegisterModule"); while ($arEvent = $res->Fetch()) { ExecuteModuleEventEx($arEvent, array($id)); } }
function RestoreModules() { $arBackup = CControllerClient::GetBackup(); if (isset($arBackup["modules"])) { $oModule = new CModule(); $arWasInstalled = $arBackup["modules"]; $arNowInstalled = array(); $arm = CModule::_GetCache(); foreach ($arm as $module_id => $tr) { $arNowInstalled[] = $module_id; } foreach ($arNowInstalled as $module_id) { if (!in_array($module_id, $arWasInstalled)) { $oModule->MODULE_ID = $module_id; $oModule->Remove(); } else { unset($arWasInstalled[array_search($module_id, $arWasInstalled)]); } } foreach ($arWasInstalled as $module_id) { $oModule->MODULE_ID = $module_id; $oModule->Add(); } unset($arBackup["modules"]); CControllerClient::SetBackup($arBackup); } }
function UnRegisterModule($id) { global $DB; $DB->Query("DELETE FROM b_agent WHERE MODULE_ID='".$DB->ForSQL($id)."'"); CMain::DelGroupRight($id); $m = new CModule; $m->MODULE_ID = $id; $m->Remove(); }