disable.sql 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. -- SETTINGS
  2. SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_persons' LIMIT 1);
  3. SET @iCategId = (SELECT `ID` FROM `sys_options_categories` WHERE `type_id` = @iTypeId LIMIT 1);
  4. DELETE FROM `sys_options` WHERE `category_id` = @iCategId;
  5. DELETE FROM `sys_options_categories` WHERE `type_id` = @iTypeId;
  6. DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
  7. -- PAGES
  8. DELETE FROM `sys_objects_page` WHERE `module` = 'bx_persons';
  9. DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_persons' OR `object` IN('bx_persons_create_profile', 'bx_persons_delete_profile', 'bx_persons_edit_profile', 'bx_persons_edit_badge', 'bx_persons_view_profile', 'bx_persons_view_profile_closed', 'bx_persons_profile_info', 'bx_persons_profile_friends', 'bx_persons_friend_requests', 'bx_persons_profile_favorites', 'bx_persons_profile_subscriptions', 'bx_persons_profile_comments', 'bx_persons_home', 'bx_persons_search', 'bx_persons_manage');
  10. -- MENU
  11. DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_persons';
  12. DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_persons';
  13. DELETE FROM `sys_menu_items` WHERE `module` = 'bx_persons' OR `set_name` IN('bx_persons_view_submenu', 'bx_persons_submenu', 'bx_persons_view_actions', 'bx_persons_view_actions_more', 'bx_persons_view_actions_all', 'bx_persons_view_meta', 'bx_persons_snippet_meta', 'bx_persons_menu_manage_tools');
  14. -- ACL
  15. DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_persons';
  16. DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_persons';
  17. -- METATAGS
  18. DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_persons';
  19. -- SEARCH
  20. DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_persons', 'bx_persons_cmts');
  21. -- STATS
  22. DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_persons%';
  23. -- CHARTS
  24. DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_persons%';
  25. -- GRIDS
  26. DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_persons_administration', 'bx_persons_common');
  27. DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_persons_administration', 'bx_persons_common');
  28. DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_persons_administration', 'bx_persons_common');
  29. -- LIVE UPDATES
  30. DELETE FROM `sys_objects_live_updates` WHERE `name` LIKE 'bx_persons%';
  31. -- ALERTS
  32. SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_persons' LIMIT 1);
  33. DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
  34. DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
  35. -- PRIVACY
  36. DELETE FROM `sys_objects_privacy` WHERE `object` IN ('bx_persons_allow_view_to', 'bx_persons_allow_post_to', 'bx_persons_allow_contact_to');
  37. -- EMAIL TEMPLATES
  38. DELETE FROM `sys_email_templates` WHERE `Module` = 'bx_persons';
  39. -- UPLOADERS
  40. DELETE FROM `sys_objects_uploader` WHERE `object` IN ('bx_persons_cover_crop', 'bx_persons_picture_crop', 'bx_persons_badge_crop');