function InstallDB(){
global $DB, $APPLICATION;
if(!$DB->Query("SELECT 'x' FROM rbs_custom_options", true)) {
$this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/" . $this->MODULE_ID . "/install/db/" . strtolower($DB->type) . "/install.sql");
}
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
}
$defaul_options = include(dirname(dirname(__FILE__)) . '/lib/custom_options.php');
foreach ($defaul_options as $item) {
CustomOptionsTable::add([
'TYPE' => 'default',
'SETTINGS' => \Bitrix\Main\Web\Json::encode($item['settings']),
'PARAMS' => \Bitrix\Main\Web\Json::encode($item['values'])
]);
}
return true;
}