1
0

install.sql 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. -- TABLE: entries
  2. CREATE TABLE IF NOT EXISTS `bx_resources_entries` (
  3. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  4. `author` int(11) NOT NULL,
  5. `list` int(11) NOT NULL,
  6. `added` int(11) NOT NULL,
  7. `changed` int(11) NOT NULL,
  8. `published` int(11) NOT NULL,
  9. `thumb` int(11) NOT NULL,
  10. `thumb_data` varchar(50) NOT NULL,
  11. `link` varchar(255) NOT NULL,
  12. `title` varchar(255) NOT NULL,
  13. `cat` int(11) NOT NULL,
  14. `text` mediumtext NOT NULL,
  15. `labels` text NOT NULL,
  16. `views` int(11) NOT NULL default '0',
  17. `rate` float NOT NULL default '0',
  18. `votes` int(11) NOT NULL default '0',
  19. `rrate` float NOT NULL default '0',
  20. `rvotes` int(11) NOT NULL default '0',
  21. `score` int(11) NOT NULL default '0',
  22. `sc_up` int(11) NOT NULL default '0',
  23. `sc_down` int(11) NOT NULL default '0',
  24. `comments` int(11) NOT NULL default '0',
  25. `reports` int(11) NOT NULL default '0',
  26. `cf` int(11) NOT NULL default '1',
  27. `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
  28. `allow_comments` tinyint(4) NOT NULL DEFAULT '0',
  29. `status` enum('active','awaiting','failed','hidden') NOT NULL DEFAULT 'active',
  30. `status_admin` enum('active','hidden','pending') NOT NULL DEFAULT 'active',
  31. PRIMARY KEY (`id`),
  32. FULLTEXT KEY `title_text` (`title`,`text`)
  33. );
  34. -- TABLE: lists
  35. CREATE TABLE IF NOT EXISTS `bx_resources_lists` (
  36. `id` int(11) NOT NULL AUTO_INCREMENT,
  37. `context_id` int(11) NOT NULL,
  38. `title` varchar(255) NOT NULL,
  39. `default` tinyint(4) NOT NULL default '0',
  40. PRIMARY KEY (`id`)
  41. );
  42. -- TABLE: storages & transcoders
  43. CREATE TABLE IF NOT EXISTS `bx_resources_covers` (
  44. `id` int(11) NOT NULL AUTO_INCREMENT,
  45. `profile_id` int(10) unsigned NOT NULL,
  46. `remote_id` varchar(128) NOT NULL,
  47. `path` varchar(255) NOT NULL,
  48. `file_name` varchar(255) NOT NULL,
  49. `mime_type` varchar(128) NOT NULL,
  50. `ext` varchar(32) NOT NULL,
  51. `size` bigint(20) NOT NULL,
  52. `dimensions` varchar(12) NOT NULL,
  53. `added` int(11) NOT NULL,
  54. `modified` int(11) NOT NULL,
  55. `private` int(11) NOT NULL,
  56. PRIMARY KEY (`id`),
  57. UNIQUE KEY `remote_id` (`remote_id`)
  58. );
  59. CREATE TABLE IF NOT EXISTS `bx_resources_photos_resized` (
  60. `id` int(11) NOT NULL AUTO_INCREMENT,
  61. `profile_id` int(10) unsigned NOT NULL,
  62. `remote_id` varchar(128) NOT NULL,
  63. `path` varchar(255) NOT NULL,
  64. `file_name` varchar(255) NOT NULL,
  65. `mime_type` varchar(128) NOT NULL,
  66. `ext` varchar(32) NOT NULL,
  67. `size` bigint(20) NOT NULL,
  68. `added` int(11) NOT NULL,
  69. `modified` int(11) NOT NULL,
  70. `private` int(11) NOT NULL,
  71. PRIMARY KEY (`id`),
  72. UNIQUE KEY `remote_id` (`remote_id`)
  73. );
  74. -- TABLE: comments
  75. CREATE TABLE IF NOT EXISTS `bx_resources_cmts` (
  76. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  77. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  78. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  79. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  80. `cmt_author_id` int(11) NOT NULL DEFAULT '0',
  81. `cmt_level` int(11) NOT NULL DEFAULT '0',
  82. `cmt_text` text NOT NULL,
  83. `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
  84. `cmt_rate` int(11) NOT NULL DEFAULT '0',
  85. `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
  86. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  87. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  88. `cmt_pinned` int(11) NOT NULL default '0',
  89. `cmt_cf` int(11) NOT NULL default '1',
  90. PRIMARY KEY (`cmt_id`),
  91. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  92. FULLTEXT KEY `search_fields` (`cmt_text`)
  93. );
  94. -- TABLE: votes
  95. CREATE TABLE IF NOT EXISTS `bx_resources_votes` (
  96. `id` int(11) NOT NULL AUTO_INCREMENT,
  97. `object_id` int(11) NOT NULL default '0',
  98. `count` int(11) NOT NULL default '0',
  99. `sum` int(11) NOT NULL default '0',
  100. PRIMARY KEY (`id`),
  101. UNIQUE KEY `object_id` (`object_id`)
  102. );
  103. CREATE TABLE IF NOT EXISTS `bx_resources_votes_track` (
  104. `id` int(11) NOT NULL AUTO_INCREMENT,
  105. `object_id` int(11) NOT NULL default '0',
  106. `author_id` int(11) NOT NULL default '0',
  107. `author_nip` int(11) unsigned NOT NULL default '0',
  108. `value` tinyint(4) NOT NULL default '0',
  109. `date` int(11) NOT NULL default '0',
  110. PRIMARY KEY (`id`),
  111. KEY `vote` (`object_id`, `author_nip`)
  112. );
  113. CREATE TABLE IF NOT EXISTS `bx_resources_reactions` (
  114. `id` int(11) NOT NULL AUTO_INCREMENT,
  115. `object_id` int(11) NOT NULL default '0',
  116. `reaction` varchar(32) NOT NULL default '',
  117. `count` int(11) NOT NULL default '0',
  118. `sum` int(11) NOT NULL default '0',
  119. PRIMARY KEY (`id`),
  120. UNIQUE KEY `reaction` (`object_id`, `reaction`)
  121. );
  122. CREATE TABLE IF NOT EXISTS `bx_resources_reactions_track` (
  123. `id` int(11) NOT NULL AUTO_INCREMENT,
  124. `object_id` int(11) NOT NULL default '0',
  125. `author_id` int(11) NOT NULL default '0',
  126. `author_nip` int(11) unsigned NOT NULL default '0',
  127. `reaction` varchar(32) NOT NULL default '',
  128. `value` tinyint(4) NOT NULL default '0',
  129. `date` int(11) NOT NULL default '0',
  130. PRIMARY KEY (`id`),
  131. KEY `vote` (`object_id`, `author_nip`)
  132. );
  133. -- TABLE: views
  134. CREATE TABLE `bx_resources_views_track` (
  135. `id` int(11) NOT NULL AUTO_INCREMENT,
  136. `object_id` int(11) NOT NULL default '0',
  137. `viewer_id` int(11) NOT NULL default '0',
  138. `viewer_nip` int(11) unsigned NOT NULL default '0',
  139. `date` int(11) NOT NULL default '0',
  140. PRIMARY KEY (`id`),
  141. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  142. );
  143. -- TABLE: reports
  144. CREATE TABLE IF NOT EXISTS `bx_resources_reports` (
  145. `id` int(11) NOT NULL AUTO_INCREMENT,
  146. `object_id` int(11) NOT NULL default '0',
  147. `count` int(11) NOT NULL default '0',
  148. PRIMARY KEY (`id`),
  149. UNIQUE KEY `object_id` (`object_id`)
  150. );
  151. CREATE TABLE IF NOT EXISTS `bx_resources_reports_track` (
  152. `id` int(11) NOT NULL AUTO_INCREMENT,
  153. `object_id` int(11) NOT NULL default '0',
  154. `author_id` int(11) NOT NULL default '0',
  155. `author_nip` int(11) unsigned NOT NULL default '0',
  156. `type` varchar(32) NOT NULL default '',
  157. `text` text NOT NULL default '',
  158. `date` int(11) NOT NULL default '0',
  159. `checked_by` int(11) NOT NULL default '0',
  160. `status` tinyint(11) NOT NULL default '0',
  161. PRIMARY KEY (`id`),
  162. KEY `report` (`object_id`, `author_nip`)
  163. );
  164. -- TABLE: scores
  165. CREATE TABLE IF NOT EXISTS `bx_resources_scores` (
  166. `id` int(11) NOT NULL AUTO_INCREMENT,
  167. `object_id` int(11) NOT NULL default '0',
  168. `count_up` int(11) NOT NULL default '0',
  169. `count_down` int(11) NOT NULL default '0',
  170. PRIMARY KEY (`id`),
  171. UNIQUE KEY `object_id` (`object_id`)
  172. );
  173. CREATE TABLE IF NOT EXISTS `bx_resources_scores_track` (
  174. `id` int(11) NOT NULL AUTO_INCREMENT,
  175. `object_id` int(11) NOT NULL default '0',
  176. `author_id` int(11) NOT NULL default '0',
  177. `author_nip` int(11) unsigned NOT NULL default '0',
  178. `type` varchar(8) NOT NULL default '',
  179. `date` int(11) NOT NULL default '0',
  180. PRIMARY KEY (`id`),
  181. KEY `vote` (`object_id`, `author_nip`)
  182. );
  183. -- STORAGES & TRANSCODERS
  184. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  185. 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
  186. ('bx_resources_covers', @sStorageEngine, '', 360, 2592000, 3, 'bx_resources_covers', 'allow-deny', '{image}', '', 0, 0, 0, 0, 0, 0),
  187. ('bx_resources_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_resources_photos_resized', 'allow-deny', '{image}', '', 0, 0, 0, 0, 0, 0);
  188. INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`, `override_class_name`, `override_class_file`) VALUES
  189. ('bx_resources_preview', 'bx_resources_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_resources_covers";}', 'no', '1', '2592000', '0', '', ''),
  190. ('bx_resources_miniature', 'bx_resources_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_resources_covers";}', 'no', '1', '2592000', '0', '', ''),
  191. ('bx_resources_gallery', 'bx_resources_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_resources_covers";}', 'no', '1', '2592000', '0', '', ''),
  192. ('bx_resources_cover', 'bx_resources_photos_resized', 'Storage', 'a:1:{s:6:"object";s:19:"bx_resources_covers";}', 'no', '1', '2592000', '0', '', '');
  193. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  194. ('bx_resources_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
  195. ('bx_resources_miniature', 'Resize', 'a:1:{s:1:"w";s:3:"300";}', '0'),
  196. ('bx_resources_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0'),
  197. ('bx_resources_cover', 'Resize', 'a:1:{s:1:"w";s:4:"1200";}', '0');
  198. -- FORMS: entry (resource)
  199. INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  200. ('bx_resources', 'bx_resources', '_bx_resources_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_resources_entries', 'id', '', '', 'a:2:{i:0;s:9:"do_submit";i:1;s:10:"do_publish";}', '', 0, 1, 'BxResourcesFormEntry', 'modules/boonex/resources/classes/BxResourcesFormEntry.php');
  201. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  202. ('bx_resources', 'bx_resources_entry_add', 'bx_resources', 0, '_bx_resources_form_entry_display_add'),
  203. ('bx_resources', 'bx_resources_entry_delete', 'bx_resources', 0, '_bx_resources_form_entry_display_delete'),
  204. ('bx_resources', 'bx_resources_entry_edit', 'bx_resources', 0, '_bx_resources_form_entry_display_edit'),
  205. ('bx_resources', 'bx_resources_entry_view', 'bx_resources', 1, '_bx_resources_form_entry_display_view');
  206. INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
  207. ('bx_resources', 'bx_resources', 'allow_view_to', '', '', 0, 'custom', '_bx_resources_form_entry_input_sys_allow_view_to', '_bx_resources_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  208. ('bx_resources', 'bx_resources', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_resources_form_entry_input_sys_delete_confirm', '_bx_resources_form_entry_input_delete_confirm', '_bx_resources_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_resources_form_entry_input_delete_confirm_error', '', '', 1, 0),
  209. ('bx_resources', 'bx_resources', 'do_publish', '_bx_resources_form_entry_input_do_publish', '', 0, 'submit', '_bx_resources_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  210. ('bx_resources', 'bx_resources', 'do_submit', '_bx_resources_form_entry_input_do_submit', '', 0, 'submit', '_bx_resources_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  211. ('bx_resources', 'bx_resources', 'do_cancel', '_bx_resources_form_entry_input_do_cancel', '', 0, 'button', '_bx_resources_form_entry_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 1, 0),
  212. ('bx_resources', 'bx_resources', 'do_cancel_edit', '_bx_resources_form_entry_input_do_cancel_edit', '', 0, 'button', '_bx_resources_form_entry_input_sys_do_cancel_edit', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:41:"window.open(''{edit_cancel_url}'', ''_self'')";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0),
  213. ('bx_resources', 'bx_resources', 'controls', '', 'do_publish,do_cancel', 0, 'input_set', '_bx_resources_form_entry_input_sys_controls', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  214. ('bx_resources', 'bx_resources', 'controls_edit', '', 'do_submit,do_cancel_edit', 0, 'input_set', '_bx_resources_form_entry_input_sys_controls_edit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  215. ('bx_resources', 'bx_resources', 'controls_edit_popup', '', 'do_submit,do_cancel', 0, 'input_set', '_bx_resources_form_entry_input_sys_controls_edit_popup', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  216. ('bx_resources', 'bx_resources', 'covers', 'a:1:{i:0;s:18:"bx_resources_html5";}', 'a:1:{s:18:"bx_resources_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_resources_form_entry_input_sys_covers', '_bx_resources_form_entry_input_covers', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  217. ('bx_resources', 'bx_resources', 'link', '', '', 0, 'text', '_bx_resources_form_entry_input_sys_link', '_bx_resources_form_entry_input_link', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_resources_form_entry_input_link_err', 'Xss', '', 1, 0),
  218. ('bx_resources', 'bx_resources', 'title', '', '', 0, 'text', '_bx_resources_form_entry_input_sys_title', '_bx_resources_form_entry_input_title', '_bx_resources_form_entry_input_title_inf', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  219. ('bx_resources', 'bx_resources', 'text', '', '', 0, 'textarea', '_bx_resources_form_entry_input_sys_text', '_bx_resources_form_entry_input_text', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
  220. ('bx_resources', 'bx_resources', 'cat', '', '#!bx_resources_cats', 0, 'select', '_bx_resources_form_entry_input_sys_cat', '_bx_resources_form_entry_input_cat', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
  221. ('bx_resources', 'bx_resources', 'added', '', '', 0, 'datetime', '_bx_resources_form_entry_input_sys_date_added', '_bx_resources_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  222. ('bx_resources', 'bx_resources', 'changed', '', '', 0, 'datetime', '_bx_resources_form_entry_input_sys_date_changed', '_bx_resources_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  223. ('bx_resources', 'bx_resources', 'published', '', '', 0, 'datetime', '_bx_resources_form_entry_input_sys_date_published', '_bx_resources_form_entry_input_date_published', '_bx_resources_form_entry_input_date_published_info', 0, 0, 0, '', '', '', '', '', '', 'DateTimeTs', '', 1, 0),
  224. ('bx_resources', 'bx_resources', 'allow_comments', '1', '', 0, 'switcher', '_bx_resources_form_entry_input_sys_allow_comments', '_bx_resources_form_entry_input_allow_comments', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 1, 0);
  225. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  226. ('bx_resources_entry_add', 'link', 2147483647, 1, 1),
  227. ('bx_resources_entry_add', 'title', 2147483647, 1, 2),
  228. ('bx_resources_entry_add', 'covers', 2147483647, 1, 3),
  229. ('bx_resources_entry_add', 'controls', 2147483647, 1, 4),
  230. ('bx_resources_entry_add', 'do_publish', 2147483647, 1, 5),
  231. ('bx_resources_entry_add', 'do_cancel', 2147483647, 1, 6),
  232. ('bx_resources_entry_delete', 'delete_confirm', 2147483647, 1, 1),
  233. ('bx_resources_entry_delete', 'do_submit', 2147483647, 1, 2),
  234. ('bx_resources_entry_edit', 'link', 2147483647, 1, 1),
  235. ('bx_resources_entry_edit', 'title', 2147483647, 1, 2),
  236. ('bx_resources_entry_edit', 'covers', 2147483647, 1, 3),
  237. ('bx_resources_entry_edit', 'controls_edit', 2147483647, 1, 4),
  238. ('bx_resources_entry_edit', 'do_submit', 2147483647, 1, 5),
  239. ('bx_resources_entry_edit', 'do_cancel_edit', 2147483647, 1, 6),
  240. ('bx_resources_entry_view', 'link', 2147483647, 1, 1),
  241. ('bx_resources_entry_view', 'added', 2147483647, 1, 2),
  242. ('bx_resources_entry_view', 'changed', 2147483647, 1, 3);
  243. -- FORMS: list (resources list)
  244. INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  245. ('bx_resources_list', 'bx_resources', '_bx_resources_form_list_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_resources_lists', 'id', '', '', 'do_submit', '', 0, 1, 'BxResourcesFormListEntry', 'modules/boonex/resources/classes/BxResourcesFormListEntry.php');
  246. INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES
  247. ('bx_resources_list', 'bx_resources_list_entry_add', 'bx_resources', 0, '_bx_resources_form_list_entry_display_add'),
  248. ('bx_resources_list', 'bx_resources_list_entry_edit', 'bx_resources', 0, '_bx_resources_form_list_entry_display_edit');
  249. INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
  250. ('bx_resources_list', 'bx_resources', 'do_submit', '_bx_resources_form_list_entry_input_do_submit', '', 0, 'submit', '_bx_resources_form_list_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  251. ('bx_resources_list', 'bx_resources', 'title', '', '', 0, 'text', '_bx_resources_form_list_entry_input_sys_title', '_bx_resources_form_list_entry_input_title', '', 1, 0, 0, '', '', '', 'Length', 'a:2:{s:3:"min";i:3;s:3:"max";i:160;}', '_bx_resources_form_list_entry_input_title_err', 'Xss', '', 1, 0),
  252. ('bx_resources_list', 'bx_resources', 'do_cancel', '_bx_resources_form_entry_input_do_cancel', '', 0, 'button', '_bx_resources_form_entry_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 1, 0),
  253. ('bx_resources_list', 'bx_resources', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
  254. INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  255. ('bx_resources_list_entry_add', 'title', 2147483647, 1, 1),
  256. ('bx_resources_list_entry_add', 'controls', 2147483647, 1, 2),
  257. ('bx_resources_list_entry_add', 'do_submit', 2147483647, 1, 3),
  258. ('bx_resources_list_entry_add', 'do_cancel', 2147483647, 1, 4),
  259. ('bx_resources_list_entry_edit', 'title', 2147483647, 1, 1),
  260. ('bx_resources_list_entry_edit', 'controls', 2147483647, 1, 2),
  261. ('bx_resources_list_entry_edit', 'do_submit', 2147483647, 1, 3),
  262. ('bx_resources_list_entry_edit', 'do_cancel', 2147483647, 1, 4);
  263. -- PRE-VALUES
  264. INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
  265. ('bx_resources_cats', '_bx_resources_pre_lists_cats', 'bx_resources', '0');
  266. INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
  267. ('bx_resources_cats', '', 0, '_sys_please_select', ''),
  268. ('bx_resources_cats', '1', 1, '_bx_resources_cat_links', ''),
  269. ('bx_resources_cats', '2', 2, '_bx_resources_cat_media', ''),
  270. ('bx_resources_cats', '3', 3, '_bx_resources_cat_other', '');
  271. -- COMMENTS
  272. INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Html`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
  273. ('bx_resources', 'bx_resources', 'bx_resources_cmts', 1, 5000, 1000, 3, 50, 10, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-resource&id={object_id}', '', 'bx_resources_entries', 'id', 'author', 'title', 'comments', 'BxResourcesCmts', 'modules/boonex/resources/classes/BxResourcesCmts.php');
  274. -- VOTES
  275. INSERT INTO `sys_objects_vote` (`Name`, `Module`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES
  276. ('bx_resources', 'bx_resources', 'bx_resources_votes', 'bx_resources_votes_track', '604800', '1', '1', '0', '1', 'bx_resources_entries', 'id', 'author', 'rate', 'votes', '', ''),
  277. ('bx_resources_reactions', 'bx_resources', 'bx_resources_reactions', 'bx_resources_reactions_track', '604800', '1', '1', '1', '1', 'bx_resources_entries', 'id', 'author', 'rrate', 'rvotes', 'BxTemplVoteReactions', '');
  278. -- SCORES
  279. INSERT INTO `sys_objects_score` (`name`, `module`, `table_main`, `table_track`, `post_timeout`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_score`, `trigger_field_cup`, `trigger_field_cdown`, `class_name`, `class_file`) VALUES
  280. ('bx_resources', 'bx_resources', 'bx_resources_scores', 'bx_resources_scores_track', '604800', '0', 'bx_resources_entries', 'id', 'author', 'score', 'sc_up', 'sc_down', '', '');
  281. -- REPORTS
  282. INSERT INTO `sys_objects_report` (`name`, `module`, `table_main`, `table_track`, `pruning`, `is_on`, `base_url`, `object_comment`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  283. ('bx_resources', 'bx_resources', 'bx_resources_reports', 'bx_resources_reports_track', '31536000', '1', 'page.php?i=view-resource&id={object_id}', '', 'bx_resources_entries', 'id', 'author', 'reports', '', '');
  284. -- VIEWS
  285. INSERT INTO `sys_objects_view` (`name`, `module`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
  286. ('bx_resources', 'bx_resources', 'bx_resources_views_track', '86400', '1', 'bx_resources_entries', 'id', 'author', 'views', '', '');
  287. -- CONTENT INFO
  288. INSERT INTO `sys_objects_content_info` (`name`, `title`, `alert_unit`, `alert_action_add`, `alert_action_update`, `alert_action_delete`, `class_name`, `class_file`) VALUES
  289. ('bx_resources', '_bx_resources', 'bx_resources', 'added', 'edited', 'deleted', '', ''),
  290. ('bx_resources_cmts', '_bx_resources_cmts', 'bx_resources', 'commentPost', 'commentUpdated', 'commentRemoved', 'BxDolContentInfoCmts', '');
  291. -- SEARCH EXTENDED
  292. INSERT INTO `sys_objects_search_extended` (`object`, `object_content_info`, `module`, `title`, `active`, `class_name`, `class_file`) VALUES
  293. ('bx_resources', 'bx_resources', 'bx_resources', '_bx_resources_search_extended', 1, '', ''),
  294. ('bx_resources_cmts', 'bx_resources_cmts', 'bx_resources', '_bx_resources_search_extended_cmts', 1, 'BxTemplSearchExtendedCmts', '');
  295. -- STUDIO: page & widget
  296. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  297. (3, 'bx_resources', '_bx_resources', '_bx_resources', 'bx_resources@modules/boonex/resources/|std-icon.svg');
  298. SET @iPageId = LAST_INSERT_ID();
  299. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  300. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  301. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  302. (@iPageId, 'bx_resources', 'content', '{url_studio}module.php?name=bx_resources', '', 'bx_resources@modules/boonex/resources/|std-icon.svg', '_bx_resources', '', '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";}');
  303. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  304. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));