install.sql 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. SET @sName = 'bx_timeline';
  2. SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
  3. -- TABLES
  4. CREATE TABLE IF NOT EXISTS `bx_timeline_events` (
  5. `id` int(11) NOT NULL auto_increment,
  6. `owner_id` int(11) unsigned NOT NULL default '0',
  7. `type` varchar(255) NOT NULL,
  8. `action` varchar(255) NOT NULL,
  9. `object_id` text NOT NULL,
  10. `object_privacy_view` int(11) NOT NULL default '3',
  11. `content` text NOT NULL,
  12. `title` varchar(255) NOT NULL,
  13. `description` text NOT NULL,
  14. `views` int(11) unsigned NOT NULL default '0',
  15. `rate` float NOT NULL default '0',
  16. `votes` int(11) unsigned NOT NULL default '0',
  17. `comments` int(11) unsigned NOT NULL default '0',
  18. `reports` int(11) unsigned NOT NULL default '0',
  19. `reposts` int(11) unsigned NOT NULL default '0',
  20. `date` int(11) NOT NULL default '0',
  21. `active` tinyint(4) NOT NULL default '1',
  22. `hidden` tinyint(4) NOT NULL default '0',
  23. `pinned` int(11) NOT NULL default '0',
  24. `promoted` int(11) NOT NULL default '0',
  25. PRIMARY KEY (`id`),
  26. KEY `owner_id` (`owner_id`),
  27. FULLTEXT KEY `search_fields` (`title`, `description`)
  28. );
  29. CREATE TABLE IF NOT EXISTS `bx_timeline_handlers` (
  30. `id` int(11) NOT NULL auto_increment,
  31. `group` varchar(64) NOT NULL default '',
  32. `type` enum('insert','update','delete') NOT NULL DEFAULT 'insert',
  33. `alert_unit` varchar(64) NOT NULL default '',
  34. `alert_action` varchar(64) NOT NULL default '',
  35. `content` text NOT NULL,
  36. `privacy` varchar(64) NOT NULL default '',
  37. PRIMARY KEY (`id`),
  38. UNIQUE `handler` (`group`, `type`),
  39. UNIQUE `alert` (`alert_unit`, `alert_action`)
  40. );
  41. INSERT INTO `bx_timeline_handlers`(`group`, `type`, `alert_unit`, `alert_action`, `content`) VALUES
  42. ('common_post', 'insert', 'timeline_common_post', '', ''),
  43. ('common_repost', 'insert', 'timeline_common_repost', '', ''),
  44. ('profile', 'delete', 'profile', 'delete', '');
  45. -- TABLES: STORAGES, TRANSCODERS, UPLOADERS
  46. CREATE TABLE IF NOT EXISTS `bx_timeline_photos` (
  47. `id` int(11) NOT NULL AUTO_INCREMENT,
  48. `profile_id` int(10) unsigned NOT NULL,
  49. `remote_id` varchar(128) NOT NULL,
  50. `path` varchar(255) NOT NULL,
  51. `file_name` varchar(255) NOT NULL,
  52. `mime_type` varchar(128) NOT NULL,
  53. `ext` varchar(32) NOT NULL,
  54. `size` int(11) NOT NULL,
  55. `added` int(11) NOT NULL,
  56. `modified` int(11) NOT NULL,
  57. `private` int(11) NOT NULL,
  58. PRIMARY KEY (`id`),
  59. UNIQUE KEY `remote_id` (`remote_id`)
  60. );
  61. CREATE TABLE IF NOT EXISTS `bx_timeline_photos_processed` (
  62. `id` int(11) NOT NULL AUTO_INCREMENT,
  63. `profile_id` int(10) unsigned NOT NULL,
  64. `remote_id` varchar(128) NOT NULL,
  65. `path` varchar(255) NOT NULL,
  66. `file_name` varchar(255) NOT NULL,
  67. `mime_type` varchar(128) NOT NULL,
  68. `ext` varchar(32) NOT NULL,
  69. `size` int(11) NOT NULL,
  70. `added` int(11) NOT NULL,
  71. `modified` int(11) NOT NULL,
  72. `private` int(11) NOT NULL,
  73. PRIMARY KEY (`id`),
  74. UNIQUE KEY `remote_id` (`remote_id`)
  75. );
  76. CREATE TABLE IF NOT EXISTS `bx_timeline_photos2events` (
  77. `id` int(11) NOT NULL AUTO_INCREMENT,
  78. `event_id` int(11) NOT NULL DEFAULT '0',
  79. `media_id` int(11) NOT NULL DEFAULT '0',
  80. PRIMARY KEY (`id`),
  81. UNIQUE KEY `media` (`event_id`, `media_id`)
  82. );
  83. CREATE TABLE IF NOT EXISTS `bx_timeline_videos` (
  84. `id` int(11) NOT NULL AUTO_INCREMENT,
  85. `profile_id` int(10) unsigned NOT NULL,
  86. `remote_id` varchar(128) NOT NULL,
  87. `path` varchar(255) NOT NULL,
  88. `file_name` varchar(255) NOT NULL,
  89. `mime_type` varchar(128) NOT NULL,
  90. `ext` varchar(32) NOT NULL,
  91. `size` int(11) NOT NULL,
  92. `added` int(11) NOT NULL,
  93. `modified` int(11) NOT NULL,
  94. `private` int(11) NOT NULL,
  95. PRIMARY KEY (`id`),
  96. UNIQUE KEY `remote_id` (`remote_id`)
  97. );
  98. CREATE TABLE IF NOT EXISTS `bx_timeline_videos_processed` (
  99. `id` int(11) NOT NULL AUTO_INCREMENT,
  100. `profile_id` int(10) unsigned NOT NULL,
  101. `remote_id` varchar(128) NOT NULL,
  102. `path` varchar(255) NOT NULL,
  103. `file_name` varchar(255) NOT NULL,
  104. `mime_type` varchar(128) NOT NULL,
  105. `ext` varchar(32) NOT NULL,
  106. `size` int(11) NOT NULL,
  107. `added` int(11) NOT NULL,
  108. `modified` int(11) NOT NULL,
  109. `private` int(11) NOT NULL,
  110. PRIMARY KEY (`id`),
  111. UNIQUE KEY `remote_id` (`remote_id`)
  112. );
  113. CREATE TABLE IF NOT EXISTS `bx_timeline_videos2events` (
  114. `id` int(11) NOT NULL AUTO_INCREMENT,
  115. `event_id` int(11) NOT NULL DEFAULT '0',
  116. `media_id` int(11) NOT NULL DEFAULT '0',
  117. PRIMARY KEY (`id`),
  118. UNIQUE KEY `media` (`event_id`, `media_id`)
  119. );
  120. -- TABLES: LINKS
  121. CREATE TABLE IF NOT EXISTS `bx_timeline_links` (
  122. `id` int(11) NOT NULL AUTO_INCREMENT,
  123. `profile_id` int(10) unsigned NOT NULL,
  124. `media_id` int(11) NOT NULL DEFAULT '0',
  125. `url` varchar(255) NOT NULL,
  126. `title` varchar(255) NOT NULL,
  127. `text` text NOT NULL,
  128. `added` int(11) NOT NULL,
  129. PRIMARY KEY (`id`)
  130. );
  131. CREATE TABLE IF NOT EXISTS `bx_timeline_links2events` (
  132. `id` int(11) NOT NULL AUTO_INCREMENT,
  133. `event_id` int(11) NOT NULL DEFAULT '0',
  134. `link_id` int(11) NOT NULL DEFAULT '0',
  135. PRIMARY KEY (`id`),
  136. UNIQUE KEY `link` (`event_id`, `link_id`)
  137. );
  138. -- TABLES: REPOSTS
  139. CREATE TABLE IF NOT EXISTS `bx_timeline_reposts_track` (
  140. `event_id` int(11) NOT NULL default '0',
  141. `author_id` int(11) NOT NULL default '0',
  142. `author_nip` int(11) unsigned NOT NULL default '0',
  143. `reposted_id` int(11) NOT NULL default '0',
  144. `date` int(11) NOT NULL default '0',
  145. UNIQUE KEY `event_id` (`event_id`),
  146. KEY `repost` (`reposted_id`, `author_nip`)
  147. );
  148. -- TABLES: COMMENTS
  149. CREATE TABLE IF NOT EXISTS `bx_timeline_comments` (
  150. `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
  151. `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
  152. `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
  153. `cmt_object_id` int(11) NOT NULL DEFAULT '0',
  154. `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
  155. `cmt_level` int(11) NOT NULL DEFAULT '0',
  156. `cmt_text` text NOT NULL,
  157. `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
  158. `cmt_replies` int(11) NOT NULL DEFAULT '0',
  159. PRIMARY KEY (`cmt_id`),
  160. KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
  161. FULLTEXT KEY `search_fields` (`cmt_text`)
  162. );
  163. -- TABLE: views
  164. CREATE TABLE IF NOT EXISTS `bx_timeline_views_track` (
  165. `object_id` int(11) NOT NULL default '0',
  166. `viewer_id` int(11) NOT NULL default '0',
  167. `viewer_nip` int(11) unsigned NOT NULL default '0',
  168. `date` int(11) NOT NULL default '0',
  169. KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
  170. );
  171. -- TABLES: VOTES
  172. CREATE TABLE IF NOT EXISTS `bx_timeline_votes` (
  173. `object_id` int(11) NOT NULL default '0',
  174. `count` int(11) NOT NULL default '0',
  175. `sum` int(11) NOT NULL default '0',
  176. UNIQUE KEY `object_id` (`object_id`)
  177. );
  178. CREATE TABLE IF NOT EXISTS `bx_timeline_votes_track` (
  179. `id` int(11) NOT NULL AUTO_INCREMENT,
  180. `object_id` int(11) NOT NULL default '0',
  181. `author_id` int(11) NOT NULL default '0',
  182. `author_nip` int(11) unsigned NOT NULL default '0',
  183. `value` tinyint(4) NOT NULL default '0',
  184. `date` int(11) NOT NULL default '0',
  185. PRIMARY KEY (`id`),
  186. KEY `vote` (`object_id`, `author_nip`)
  187. );
  188. -- TABLE: metas
  189. CREATE TABLE IF NOT EXISTS `bx_timeline_meta_keywords` (
  190. `object_id` int(10) unsigned NOT NULL,
  191. `keyword` varchar(255) NOT NULL,
  192. KEY `object_id` (`object_id`),
  193. KEY `keyword` (`keyword`)
  194. );
  195. CREATE TABLE IF NOT EXISTS `bx_timeline_meta_locations` (
  196. `object_id` int(10) unsigned NOT NULL,
  197. `lat` double NOT NULL,
  198. `lng` double NOT NULL,
  199. `country` varchar(2) NOT NULL,
  200. `state` varchar(255) NOT NULL,
  201. `city` varchar(255) NOT NULL,
  202. `zip` varchar(255) NOT NULL,
  203. `street` varchar(255) NOT NULL,
  204. `street_number` varchar(255) NOT NULL,
  205. PRIMARY KEY (`object_id`),
  206. KEY `country_state_city` (`country`,`state`(8),`city`(8))
  207. );
  208. CREATE TABLE IF NOT EXISTS `bx_timeline_meta_mentions` (
  209. `object_id` int(10) unsigned NOT NULL,
  210. `profile_id` int(10) unsigned NOT NULL,
  211. KEY `object_id` (`object_id`),
  212. KEY `profile_id` (`profile_id`)
  213. );
  214. -- TABLE: reports
  215. CREATE TABLE IF NOT EXISTS `bx_timeline_reports` (
  216. `object_id` int(11) NOT NULL default '0',
  217. `count` int(11) NOT NULL default '0',
  218. UNIQUE KEY `object_id` (`object_id`)
  219. );
  220. CREATE TABLE IF NOT EXISTS `bx_timeline_reports_track` (
  221. `id` int(11) NOT NULL AUTO_INCREMENT,
  222. `object_id` int(11) NOT NULL default '0',
  223. `author_id` int(11) NOT NULL default '0',
  224. `author_nip` int(11) unsigned NOT NULL default '0',
  225. `type` varchar(32) NOT NULL default '',
  226. `text` text NOT NULL default '',
  227. `date` int(11) NOT NULL default '0',
  228. PRIMARY KEY (`id`),
  229. KEY `report` (`object_id`, `author_nip`)
  230. );
  231. -- STORAGES, TRANSCODERS, UPLOADERS
  232. INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
  233. ('bx_timeline_simple_photo', 1, 'BxTimelineUploaderSimplePhoto', 'modules/boonex/timeline/classes/BxTimelineUploaderSimplePhoto.php'),
  234. ('bx_timeline_simple_video', 1, 'BxTimelineUploaderSimpleVideo', 'modules/boonex/timeline/classes/BxTimelineUploaderSimpleVideo.php');
  235. 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
  236. ('bx_timeline_photos', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_photos', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  237. ('bx_timeline_photos_processed', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_photos_processed', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
  238. ('bx_timeline_videos', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_videos', 'allow-deny', 'avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,divx,xvid,3gp,webm,jpg', '', 0, 0, 0, 0, 0, 0),
  239. ('bx_timeline_videos_processed', @sStorageEngine, '', 360, 2592000, 3, 'bx_timeline_videos_processed', 'allow-deny', 'avi,flv,mpg,mpeg,wmv,mp4,m4v,mov,divx,xvid,3gp,webm,jpg', '', 0, 0, 0, 0, 0, 0);
  240. 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
  241. ('bx_timeline_photos_preview', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  242. ('bx_timeline_photos_view', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  243. ('bx_timeline_photos_big', 'bx_timeline_photos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_photos";}', 'no', '1', '2592000', '0', '', ''),
  244. ('bx_timeline_videos_poster', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  245. ('bx_timeline_videos_mp4', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', ''),
  246. ('bx_timeline_videos_webm', 'bx_timeline_videos_processed', 'Storage', 'a:1:{s:6:"object";s:18:"bx_timeline_videos";}', 'no', '0', '0', '0', 'BxDolTranscoderVideo', '');
  247. INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
  248. ('bx_timeline_photos_preview', 'Resize', 'a:3:{s:1:"w";s:3:"100";s:1:"h";s:3:"100";s:13:"square_resize";s:1:"1";}', '0'),
  249. ('bx_timeline_photos_view', 'Resize', 'a:3:{s:1:"w";s:3:"318";s:1:"h";s:3:"318";s:13:"square_resize";s:1:"1";}', '0'),
  250. ('bx_timeline_photos_big', 'Resize', 'a:2:{s:1:"w";s:4:"1280";s:1:"h";s:4:"1280";}', '0'),
  251. ('bx_timeline_videos_poster', 'Poster', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"jpg";}', 0),
  252. ('bx_timeline_videos_mp4', 'Mp4', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:3:"mp4";}', 0),
  253. ('bx_timeline_videos_webm', 'Webm', 'a:2:{s:1:"h";s:3:"318";s:10:"force_type";s:4:"webm";}', 0);
  254. -- Forms -> Post
  255. INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  256. ('bx_timeline_post', @sName, '_bx_timeline_form_post', '', '', 'do_submit', 'bx_timeline_events', 'id', '', '', '', 0, 1, 'BxTimelineFormPost', 'modules/boonex/timeline/classes/BxTimelineFormPost.php');
  257. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  258. ('bx_timeline_post_add', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add', 0),
  259. ('bx_timeline_post_add_public', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_add_public', 0),
  260. ('bx_timeline_post_edit', @sName, 'bx_timeline_post', '_bx_timeline_form_post_display_edit', 0);
  261. 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
  262. ('bx_timeline_post', @sName, 'type', 'post', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_type', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
  263. ('bx_timeline_post', @sName, 'action', '', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_action', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
  264. ('bx_timeline_post', @sName, 'owner_id', '0', '', 0, 'hidden', '_bx_timeline_form_post_input_sys_owner_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
  265. ('bx_timeline_post', @sName, 'text', '', '', 0, 'textarea', '_bx_timeline_form_post_input_sys_text', '_bx_timeline_form_post_input_text', '', 0, 0, 3, 'a:1:{s:12:"autocomplete";s:3:"off";}', '', '', '', '', '', 'XssHtml', '', 1, 0),
  266. ('bx_timeline_post', @sName, 'object_privacy_view', '', '', 0, 'custom', '_bx_timeline_form_post_input_sys_object_privacy_view', '_bx_timeline_form_post_input_object_privacy_view', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  267. ('bx_timeline_post', @sName, 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  268. ('bx_timeline_post', @sName, 'link', '', '', 0, 'custom', '_bx_timeline_form_post_input_sys_link', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  269. ('bx_timeline_post', @sName, 'photo', 'a:1:{i:0;s:24:"bx_timeline_simple_photo";}', 'a:1:{s:24:"bx_timeline_simple_photo";s:26:"_sys_uploader_simple_title";}', 0, 'files', '_bx_timeline_form_post_input_sys_photo', '_bx_timeline_form_post_input_photo', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  270. ('bx_timeline_post', @sName, 'video', 'a:1:{i:0;s:24:"bx_timeline_simple_video";}', 'a:1:{s:24:"bx_timeline_simple_video";s:26:"_sys_uploader_simple_title";}', 0, 'files', '_bx_timeline_form_post_input_sys_video', '_bx_timeline_form_post_input_video', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  271. ('bx_timeline_post', @sName, 'attachments', '', '', 0, 'custom', '_bx_timeline_form_post_input_sys_attachments', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
  272. ('bx_timeline_post', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  273. ('bx_timeline_post', @sName, 'do_submit', '_bx_timeline_form_post_input_do_submit', '', 0, 'submit', '_bx_timeline_form_post_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  274. ('bx_timeline_post', @sName, 'do_cancel', '_bx_timeline_form_post_input_do_cancel', '', 0, 'button', '_bx_timeline_form_post_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:51:"{js_object_view}.editPostCancel(this, {content_id})";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
  275. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  276. ('bx_timeline_post_add', 'type', 2147483647, 1, 1),
  277. ('bx_timeline_post_add', 'action', 2147483647, 1, 2),
  278. ('bx_timeline_post_add', 'owner_id', 2147483647, 1, 3),
  279. ('bx_timeline_post_add', 'text', 2147483647, 1, 4),
  280. ('bx_timeline_post_add', 'object_privacy_view', 2147483647, 1, 5),
  281. ('bx_timeline_post_add', 'location', 2147483647, 1, 6),
  282. ('bx_timeline_post_add', 'link', 2147483647, 1, 7),
  283. ('bx_timeline_post_add', 'photo', 2147483647, 1, 8),
  284. ('bx_timeline_post_add', 'video', 2147483647, 1, 9),
  285. ('bx_timeline_post_add', 'attachments', 2147483647, 1, 10),
  286. ('bx_timeline_post_add', 'do_submit', 2147483647, 1, 11),
  287. ('bx_timeline_post_add_public', 'type', 2147483647, 1, 1),
  288. ('bx_timeline_post_add_public', 'action', 2147483647, 1, 2),
  289. ('bx_timeline_post_add_public', 'owner_id', 2147483647, 1, 3),
  290. ('bx_timeline_post_add_public', 'text', 2147483647, 1, 4),
  291. ('bx_timeline_post_add_public', 'object_privacy_view', 2147483647, 1, 5),
  292. ('bx_timeline_post_add_public', 'location', 2147483647, 1, 6),
  293. ('bx_timeline_post_add_public', 'link', 2147483647, 1, 7),
  294. ('bx_timeline_post_add_public', 'photo', 2147483647, 1, 8),
  295. ('bx_timeline_post_add_public', 'video', 2147483647, 1, 9),
  296. ('bx_timeline_post_add_public', 'attachments', 2147483647, 1, 10),
  297. ('bx_timeline_post_add_public', 'do_submit', 2147483647, 1, 11),
  298. ('bx_timeline_post_edit', 'type', 2147483647, 1, 1),
  299. ('bx_timeline_post_edit', 'action', 2147483647, 1, 2),
  300. ('bx_timeline_post_edit', 'owner_id', 2147483647, 1, 3),
  301. ('bx_timeline_post_edit', 'text', 2147483647, 1, 4),
  302. ('bx_timeline_post_edit', 'object_privacy_view', 2147483647, 1, 5),
  303. ('bx_timeline_post_edit', 'location', 2147483647, 1, 6),
  304. ('bx_timeline_post_edit', 'controls', 2147483647, 1, 7),
  305. ('bx_timeline_post_edit', 'do_submit', 2147483647, 1, 8),
  306. ('bx_timeline_post_edit', 'do_cancel', 2147483647, 1, 9);
  307. -- Forms -> Attach link
  308. INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  309. ('bx_timeline_attach_link', @sName, '_bx_timeline_form_attach_link', '', '', 'do_submit', 'bx_timeline_links', 'id', '', '', '', 0, 1, '', '');
  310. INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
  311. ('bx_timeline_attach_link_add', @sName, 'bx_timeline_attach_link', '_bx_timeline_form_attach_link_display_add', 0);
  312. 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
  313. ('bx_timeline_attach_link', @sName, 'url', '', '', 0, 'text', '_bx_timeline_form_attach_link_input_sys_url', '_bx_timeline_form_attach_link_input_url', '', 0, 0, 0, '', '', '', 'Preg', 'a:1:{s:4:"preg";s:0:"";}', '_bx_timeline_form_attach_link_input_url_err', '', '', 0, 0),
  314. ('bx_timeline_attach_link', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  315. ('bx_timeline_attach_link', @sName, 'do_submit', '_bx_timeline_form_attach_link_input_do_submit', '', 0, 'submit', '_bx_timeline_form_attach_link_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
  316. ('bx_timeline_attach_link', @sName, 'do_cancel', '_bx_timeline_form_attach_link_input_do_cancel', '', 0, 'button', '_bx_timeline_form_attach_link_input_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";}', '', '', '', '', '', '', '', 0, 0);
  317. INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
  318. ('bx_timeline_attach_link_add', 'url', 2147483647, 1, 1),
  319. ('bx_timeline_attach_link_add', 'controls', 2147483647, 1, 2),
  320. ('bx_timeline_attach_link_add', 'do_submit', 2147483647, 1, 3),
  321. ('bx_timeline_attach_link_add', 'do_cancel', 2147483647, 1, 4);
  322. -- STUDIO PAGE & WIDGET
  323. INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
  324. (3, 'bx_timeline', '_bx_timeline', '_bx_timeline', 'bx_timeline@modules/boonex/timeline/|std-icon.svg');
  325. SET @iPageId = LAST_INSERT_ID();
  326. SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
  327. SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
  328. INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
  329. (@iPageId, 'bx_timeline', '{url_studio}module.php?name=bx_timeline', '', 'bx_timeline@modules/boonex/timeline/|std-icon.svg', '_bx_timeline', '', '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";}');
  330. INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
  331. (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));