install.sql 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. -- Studio page and widget
  2. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  3. (3, 'bx_help_tours', '_bx_help_tours', '_bx_help_tours', 'bx_help_tours@modules/boonex/help_tours/|std-icon.svg');
  4. SET @iPageId = LAST_INSERT_ID();
  5. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  6. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  7. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  8. (@iPageId, 'bx_help_tours', '{url_studio}module.php?name=bx_help_tours&page=tours', '', 'bx_help_tours@modules/boonex/help_tours/|std-icon.svg', '_bx_help_tours', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
  9. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  10. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
  11. -- Main Tables
  12. CREATE TABLE `bx_help_tours` (
  13. `id` int(11) NOT NULL AUTO_INCREMENT,
  14. `overlay` tinyint(1) NOT NULL,
  15. `page` varchar(128) NOT NULL,
  16. `order` int(11) NOT NULL,
  17. PRIMARY KEY (`id`)
  18. );
  19. CREATE TABLE `bx_help_tours_items` (
  20. `id` int(11) NOT NULL AUTO_INCREMENT,
  21. `tour` int(11) NOT NULL,
  22. `name` varchar(255) NOT NULL,
  23. `element` varchar(255) NOT NULL,
  24. `arrow` ENUM('auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end'),
  25. `title` varchar(128) NOT NULL,
  26. `text` varchar(128) NOT NULL,
  27. `order` int(11) NOT NULL,
  28. KEY `tour` (`tour`),
  29. PRIMARY KEY (`id`)
  30. );
  31. CREATE TABLE `bx_help_tours_track_views` (
  32. `account` int(11) NOT NULL,
  33. `tour` int(11) NOT NULL,
  34. KEY `account` (`account`),
  35. PRIMARY KEY (`account`, `tour`)
  36. );
  37. -- ACCOUNT REMOVAL ALERT
  38. INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES
  39. ('bx_help_tours_account_delete', '', '', 'a:3:{s:6:"module";s:13:"bx_help_tours";s:6:"method";s:23:"response_account_delete";s:6:"params";s:5:"$this";}');
  40. SET @iHandler := LAST_INSERT_ID();
  41. INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
  42. ('account', 'delete', @iHandler);