<?php
// избранное
run_query('CREATE TABLE ' . $config['table_prefix'] . 'favorites (
  `user_id` int NOT NULL,
  `table_id` int NOT NULL,
  `line_id` int NOT NULL,
  `notify` tinyint(1) NOT NULL,
  KEY (`user_id`),
  KEY (`table_id`),
  KEY (`line_id`)
)');

// настройки избранного
$result = sql_select_field($config['table_prefix'] . 'groups', 'id', 'id != 777');
while ($row = sql_fetch_assoc($result)) {
    $groups_use_favorites[$row['id']] = 1;
}
$send_events_favorites = [
    'email' => 1,
];
$type_events_favorites = [
    'edit' => 1,
    'copy' => 1,
    'delete' => 1,
    'archive' => 1,
    'adt_actions' => 1,
];
run_query("INSERT INTO " . $config['table_prefix'] . "config (`name`, `value`) VALUES ('groups_use_favorites', '" . json_encode($groups_use_favorites) . "')");
run_query("INSERT INTO " . $config['table_prefix'] . "config (`name`, `value`) VALUES ('send_events_favorites', '" . json_encode($send_events_favorites) . "')");
run_query("INSERT INTO " . $config['table_prefix'] . "config (`name`, `value`) VALUES ('type_events_favorites', '" . json_encode($type_events_favorites) . "')");