enable.sql 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. -- SETTINGS
  2. SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
  3. INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES
  4. ('modules', 'bx_notes', '_bx_notes', 'bx_notes@modules/boonex/notes/|std-mi.png', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
  5. SET @iTypeId = LAST_INSERT_ID();
  6. INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
  7. VALUES (@iTypeId, 'bx_notes', '_bx_notes', 1);
  8. SET @iCategId = LAST_INSERT_ID();
  9. INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
  10. ('bx_notes_autoapproval', 'on', @iCategId, 'Activate notes after creation automatically', 'checkbox', '', '', '', 1),
  11. ('bx_notes_summary_chars', '700', @iCategId, 'Number of characters in auto-cropped note summary', 'digit', '', '', '', 2);
  12. -- STORAGES & TRANSCODERS
  13. SET @iTotalFilesSize = (SELECT SUM(`size`) FROM `bx_notes_photos`);
  14. SET @iTotalFilesNum = (SELECT COUNT(*) FROM `bx_notes_photos`);
  15. INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
  16. ('bx_notes_photos', 'Local', '', 360, 2592000, 3, 'bx_notes_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, @iTotalFilesSize, 0, @iTotalFilesNum, 0, 0),
  17. ('bx_notes_photos_resized', 'Local', '', 360, 2592000, 3, 'bx_notes_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, @iTotalFilesSize, 0, @iTotalFilesNum, 0, 0);
  18. INSERT INTO `sys_objects_transcoder_images` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES
  19. ('bx_notes_preview', 'bx_notes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_notes_photos";}', 'no', '1', '2592000', '0');
  20. INSERT INTO `sys_transcoder_images_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  21. ('bx_notes_preview', 'Resize', 'a:4:{s:1:"w";s:3:"100";s:1:"h";s:3:"100";s:13:"square_resize";s:1:"1";s:10:"force_type";s:3:"jpg";}', '0');
  22. -- PAGES
  23. --
  24. -- Dumping data for 'bx_notes_create_note' page
  25. --
  26. 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
  27. ('bx_notes_create_note', '_bx_notes_page_title_sys_create_note', '_bx_notes_page_title_create_note', 'bx_notes', 5, 2147483647, 1, 'create-note', 'page.php?i=create-note', '', '', '', 0, 1, 0, 'BxNotesPageBrowse', 'modules/boonex/notes/classes/BxNotesPageBrowse.php');
  28. INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  29. ('bx_notes_create_note', 1, 'bx_notes', '_bx_notes_page_block_title_create_note', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_notes";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
  30. --
  31. -- Dumping data for 'bx_notes_edit_note' page
  32. --
  33. 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
  34. ('bx_notes_edit_note', '_bx_notes_page_title_sys_edit_note', '_bx_notes_page_title_edit_note', 'bx_notes', 5, 2147483647, 1, 'edit-note', '', '', '', '', 0, 1, 0, 'BxNotesPageNote', 'modules/boonex/notes/classes/BxNotesPageNote.php');
  35. INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  36. ('bx_notes_edit_note', 1, 'bx_notes', '_bx_notes_page_block_title_edit_note', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_notes";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
  37. --
  38. -- Dumping data for 'bx_notes_delete_note' page
  39. --
  40. 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
  41. ('bx_notes_delete_note', '_bx_notes_page_title_sys_delete_note', '_bx_notes_page_title_delete_note', 'bx_notes', 5, 2147483647, 1, 'delete-note', '', '', '', '', 0, 1, 0, 'BxNotesPageNote', 'modules/boonex/notes/classes/BxNotesPageNote.php');
  42. INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  43. ('bx_notes_delete_note', 1, 'bx_notes', '_bx_notes_page_block_title_delete_note', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_notes";s:6:"method";s:13:"entity_delete";}', 0, 0, 0);
  44. --
  45. -- Dumping data for 'bx_notes_view_note' page
  46. --
  47. 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
  48. ('bx_notes_view_note', '_bx_notes_page_title_sys_view_note', '_bx_notes_page_title_view_note', 'bx_notes', 6, 2147483647, 1, 'view-note', '', '', '', '', 0, 1, 0, 'BxNotesPageNote', 'modules/boonex/notes/classes/BxNotesPageNote.php');
  49. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  50. ('bx_notes_view_note', 1, 'bx_notes', '_bx_notes_page_block_title_note_author', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 0),
  51. ('bx_notes_view_note', 1, 'bx_notes', '_bx_notes_page_block_title_note_text', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1),
  52. ('bx_notes_view_note', 1, 'bx_notes', '_bx_notes_page_block_title_note_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 2),
  53. ('bx_notes_view_note', 1, 'bx_notes', '_bx_notes_page_block_title_note_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 3);
  54. --
  55. -- Dumping data for 'bx_notes_view_note_comments' page
  56. --
  57. 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
  58. ('bx_notes_view_note_comments', '_bx_notes_page_title_sys_view_note_comments', '_bx_notes_page_title_view_note_comments', 'bx_notes', 5, 2147483647, 1, 'view-note-comments', '', '', '', '', 0, 1, 0, 'BxNotesPageNote', 'modules/boonex/notes/classes/BxNotesPageNote.php');
  59. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  60. ('bx_notes_view_note_comments', 1, 'bx_notes', '_bx_notes_page_block_title_note_comments', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
  61. --
  62. -- Dumping data for 'bx_notes_home' page
  63. --
  64. 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
  65. ('bx_notes_home', '_bx_notes_page_title_sys_notes_home', '_bx_notes_page_title_notes_home', 'bx_notes', 5, 2147483647, 1, 'notes-home', 'page.php?i=notes-home', '', '', '', 0, 1, 0, 'BxNotesPageBrowse', 'modules/boonex/notes/classes/BxNotesPageBrowse.php');
  66. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  67. ('bx_notes_home', 1, 'bx_notes', '_bx_notes_page_block_title_recent_notes', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:13:\"browse_public\";}', 0, 1, 0);
  68. --
  69. -- Dumping data for 'bx_notes_featured' page
  70. --
  71. 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
  72. ('bx_notes_featured', '_bx_notes_page_title_sys_notes_featured', '_bx_notes_page_title_notes_featured', 'bx_notes', 5, 2147483647, 1, 'notes-featured', 'page.php?i=notes-featured', '', '', '', 0, 1, 0, 'BxNotesPageBrowse', 'modules/boonex/notes/classes/BxNotesPageBrowse.php');
  73. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  74. ('bx_notes_featured', 1, 'bx_notes', '_bx_notes_page_block_title_featured_notes', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:15:\"browse_featured\";}', 0, 1, 1);
  75. --
  76. -- Dumping data for 'bx_notes_author' page
  77. --
  78. INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
  79. ('bx_notes_author', 'notes-author', '_bx_notes_page_title_sys_notes_author', '_bx_notes_page_title_notes_author', 'bx_notes', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxNotesPageAuthor', 'modules/boonex/notes/classes/BxNotesPageAuthor.php');
  80. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  81. ('bx_notes_author', 1, 'bx_notes', '_bx_notes_page_block_title_notes_author', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_notes\";s:6:\"method\";s:13:\"browse_author\";}', 0, 0, 1);
  82. -- MENU
  83. SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
  84. INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
  85. ('sys_site', 'bx_notes', 'notes-home', '_bx_notes_menu_item_title_system_notes_home', '_bx_notes_menu_item_title_notes_home', 'page.php?i=notes-home', '', '', 'file-text col-red3', 'bx_notes_submenu', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
  86. SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
  87. INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
  88. ('sys_add_content_links', 'bx_notes', 'create-note', '_bx_notes_menu_item_title_system_create_note', '_bx_notes_menu_item_title_create_note', 'page.php?i=create-note', '', '', '', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
  89. --
  90. -- Dumping data for 'bx_notes_view' menu
  91. --
  92. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  93. ('bx_notes_view', '_bx_notes_menu_title_view_note', 'bx_notes_view', 'bx_notes', 10, 0, 1, 'BxNotesMenuView', 'modules/boonex/notes/classes/BxNotesMenuView.php');
  94. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  95. ('bx_notes_view', 'bx_notes', '_bx_notes_menu_set_title_view_note', 0);
  96. INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
  97. ('bx_notes_view', 'bx_notes', 'view-note', '_bx_notes_menu_item_title_system_view_note', '_bx_notes_menu_item_title_view_note', 'page.php?i=view-note&id={content_id}', '', '', 'eye', '', 0, 1, 0, 0),
  98. ('bx_notes_view', 'bx_notes', 'edit-note', '_bx_notes_menu_item_title_system_edit_note', '_bx_notes_menu_item_title_edit_note', 'page.php?i=edit-note&id={content_id}', '', '', 'pencil', '', 0, 1, 0, 1),
  99. ('bx_notes_view', 'bx_notes', 'delete-note', '_bx_notes_menu_item_title_system_delete_note', '_bx_notes_menu_item_title_delete_note', 'page.php?i=delete-note&id={content_id}', '', '', 'remove', '', 0, 1, 0, 2);
  100. --
  101. -- Dumping data for 'bx_notes_my' menu
  102. --
  103. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  104. ('bx_notes_my', '_bx_notes_menu_title_notes_my', 'bx_notes_my', 'bx_notes', 10, 0, 1, 'BxNotesMenuMy', 'modules/boonex/notes/classes/BxNotesMenuMy.php');
  105. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  106. ('bx_notes_my', 'bx_notes', '_bx_notes_menu_set_title_notes_my', 0);
  107. INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
  108. ('bx_notes_my', 'bx_notes', 'create-note', '_bx_notes_menu_item_title_system_create_note', '_bx_notes_menu_item_title_create_note', 'page.php?i=create-note', '', '', 'plus', '', 0, 1, 0, 0);
  109. --
  110. -- Dumping data for 'bx_notes_submenu' menu
  111. --
  112. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  113. ('bx_notes_submenu', '_bx_notes_menu_title_submenu', 'bx_notes_submenu', 'bx_notes', 8, 0, 1, '', '');
  114. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  115. ('bx_notes_submenu', 'bx_notes', '_bx_notes_menu_set_title_submenu', 0);
  116. INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
  117. ('bx_notes_submenu', 'bx_notes', 'notes-home', '_bx_notes_menu_item_title_system_notes_public', '_bx_notes_menu_item_title_notes_public', 'page.php?i=notes-home', '', '', '', '', 2147483647, 1, 1, 1),
  118. ('bx_notes_submenu', 'bx_notes', 'notes-featured', '_bx_notes_menu_item_title_system_notes_featured', '_bx_notes_menu_item_title_notes_featured', 'page.php?i=notes-featured', '', '', '', '', 2147483647, 1, 1, 2);
  119. --
  120. -- Dumping data for 'bx_notes_view_submenu' menu
  121. --
  122. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  123. ('bx_notes_view_submenu', '_bx_notes_menu_title_view_note_submenu', 'bx_notes_view_submenu', 'bx_notes', 8, 0, 1, 'BxNotesMenuView', 'modules/boonex/notes/classes/BxNotesMenuView.php');
  124. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  125. ('bx_notes_view_submenu', 'bx_notes', '_bx_notes_menu_set_title_view_note_submenu', 0);
  126. INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
  127. ('bx_notes_view_submenu', 'bx_notes', 'view-note', '_bx_notes_menu_item_title_system_view_note', '_bx_notes_menu_item_title_view_note_submenu_note', 'page.php?i=view-note&id={content_id}', '', '', '', '', 2147483647, 1, 0, 1),
  128. ('bx_notes_view_submenu', 'bx_notes', 'view-note-comments', '_bx_notes_menu_item_title_system_view_note_comments', '_bx_notes_menu_item_title_view_note_submenu_comments', 'page.php?i=view-note-comments&id={content_id}', '', '', '', '', 2147483647, 1, 0, 2);
  129. -- NOTES menu in PROFILES module
  130. SET @iProfileMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'bx_persons_view_submenu' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
  131. INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
  132. ('bx_persons_view_submenu', 'bx_notes', 'notes-author', '_bx_notes_menu_item_title_system_view_notes_author', '_bx_notes_menu_item_title_view_notes_author', 'page.php?i=notes-author&profile_id={profile_id}', '', '', '', '', 2147483647, 1, 0, IFNULL(@iProfileMenuOrder, 0) + 1);
  133. -- PRIVACY
  134. INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
  135. ('bx_notes_allow_view_to', 'bx_notes', 'view', '_bx_notes_form_note_input_allow_view_to', '3', 'bx_notes_posts', 'id', 'author', '', '');
  136. -- ACL
  137. INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
  138. ('bx_notes', 'create note', NULL, '_bx_notes_acl_action_create_note', '', 1, 1);
  139. SET @iIdActionNoteCreate = LAST_INSERT_ID();
  140. INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
  141. ('bx_notes', 'delete note', NULL, '_bx_notes_acl_action_delete_note', '', 1, 1);
  142. SET @iIdActionNoteDelete = LAST_INSERT_ID();
  143. INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
  144. ('bx_notes', 'view note', NULL, '_bx_notes_acl_action_view_note', '', 1, 1);
  145. SET @iIdActionNoteView = LAST_INSERT_ID();
  146. INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
  147. ('bx_notes', 'set thumb', NULL, '_bx_notes_acl_action_set_thumb', '', 1, 1);
  148. SET @iIdActionSetThumb = LAST_INSERT_ID();
  149. INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
  150. ('bx_notes', 'edit any note', NULL, '_bx_notes_acl_action_edit_any_note', '', 1, 1);
  151. SET @iIdActionNoteEditAny = LAST_INSERT_ID();
  152. SET @iUnauthenticated = 1;
  153. SET @iStandard = 2;
  154. SET @iUnconfirmed = 3;
  155. SET @iPending = 4;
  156. SET @iSuspended = 5;
  157. SET @iModerator = 6;
  158. SET @iAdministrator = 7;
  159. SET @iPremium = 8;
  160. INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
  161. -- note create
  162. (@iStandard, @iIdActionNoteCreate),
  163. (@iModerator, @iIdActionNoteCreate),
  164. (@iAdministrator, @iIdActionNoteCreate),
  165. (@iPremium, @iIdActionNoteCreate),
  166. -- note delete
  167. (@iStandard, @iIdActionNoteDelete),
  168. (@iModerator, @iIdActionNoteDelete),
  169. (@iAdministrator, @iIdActionNoteDelete),
  170. (@iPremium, @iIdActionNoteDelete),
  171. -- note view
  172. (@iUnauthenticated, @iIdActionNoteView),
  173. (@iStandard, @iIdActionNoteView),
  174. (@iUnconfirmed, @iIdActionNoteView),
  175. (@iPending, @iIdActionNoteView),
  176. (@iModerator, @iIdActionNoteView),
  177. (@iAdministrator, @iIdActionNoteView),
  178. (@iPremium, @iIdActionNoteView),
  179. -- set note thumb
  180. (@iStandard, @iIdActionSetThumb),
  181. (@iModerator, @iIdActionSetThumb),
  182. (@iAdministrator, @iIdActionSetThumb),
  183. (@iPremium, @iIdActionSetThumb),
  184. -- any note edit
  185. (@iModerator, @iIdActionNoteEditAny),
  186. (@iAdministrator, @iIdActionNoteEditAny);
  187. -- COMMENTS
  188. INSERT INTO `sys_objects_cmts` (`Name`, `TableCmts`, `TableTrack`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
  189. ('bx_notes', 'bx_notes_cmts', 'bx_notes_cmts_track', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page/view-note&id={object_id}', 'bx_notes_posts', 'id', 'title', 'comments', '', '');