disable.sql 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_profile_cover', 'bx_persons_view_profile', 'bx_persons_view_profile_closed', 'bx_persons_profile_info', 'bx_persons_profile_friends', 'bx_persons_profile_favorites', 'bx_persons_profile_subscriptions', 'bx_persons_home');
  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');
  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. -- VIEWS
  18. DELETE FROM `sys_objects_view` WHERE `name` = 'bx_persons';
  19. -- FAFORITES
  20. DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_persons';
  21. -- FEATURED
  22. DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_persons';
  23. -- REPORTS
  24. DELETE FROM `sys_objects_report` WHERE `name` = 'bx_persons';
  25. -- METATAGS
  26. DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_persons';
  27. -- SEARCH
  28. DELETE FROM `sys_objects_search` WHERE `ObjectName` = 'bx_persons';
  29. -- CONTENT INFO
  30. DELETE FROM `sys_objects_content_info` WHERE `name` = 'bx_persons';
  31. DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_persons');
  32. -- GRIDS
  33. DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_persons_administration', 'bx_persons_common');
  34. DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_persons_administration', 'bx_persons_common');
  35. DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_persons_administration', 'bx_persons_common');
  36. -- ALERTS
  37. SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_persons' LIMIT 1);
  38. DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
  39. DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
  40. -- PRIVACY
  41. DELETE FROM `sys_objects_privacy` WHERE `object` IN('bx_persons_allow_view_to');
  42. -- EMAIL TEMPLATES
  43. DELETE FROM `sys_email_templates` WHERE `Module` = 'bx_persons';
  44. -- UPLOADERS
  45. DELETE FROM `sys_objects_uploader` WHERE `object` IN('bx_persons_cover_crop', 'bx_persons_picture_crop');