/**
 * Удаляет группу настроек.
 * @param string   $Group Идентификатор группы или имя.
 * @param string   $Table
 * @param string   $GroupsTable
 */
function RemoveConfigGroup($Group, $Table = 'config', $GroupsTable = 'config_groups')
{
    if (!is_numeric($Group)) {
        $groups = GetConfigGroups($GroupsTable);
        $Group = SafeEnv($groups[$Group]['id'], 11, int);
    }
    System::database()->Delete($GroupsTable, "`id`='{$Group}'");
    // Удаляем все настройки группы
    System::database()->Delete($Table, "`group_id`='{$Group}'");
    GetConfigGroups('clear');
}
System::database()->Insert("plugins", "'','pages','','','5','sitemap','0','1'");
System::database()->Insert("plugins", "'','articles','articles','','5','search','0','1'");
System::database()->Insert("plugins", "'','downloads','downloads','','5','search','0','1'");
System::database()->Insert("plugins", "'','forum','forum','','5','search','0','1'");
System::database()->Insert("plugins", "'','gallery','gallery','','5','search','0','1'");
System::database()->Insert("plugins", "'','news','news','','5','search','0','1'");
System::database()->Insert("plugins", "'','pages','pages','','5','search','0','1'");
System::database()->Insert("plugins", "'','articles','articles','','5','sitemap','0','1'");
System::database()->Insert('plugins', "'','ace','','','7','editors','0','0'");
System::database()->Insert('plugins', "'','bbcode_toolbar','','','7','bbcode_editors','0','1'");
System::database()->Update('plugins', "`hidden`='1'", "`name`='out'");
System::database()->Update('plugins', "`hidden`='1'", "`name`='http_referers'");
System::database()->Update('plugins', "`hidden`='1'", "`name`='avatars_render'");
System::database()->Update('plugins', "`hidden`='1'", "`name`='antibot'");
// Обновление таблицы plugins_config
$groups = GetConfigGroups('plugins_config_groups');
$group_tinymce = SafeEnv($groups['editors.tiny_mce'], 11, int);
System::database()->Update('plugins_config', "`value`='save,restoredraft,|,cut,copy,paste,pastetext,selectall,|,search,replace,|,undo,redo,|,visualaid,visualchars,|,print,|,codemagic,cleanup,|,formatselect,removeformat,|,help,fullscreen'", "`name`='theme_advanced_buttons1'");
System::database()->Update('plugins_config', "`value`='bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,sub,sup,|,bullist,numlist,outdent,indent,blockquote,|,charmap,link,unlink,anchor,image,images,media,hr,insertcode'", "`name`='theme_advanced_buttons2'");
//System::database()->Update('plugins_config', "`value`=''", "`name`='theme_advanced_buttons3'");
//System::database()->Update('plugins_config', "`value`=''", "`name`='theme_advanced_buttons4'");
System::database()->Insert('plugins_config', "'','{$group_tinymce}','extra_plugins','','1','Дополнительные плагины','Названия папок плагинов через запятую.','edit:w400px','','','0,string,false','1'");
// Обновление таблицы rewrite_rules
System::database()->Truncate('rewrite_rules');
// Обновление таблицы snippets
System::database()->Insert('snippets', "'','Select - выборка из базы данных','return System::database()->Select(\\'plugins\\', \"`hidden`=\\'0\\'\");\nif(true){\n\techo \"Hello!\";\n}else{\n\techo \"Bye!\";\n}','php'");
System::database()->Insert('snippets', "'','Echo - простой пример вывода данных','echo \\'New snippet!!!\\';','php'");
System::database()->Insert('snippets', "'','Alert - вывод сообщения на JS','alert(\"Hello!\");','js'");
// Обновление таблицы templates
$standart_templates = explode(',', 'IgrimTheme,default,default_admin');
System::database()->Insert('templates', "'','Igrim Theme','IgrimTheme','0','0'");