enable.sql 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. SET @sName = 'bx_acl';
  2. -- SETTINGS
  3. SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
  4. INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES
  5. ('modules', @sName, '_bx_acl', 'bx_acl@modules/boonex/acl/|std-icon.svg', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
  6. SET @iTypeId = LAST_INSERT_ID();
  7. INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
  8. VALUES (@iTypeId, @sName, '_bx_acl', 1);
  9. SET @iCategId = LAST_INSERT_ID();
  10. INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
  11. ('bx_acl_recurring_reserve', '2', @iCategId, '_bx_acl_option_recurring_reserve', 'digit', '', '', '', 1),
  12. ('bx_acl_recurring_prioritize', 'on', @iCategId, '_bx_acl_option_recurring_prioritize', 'checkbox', '', '', '', 2);
  13. -- PAGE: view levels
  14. INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
  15. ('bx_acl_view', '_bx_acl_page_title_sys_view', '_bx_acl_page_title_view', @sName, 5, 2147483647, 1, 'acl-view', 'page.php?i=acl-view', '', '', '', 0, 1, 0, 'BxAclPageView', 'modules/boonex/acl/classes/BxAclPageView.php');
  16. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  17. ('bx_acl_view', 1, @sName, '_bx_acl_page_block_title_system_view', '_bx_acl_page_block_title_view', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:6:\"bx_acl\";s:6:\"method\";s:14:\"get_block_view\";}', 0, 1, 0);
  18. -- MENU: account settings menu
  19. SET @iMoAccountSettings = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_settings' AND `order` < 9999 LIMIT 1);
  20. INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES
  21. ('sys_account_settings', 'bx_acl', 'acl-view', '_bx_acl_menu_item_title_system_acl_view', '_bx_acl_menu_item_title_acl_view', 'page.php?i=acl-view', '', '', 'shield-alt col-red2', '', '', 2147483646, 1, 0, 1, @iMoAccountSettings + 1);
  22. -- EMAIL TEMPLATES
  23. INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
  24. (@sName, '_bx_acl_et_txt_name_subscription_cancel_required', 'bx_acl_subscription_cancel_required', '_bx_acl_et_txt_subject_subscription_cancel_required', '_bx_acl_et_txt_body_subscription_cancel_required');
  25. -- ALERTS
  26. INSERT INTO `sys_alerts_handlers`(`name`, `class`, `file`, `service_call`) VALUES
  27. (@sName, 'BxAclResponse', 'modules/boonex/acl/classes/BxAclResponse.php', '');
  28. SET @iHandler := LAST_INSERT_ID();
  29. INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
  30. ('system', 'page_output_block_acl_level', @iHandler),
  31. ('acl', 'deleted', @iHandler);