enable.sql 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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_stories', '_bx_stories', 'bx_stories@modules/boonex/stories/|std-icon.svg', 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_stories', '_bx_stories', 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_stories_enable_auto_approve', 'on', @iCategId, '_bx_stories_option_enable_auto_approve', 'checkbox', '', '', '', 0),
  11. ('bx_stories_summary_chars', '700', @iCategId, '_bx_stories_option_summary_chars', 'digit', '', '', '', 10),
  12. ('bx_stories_plain_summary_chars', '200', @iCategId, '_bx_stories_option_plain_summary_chars', 'digit', '', '', '', 12),
  13. ('bx_stories_card_media_num', '10', @iCategId, '_bx_stories_option_card_media_num', 'digit', '', '', '', 16),
  14. ('bx_stories_per_page_browse', '12', @iCategId, '_bx_stories_option_per_page_browse', 'digit', '', '', '', 20),
  15. ('bx_stories_per_page_profile', '6', @iCategId, '_bx_stories_option_per_page_profile', 'digit', '', '', '', 22),
  16. ('bx_stories_rss_num', '10', @iCategId, '_bx_stories_option_rss_num', 'digit', '', '', '', 30),
  17. ('bx_stories_searchable_fields', '', @iCategId, '_bx_stories_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:21:"get_searchable_fields";}', 40),
  18. ('bx_stories_expiration_period', '48', @iCategId, '_bx_stories_option_expiration_period', 'digit', '', '', '', 50),
  19. ('bx_stories_duration', '3', @iCategId, '_bx_stories_option_duration', 'digit', '', '', '', 52);
  20. -- PAGE: create entry
  21. 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
  22. ('bx_stories_create_entry', '_bx_stories_page_title_sys_create_entry', '_bx_stories_page_title_create_entry', 'bx_stories', 5, 2147483647, 1, 'create-story', 'page.php?i=create-story', '', '', '', 0, 1, 0, 'BxStoriesPageBrowse', 'modules/boonex/stories/classes/BxStoriesPageBrowse.php');
  23. INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  24. ('bx_stories_create_entry', 1, 'bx_stories', '_bx_stories_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
  25. -- PAGE: add images
  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_stories_add_media', '_bx_stories_page_title_sys_add_media', '_bx_stories_page_title_add_media', 'bx_stories', 5, 2147483647, 1, 'story-add-media', '', '', '', '', 0, 1, 0, 'BxStoriesPageEntry', 'modules/boonex/stories/classes/BxStoriesPageEntry.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_stories_add_media', 1, 'bx_stories', '_bx_stories_page_block_title_add_media', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:16:"entity_add_files";}', 0, 0, 0);
  30. -- PAGE: edit entry
  31. 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
  32. ('bx_stories_edit_entry', '_bx_stories_page_title_sys_edit_entry', '_bx_stories_page_title_edit_entry', 'bx_stories', 5, 2147483647, 1, 'edit-story', '', '', '', '', 0, 1, 0, 'BxStoriesPageEntry', 'modules/boonex/stories/classes/BxStoriesPageEntry.php');
  33. INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  34. ('bx_stories_edit_entry', 1, 'bx_stories', '_bx_stories_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
  35. -- PAGE: delete entry
  36. 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
  37. ('bx_stories_delete_entry', '_bx_stories_page_title_sys_delete_entry', '_bx_stories_page_title_delete_entry', 'bx_stories', 5, 2147483647, 1, 'delete-story', '', '', '', '', 0, 1, 0, 'BxStoriesPageEntry', 'modules/boonex/stories/classes/BxStoriesPageEntry.php');
  38. INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  39. ('bx_stories_delete_entry', 1, 'bx_stories', '_bx_stories_page_block_title_delete_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:13:"entity_delete";}', 0, 0, 0);
  40. -- PAGE: view entry
  41. 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
  42. ('bx_stories_view_entry', '_bx_stories_page_title_sys_view_entry', '_bx_stories_page_title_view_entry', 'bx_stories', 12, 2147483647, 1, 'view-story', '', '', '', '', 0, 1, 0, 'BxStoriesPageEntry', 'modules/boonex/stories/classes/BxStoriesPageEntry.php');
  43. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
  44. ('bx_stories_view_entry', 2, 'bx_stories','' , '_bx_stories_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:17:"entity_text_block";}', 0, 0, 1, 1),
  45. ('bx_stories_view_entry', 2, 'bx_stories','' , '_bx_stories_page_block_title_entry_attachments', 0, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:18:"entity_attachments";}', 0, 0, 1, 3),
  46. ('bx_stories_view_entry', 4, 'bx_stories','' , '_bx_stories_page_block_title_entry_social_sharing', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:21:"entity_social_sharing";}', 0, 0, 0, 0),
  47. ('bx_stories_view_entry', 2, 'bx_stories','' , '_bx_stories_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:15:"entity_comments";}', 0, 0, 1, 4),
  48. ('bx_stories_view_entry', 3, 'bx_stories','' , '_bx_stories_page_block_title_entry_location', 3, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:13:"locations_map";s:6:"params";a:2:{i:0;s:10:"bx_stories";i:1;s:4:"{id}";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 0, 1, 4),
  49. ('bx_stories_view_entry', 3, 'bx_stories','' , '_bx_stories_page_block_title_entry_author', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:13:"entity_author";}', 0, 0, 1, 2),
  50. ('bx_stories_view_entry', 3, 'bx_stories', '_bx_stories_page_block_title_sys_entry_context', '_bx_stories_page_block_title_entry_context', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:14:"entity_context";}', 0, 0, 1, 1),
  51. ('bx_stories_view_entry', 3, 'bx_stories','' , '_bx_stories_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:11:"entity_info";}', 0, 0, 1, 3),
  52. ('bx_stories_view_entry', 3, 'bx_stories', '', '_bx_stories_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:14:"entity_actions";}', 0, 0, 0, 0),
  53. ('bx_stories_view_entry', 2, 'bx_stories','' , '_bx_stories_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:18:"entity_all_actions";}', 0, 0, 1, 2),
  54. ('bx_stories_view_entry', 2, 'bx_stories', '', '_bx_stories_page_block_title_entry_reports', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:14:"entity_reports";}', 0, 0, 1, 6);
  55. -- PAGE: view entry comments
  56. 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
  57. ('bx_stories_view_entry_comments', '_bx_stories_page_title_sys_view_entry_comments', '_bx_stories_page_title_view_entry_comments', 'bx_stories', 5, 2147483647, 1, 'view-story-comments', '', '', '', '', 0, 1, 0, 'BxStoriesPageEntry', 'modules/boonex/stories/classes/BxStoriesPageEntry.php');
  58. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  59. ('bx_stories_view_entry_comments', 1, 'bx_stories', '_bx_stories_page_block_title_entry_comments', '_bx_stories_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:15:"entity_comments";}', 0, 0, 1);
  60. -- PAGE: popular stories
  61. 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
  62. ('bx_stories_popular', '_bx_stories_page_title_sys_entries_popular', '_bx_stories_page_title_entries_popular', 'bx_stories', 5, 2147483647, 1, 'stories-popular', 'page.php?i=stories-popular', '', '', '', 0, 1, 0, 'BxStoriesPageBrowse', 'modules/boonex/stories/classes/BxStoriesPageBrowse.php');
  63. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  64. ('bx_stories_popular', 1, 'bx_stories', '_bx_stories_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_stories";s:6:"method";s:14:"browse_popular";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
  65. -- PAGE: top stories
  66. 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
  67. ('bx_stories_top', '_bx_stories_page_title_sys_entries_top', '_bx_stories_page_title_entries_top', 'bx_stories', 5, 2147483647, 1, 'stories-top', 'page.php?i=stories-top', '', '', '', 0, 1, 0, 'BxStoriesPageBrowse', 'modules/boonex/stories/classes/BxStoriesPageBrowse.php');
  68. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  69. ('bx_stories_top', 1, 'bx_stories', '_bx_stories_page_block_title_top_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_stories";s:6:"method";s:10:"browse_top";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
  70. -- PAGE: entries of author
  71. 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
  72. ('bx_stories_author', 'stories-author', '_bx_stories_page_title_sys_entries_of_author', '_bx_stories_page_title_entries_of_author', 'bx_stories', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxStoriesPageAuthor', 'modules/boonex/stories/classes/BxStoriesPageAuthor.php');
  73. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
  74. ('bx_stories_author', 1, 'bx_stories', '', '_bx_stories_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:18:"my_entries_actions";}', 0, 0, 1, 1),
  75. ('bx_stories_author', 1, 'bx_stories', '_bx_stories_page_block_title_sys_entries_of_author', '_bx_stories_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:13:"browse_author";}', 0, 0, 1, 2),
  76. ('bx_stories_author', 1, 'bx_stories', '_bx_stories_page_block_title_sys_entries_in_context', '_bx_stories_page_block_title_entries_in_context', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_stories";s:6:"method";s:14:"browse_context";s:6:"params";a:2:{s:10:"profile_id";s:12:"{profile_id}";i:0;a:1:{s:13:"empty_message";b:0;}}}', 0, 0, 1, 3);
  77. -- PAGE: entries in context
  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_stories_context', 'stories-context', '_bx_stories_page_title_sys_entries_in_context', '_bx_stories_page_title_entries_in_context', 'bx_stories', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxStoriesPageAuthor', 'modules/boonex/stories/classes/BxStoriesPageAuthor.php');
  80. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
  81. ('bx_stories_context', 1, 'bx_stories', '_bx_stories_page_block_title_sys_entries_in_context', '_bx_stories_page_block_title_entries_in_context', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:14:"browse_context";}', 0, 0, 1, 1);
  82. -- PAGE: module home
  83. 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
  84. ('bx_stories_home', 'stories-home', '_bx_stories_page_title_sys_home', '_bx_stories_page_title_home', 'bx_stories', 5, 2147483647, 1, 'page.php?i=stories-home', '', '', '', 0, 1, 0, 'BxStoriesPageBrowse', 'modules/boonex/stories/classes/BxStoriesPageBrowse.php');
  85. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
  86. ('bx_stories_home', 0, 'bx_stories', '', '_bx_stories_page_block_title_popular_keywords_stories', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"keywords_cloud";s:6:"params";a:3:{i:0;s:10:"bx_stories";i:1;s:10:"bx_stories";i:2;a:1:{s:10:"show_empty";b:1;}}s:5:"class";s:20:"TemplServiceMetatags";}', 1, 0, 1, 0),
  87. ('bx_stories_home', 1, 'bx_stories', '_bx_stories_page_block_title_sys_recent_entries_view_gallery', '_bx_stories_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_stories";s:6:"method";s:13:"browse_public";s:6:"params";a:2:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;}}', 0, 1, 1, 1);
  88. -- PAGE: search for entries
  89. 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
  90. ('bx_stories_search', '_bx_stories_page_title_sys_entries_search', '_bx_stories_page_title_entries_search', 'bx_stories', 1, 2147483647, 1, 'stories-search', 'page.php?i=stories-search', '', '', '', 0, 1, 0, 'BxStoriesPageBrowse', 'modules/boonex/stories/classes/BxStoriesPageBrowse.php');
  91. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
  92. ('bx_stories_search', 0, 'bx_stories', '_bx_stories_page_block_title_search_form_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:15:"bx_stories_cmts";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 0),
  93. ('bx_stories_search', 0, 'bx_stories', '_bx_stories_page_block_title_search_results_cmts', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:15:"bx_stories_cmts";s:10:"show_empty";b:0;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 0, 0),
  94. ('bx_stories_search', 1, 'bx_stories', '_bx_stories_page_block_title_search_form', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:8:"get_form";s:6:"params";a:1:{i:0;a:1:{s:6:"object";s:10:"bx_stories";}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1),
  95. ('bx_stories_search', 2, 'bx_stories', '_bx_stories_page_block_title_search_results', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_results";s:6:"params";a:1:{i:0;a:2:{s:6:"object";s:10:"bx_stories";s:10:"show_empty";b:1;}}s:5:"class";s:27:"TemplSearchExtendedServices";}', 0, 1, 1, 1);
  96. -- PAGE: module manage own
  97. 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
  98. ('bx_stories_manage', '_bx_stories_page_title_sys_manage', '_bx_stories_page_title_manage', 'bx_stories', 5, 2147483647, 1, 'stories-manage', 'page.php?i=stories-manage', '', '', '', 0, 1, 0, 'BxStoriesPageBrowse', 'modules/boonex/stories/classes/BxStoriesPageBrowse.php');
  99. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  100. ('bx_stories_manage', 1, 'bx_stories', '_bx_stories_page_block_title_system_manage', '_bx_stories_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:12:"manage_tools";}}', 0, 1, 0);
  101. -- PAGE: module manage all
  102. 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
  103. ('bx_stories_administration', '_bx_stories_page_title_sys_manage_administration', '_bx_stories_page_title_manage', 'bx_stories', 5, 192, 1, 'stories-administration', 'page.php?i=stories-administration', '', '', '', 0, 1, 0, 'BxStoriesPageBrowse', 'modules/boonex/stories/classes/BxStoriesPageBrowse.php');
  104. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  105. ('bx_stories_administration', 1, 'bx_stories', '_bx_stories_page_block_title_system_manage_administration', '_bx_stories_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:"module";s:10:"bx_stories";s:6:"method";s:12:"manage_tools";s:6:"params";a:1:{i:0;s:14:"administration";}}', 0, 1, 0);
  106. -- PAGE: add block to homepage
  107. SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
  108. INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
  109. ('sys_home', 1, 'bx_stories', '_bx_stories_page_block_title_sys_recent_entries_view_showcase', '_bx_stories_page_block_title_recent_entries', 13, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_stories";s:6:"method";s:13:"browse_public";s:6:"params";a:3:{s:9:"unit_view";s:8:"showcase";s:13:"empty_message";b:0;s:13:"ajax_paginate";b:0;}}', 1, 0, 1, IFNULL(@iBlockOrder, 0) + 1);
  110. -- TODO: Block should check Expiration.
  111. -- PAGES: add page block to profiles modules (trigger* page objects are processed separately upon modules enable/disable)
  112. SET @iPBCellProfile = 3;
  113. INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
  114. ('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_stories', '_bx_stories_page_block_title_sys_my_entries', '_bx_stories_page_block_title_my_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_stories";s:6:"method";s:13:"browse_author";s:6:"params";a:2:{i:0;s:12:"{profile_id}";i:1;a:2:{s:8:"per_page";s:27:"bx_stories_per_page_profile";s:13:"empty_message";b:0;}}}', 0, 0, 0);
  115. -- PAGE: service blocks
  116. SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = '' AND `cell_id` = 0 ORDER BY `order` DESC LIMIT 1);
  117. INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
  118. ('', 0, 'bx_stories', '', '_bx_stories_page_block_title_popular_keywords_stories', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"keywords_cloud";s:6:"params";a:2:{i:0;s:10:"bx_stories";i:1;s:10:"bx_stories";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 1, 1, @iBlockOrder + 1),
  119. ('', 0, 'bx_stories', '', '_bx_stories_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_stories";s:6:"method";s:13:"browse_public";s:6:"params";a:3:{s:9:"unit_view";s:8:"extended";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1, @iBlockOrder + 2),
  120. ('', 0, 'bx_stories', '', '_bx_stories_page_block_title_updated_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_stories";s:6:"method";s:14:"browse_updated";s:6:"params";a:3:{s:9:"unit_view";s:8:"extended";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1, @iBlockOrder + 3);
  121. -- MENU: add to site menu
  122. SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 AND `order` < 9999 ORDER BY `order` DESC LIMIT 1);
  123. 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
  124. ('sys_site', 'bx_stories', 'stories-home', '_bx_stories_menu_item_title_system_entries_home', '_bx_stories_menu_item_title_entries_home', 'page.php?i=stories-home', '', '', 'far image col-blue1', 'bx_stories_submenu', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
  125. -- MENU: add to homepage menu
  126. SET @iHomepageMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_homepage' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
  127. 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
  128. ('sys_homepage', 'bx_stories', 'stories-home', '_bx_stories_menu_item_title_system_entries_home', '_bx_stories_menu_item_title_entries_home', 'page.php?i=stories-home', '', '', 'far image col-blue1', 'bx_stories_submenu', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);
  129. -- MENU: add to "add content" menu
  130. SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' 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. ('sys_add_content_links', 'bx_stories', 'create-story', '_bx_stories_menu_item_title_system_create_entry', '_bx_stories_menu_item_title_create_entry', 'page.php?i=create-story', '', '', 'far image col-blue1', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
  133. -- MENU: actions menu for view entry
  134. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  135. ('bx_stories_view', '_bx_stories_menu_title_view_entry', 'bx_stories_view', 'bx_stories', 9, 0, 1, 'BxStoriesMenuView', 'modules/boonex/stories/classes/BxStoriesMenuView.php');
  136. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  137. ('bx_stories_view', 'bx_stories', '_bx_stories_menu_set_title_view_entry', 0);
  138. 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
  139. ('bx_stories_view', 'bx_stories', 'add-media-to-story', '_bx_stories_menu_item_title_system_add_media', '_bx_stories_menu_item_title_add_media', 'page.php?i=story-add-media&id={content_id}', '', '', 'plus', '', 2147483647, 1, 0, 10),
  140. ('bx_stories_view', 'bx_stories', 'edit-story', '_bx_stories_menu_item_title_system_edit_entry', '_bx_stories_menu_item_title_edit_entry', 'page.php?i=edit-story&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 20),
  141. ('bx_stories_view', 'bx_stories', 'delete-story', '_bx_stories_menu_item_title_system_delete_entry', '_bx_stories_menu_item_title_delete_entry', 'page.php?i=delete-story&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 30),
  142. ('bx_stories_view', 'bx_stories', 'approve', '_sys_menu_item_title_system_va_approve', '_sys_menu_item_title_va_approve', 'javascript:void(0)', 'javascript:bx_approve(this, ''{module_uri}'', {content_id});', '', 'check', '', 2147483647, 1, 0, 40);
  143. -- MENU: all actions menu for view entry
  144. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  145. ('bx_stories_view_actions', '_sys_menu_title_view_actions', 'bx_stories_view_actions', 'bx_stories', 15, 0, 1, 'BxStoriesMenuViewActions', 'modules/boonex/stories/classes/BxStoriesMenuViewActions.php');
  146. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  147. ('bx_stories_view_actions', 'bx_stories', '_sys_menu_set_title_view_actions', 0);
  148. INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
  149. ('bx_stories_view_actions', 'bx_stories', 'edit-story', '_bx_stories_menu_item_title_system_edit_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 10),
  150. ('bx_stories_view_actions', 'bx_stories', 'delete-story', '_bx_stories_menu_item_title_system_delete_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 20),
  151. ('bx_stories_view_actions', 'bx_stories', 'approve', '_sys_menu_item_title_system_va_approve', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 30),
  152. ('bx_stories_view_actions', 'bx_stories', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 200),
  153. ('bx_stories_view_actions', 'bx_stories', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 210),
  154. ('bx_stories_view_actions', 'bx_stories', 'vote', '_sys_menu_item_title_system_va_vote', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 220),
  155. ('bx_stories_view_actions', 'bx_stories', 'reaction', '_sys_menu_item_title_system_va_reaction', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 225),
  156. ('bx_stories_view_actions', 'bx_stories', 'score', '_sys_menu_item_title_system_va_score', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 230),
  157. ('bx_stories_view_actions', 'bx_stories', 'favorite', '_sys_menu_item_title_system_va_favorite', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 240),
  158. ('bx_stories_view_actions', 'bx_stories', 'feature', '_sys_menu_item_title_system_va_feature', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 250),
  159. ('bx_stories_view_actions', 'bx_stories', 'repost', '_sys_menu_item_title_system_va_repost', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 260),
  160. ('bx_stories_view_actions', 'bx_stories', 'report', '_sys_menu_item_title_system_va_report', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 270),
  161. ('bx_stories_view_actions', 'bx_stories', 'notes', '_sys_menu_item_title_system_va_notes', '_sys_menu_item_title_va_notes', 'javascript:void(0)', 'javascript:bx_get_notes(this, ''{module_uri}'', {content_id});', '', 'exclamation-triangle', '', '', 0, 2147483647, 1, 0, 280),
  162. ('bx_stories_view_actions', 'bx_stories', 'audit', '_sys_menu_item_title_system_va_audit', '_sys_menu_item_title_va_audit', 'page.php?i=dashboard-audit&module=bx_stories&content_id={content_id}', '', '', 'history', '', '', 0, 192, 1, 0, 290),
  163. ('bx_stories_view_actions', 'bx_stories', 'social-sharing', '_sys_menu_item_title_system_social_sharing', '_sys_menu_item_title_social_sharing', 'javascript:void(0)', 'oBxDolPage.share(this, \'{url_encoded}\')', '', 'share', '', '', 0, 2147483647, 1, 0, 300),
  164. ('bx_stories_view_actions', 'bx_stories', 'more-auto', '_sys_menu_item_title_system_va_more_auto', '_sys_menu_item_title_va_more_auto', 'javascript:void(0)', '', '', 'ellipsis-v', '', '', 0, 2147483647, 1, 0, 9999);
  165. -- MENU: actions menu for view media
  166. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  167. ('bx_stories_view_actions_media', '_bx_stories_menu_title_view_actions_media', 'bx_stories_view_actions_media', 'bx_stories', 9, 0, 1, 'BxStoriesMenuView', 'modules/boonex/stories/classes/BxStoriesMenuView.php');
  168. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  169. ('bx_stories_view_actions_media', 'bx_stories', '_bx_stories_menu_set_title_view_actions_media', 0);
  170. 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
  171. ('bx_stories_view_actions_media', 'bx_stories', 'edit-media', '_bx_stories_menu_item_title_system_edit_image', '_bx_stories_menu_item_title_edit_image', 'javascript:void(0)', 'javascript:{js_object}.editMedia(this, {id});', '', 'pencil-alt', '', 2147483647, 1, 0, 10),
  172. ('bx_stories_view_actions_media', 'bx_stories', 'delete-media', '_bx_stories_menu_item_title_system_delete_image', '_bx_stories_menu_item_title_delete_image', 'javascript:void(0)', 'javascript:{js_object}.deleteMedia(this, {id});', '', 'remove', '', 2147483647, 1, 0, 20);
  173. -- MENU: actions menu for my entries
  174. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  175. ('bx_stories_my', '_bx_stories_menu_title_entries_my', 'bx_stories_my', 'bx_stories', 9, 0, 1, 'BxStoriesMenu', 'modules/boonex/stories/classes/BxStoriesMenu.php');
  176. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  177. ('bx_stories_my', 'bx_stories', '_bx_stories_menu_set_title_entries_my', 0);
  178. 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
  179. ('bx_stories_my', 'bx_stories', 'create-story', '_bx_stories_menu_item_title_system_create_entry', '_bx_stories_menu_item_title_create_entry', 'page.php?i=create-story', '', '', 'plus', '', 2147483647, 1, 0, 0);
  180. -- MENU: module sub-menu
  181. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  182. ('bx_stories_submenu', '_bx_stories_menu_title_submenu', 'bx_stories_submenu', 'bx_stories', 8, 0, 1, '', '');
  183. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  184. ('bx_stories_submenu', 'bx_stories', '_bx_stories_menu_set_title_submenu', 0);
  185. 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
  186. ('bx_stories_submenu', 'bx_stories', 'stories-home', '_bx_stories_menu_item_title_system_entries_recent', '_bx_stories_menu_item_title_entries_recent', 'page.php?i=stories-home', '', '', '', '', 2147483647, 1, 1, 1),
  187. ('bx_stories_submenu', 'bx_stories', 'stories-popular', '_bx_stories_menu_item_title_system_entries_popular', '_bx_stories_menu_item_title_entries_popular', 'page.php?i=stories-popular', '', '', '', '', 2147483647, 1, 1, 2),
  188. ('bx_stories_submenu', 'bx_stories', 'stories-top', '_bx_stories_menu_item_title_system_entries_top', '_bx_stories_menu_item_title_entries_top', 'page.php?i=stories-top', '', '', '', '', 2147483647, 1, 1, 3),
  189. ('bx_stories_submenu', 'bx_stories', 'stories-search', '_bx_stories_menu_item_title_system_entries_search', '_bx_stories_menu_item_title_entries_search', 'page.php?i=stories-search', '', '', '', '', 2147483647, 1, 1, 4),
  190. ('bx_stories_submenu', 'bx_stories', 'stories-manage', '_bx_stories_menu_item_title_system_entries_manage', '_bx_stories_menu_item_title_entries_manage', 'page.php?i=stories-manage', '', '', '', '', 2147483646, 1, 1, 5);
  191. -- MENU: sub-menu for view entry
  192. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  193. ('bx_stories_view_submenu', '_bx_stories_menu_title_view_entry_submenu', 'bx_stories_view_submenu', 'bx_stories', 8, 0, 1, 'BxStoriesMenuView', 'modules/boonex/stories/classes/BxStoriesMenuView.php');
  194. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  195. ('bx_stories_view_submenu', 'bx_stories', '_bx_stories_menu_set_title_view_entry_submenu', 0);
  196. 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
  197. ('bx_stories_view_submenu', 'bx_stories', 'view-story', '_bx_stories_menu_item_title_system_view_entry', '_bx_stories_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-story&id={content_id}', '', '', '', '', 2147483647, 1, 0, 1),
  198. ('bx_stories_view_submenu', 'bx_stories', 'view-story-comments', '_bx_stories_menu_item_title_system_view_entry_comments', '_bx_stories_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-story-comments&id={content_id}', '', '', '', '', 2147483647, 1, 0, 2);
  199. -- MENU: custom menu for snippet meta info
  200. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  201. ('bx_stories_snippet_meta', '_sys_menu_title_snippet_meta', 'bx_stories_snippet_meta', 'bx_stories', 15, 0, 1, 'BxStoriesMenuSnippetMeta', 'modules/boonex/stories/classes/BxStoriesMenuSnippetMeta.php');
  202. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  203. ('bx_stories_snippet_meta', 'bx_stories', '_sys_menu_set_title_snippet_meta', 0);
  204. INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES
  205. ('bx_stories_snippet_meta', 'bx_stories', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 1, 0, 1, 1),
  206. ('bx_stories_snippet_meta', 'bx_stories', 'author', '_sys_menu_item_title_system_sm_author', '_sys_menu_item_title_sm_author', '', '', '', '', '', 2147483647, 1, 0, 1, 2),
  207. ('bx_stories_snippet_meta', 'bx_stories', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, 0, 0, 1, 3),
  208. ('bx_stories_snippet_meta', 'bx_stories', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, 0, 0, 1, 4),
  209. ('bx_stories_snippet_meta', 'bx_stories', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, 0, 0, 1, 5),
  210. ('bx_stories_snippet_meta', 'bx_stories', 'items', '_bx_stories_menu_item_title_system_sm_items', '_bx_stories_menu_item_title_sm_items', '', '', '', '', '', 2147483647, 0, 0, 1, 6);
  211. -- MENU: profile stats
  212. SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
  213. INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
  214. ('sys_profile_stats', 'bx_stories', 'profile-stats-my-stories', '_bx_stories_menu_item_title_system_manage_my_stories', '_bx_stories_menu_item_title_manage_my_stories', 'page.php?i=stories-author&profile_id={member_id}', '', '_self', 'far image col-blue1', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 1);
  215. -- MENU: manage tools submenu
  216. INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
  217. ('bx_stories_menu_manage_tools', '_bx_stories_menu_title_manage_tools', 'bx_stories_menu_manage_tools', 'bx_stories', 6, 0, 1, 'BxStoriesMenuManageTools', 'modules/boonex/stories/classes/BxStoriesMenuManageTools.php');
  218. INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
  219. ('bx_stories_menu_manage_tools', 'bx_stories', '_bx_stories_menu_set_title_manage_tools', 0);
  220. --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
  221. --('bx_stories_menu_manage_tools', 'bx_stories', 'delete-with-content', '_bx_stories_menu_item_title_system_delete_with_content', '_bx_stories_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'far trash-alt', '', 128, 1, 0, 0);
  222. -- MENU: dashboard manage tools
  223. SET @iManageMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' LIMIT 1);
  224. INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
  225. ('sys_account_dashboard_manage_tools', 'bx_stories', 'stories-administration', '_bx_stories_menu_item_title_system_admt_stories', '_bx_stories_menu_item_title_admt_stories', 'page.php?i=stories-administration', '', '_self', 'far image', 'a:2:{s:6:"module";s:10:"bx_stories";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
  226. -- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
  227. 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
  228. ('trigger_profile_view_submenu', 'bx_stories', 'stories-author', '_bx_stories_menu_item_title_system_view_entries_author', '_bx_stories_menu_item_title_view_entries_author', 'page.php?i=stories-author&profile_id={profile_id}', '', '', 'far image col-blue1', '', 2147483647, 1, 0, 0),
  229. ('trigger_group_view_submenu', 'bx_stories', 'stories-context', '_bx_stories_menu_item_title_system_view_entries_in_context', '_bx_stories_menu_item_title_view_entries_in_context', 'page.php?i=stories-context&profile_id={profile_id}', '', '', 'far image col-blue1', '', 2147483647, 1, 0, 0);
  230. -- PRIVACY
  231. 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
  232. ('bx_stories_allow_view_to', 'bx_stories', 'view', '_bx_stories_form_entry_input_allow_view_to', '3', 'bx_stories_entries', 'id', 'author', '', '');
  233. -- ACL
  234. INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
  235. ('bx_stories', 'create entry', NULL, '_bx_stories_acl_action_create_entry', '', 1, 3);
  236. SET @iIdActionEntryCreate = LAST_INSERT_ID();
  237. INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
  238. ('bx_stories', 'delete entry', NULL, '_bx_stories_acl_action_delete_entry', '', 1, 3);
  239. SET @iIdActionEntryDelete = LAST_INSERT_ID();
  240. INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
  241. ('bx_stories', 'view entry', NULL, '_bx_stories_acl_action_view_entry', '', 1, 0);
  242. SET @iIdActionEntryView = LAST_INSERT_ID();
  243. INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
  244. ('bx_stories', 'edit any entry', NULL, '_bx_stories_acl_action_edit_any_entry', '', 1, 3);
  245. SET @iIdActionEntryEditAny = LAST_INSERT_ID();
  246. INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
  247. ('bx_stories', 'delete any entry', NULL, '_bx_stories_acl_action_delete_any_entry', '', 1, 3);
  248. SET @iIdActionEntryDeleteAny = LAST_INSERT_ID();
  249. SET @iUnauthenticated = 1;
  250. SET @iAccount = 2;
  251. SET @iStandard = 3;
  252. SET @iUnconfirmed = 4;
  253. SET @iPending = 5;
  254. SET @iSuspended = 6;
  255. SET @iModerator = 7;
  256. SET @iAdministrator = 8;
  257. SET @iPremium = 9;
  258. INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
  259. -- entry create
  260. (@iStandard, @iIdActionEntryCreate),
  261. (@iModerator, @iIdActionEntryCreate),
  262. (@iAdministrator, @iIdActionEntryCreate),
  263. (@iPremium, @iIdActionEntryCreate),
  264. -- entry delete
  265. (@iStandard, @iIdActionEntryDelete),
  266. (@iModerator, @iIdActionEntryDelete),
  267. (@iAdministrator, @iIdActionEntryDelete),
  268. (@iPremium, @iIdActionEntryDelete),
  269. -- entry view
  270. (@iUnauthenticated, @iIdActionEntryView),
  271. (@iAccount, @iIdActionEntryView),
  272. (@iStandard, @iIdActionEntryView),
  273. (@iUnconfirmed, @iIdActionEntryView),
  274. (@iPending, @iIdActionEntryView),
  275. (@iModerator, @iIdActionEntryView),
  276. (@iAdministrator, @iIdActionEntryView),
  277. (@iPremium, @iIdActionEntryView),
  278. -- edit any entry
  279. (@iModerator, @iIdActionEntryEditAny),
  280. (@iAdministrator, @iIdActionEntryEditAny),
  281. -- delete any entry
  282. (@iAdministrator, @iIdActionEntryDeleteAny);
  283. -- SEARCH
  284. SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
  285. INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `GlobalSearch`, `ClassName`, `ClassPath`) VALUES
  286. ('bx_stories', '_bx_stories', @iSearchOrder + 1, 1, 'BxStoriesSearchResult', 'modules/boonex/stories/classes/BxStoriesSearchResult.php'),
  287. ('bx_stories_cmts', '_bx_stories_cmts', @iSearchOrder + 2, 1, 'BxStoriesCmtsSearchResult', 'modules/boonex/stories/classes/BxStoriesCmtsSearchResult.php'),
  288. ('bx_stories_media', '_bx_stories_media', @iSearchOrder + 3, 0, 'BxStoriesSearchResultMedia', 'modules/boonex/stories/classes/BxStoriesSearchResultMedia.php');
  289. -- METATAGS
  290. INSERT INTO `sys_objects_metatags` (`object`, `module`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
  291. ('bx_stories', 'bx_stories', 'bx_stories_meta_keywords', '', 'bx_stories_meta_mentions', '', '');
  292. -- STATS
  293. SET @iMaxOrderStats = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_statistics`);
  294. INSERT INTO `sys_statistics` (`module`, `name`, `title`, `link`, `icon`, `query`, `order`) VALUES
  295. ('bx_stories', 'bx_stories', '_bx_stories', 'page.php?i=stories-home', 'far image col-blue1', 'SELECT COUNT(*) FROM `bx_stories_entries` WHERE 1 AND `status` = ''active'' AND `status_admin` = ''active''', @iMaxOrderStats + 1);
  296. -- CHARTS
  297. SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
  298. INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `field_status`, `query`, `active`, `order`, `class_name`, `class_file`) VALUES
  299. ('bx_stories_growth', '_bx_stories_chart_growth', 'bx_stories_entries', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 1, 'BxDolChartGrowth', ''),
  300. ('bx_stories_growth_speed', '_bx_stories_chart_growth_speed', 'bx_stories_entries', 'added', '', 'status,status_admin', '', 1, @iMaxOrderCharts + 2, 'BxDolChartGrowthSpeed', '');
  301. -- GRIDS: moderation tools
  302. INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
  303. ('bx_stories_administration', 'Sql', 'SELECT * FROM `bx_stories_entries` WHERE 1 ', 'bx_stories_entries', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,text', '', 'like', 'reports', '', 192, 'BxStoriesGridAdministration', 'modules/boonex/stories/classes/BxStoriesGridAdministration.php'),
  304. ('bx_stories_common', 'Sql', 'SELECT * FROM `bx_stories_entries` WHERE 1 ', 'bx_stories_entries', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 2147483647, 'BxStoriesGridCommon', 'modules/boonex/stories/classes/BxStoriesGridCommon.php');
  305. INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
  306. ('bx_stories_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
  307. ('bx_stories_administration', 'switcher', '_bx_stories_grid_column_title_adm_active', '8%', 0, '', '', 2),
  308. ('bx_stories_administration', 'reports', '_sys_txt_reports_title', '5%', 0, '', '', 3),
  309. ('bx_stories_administration', 'title', '_bx_stories_grid_column_title_adm_title', '25%', 0, '', '', 4),
  310. ('bx_stories_administration', 'added', '_bx_stories_grid_column_title_adm_added', '20%', 1, '25', '', 5),
  311. ('bx_stories_administration', 'author', '_bx_stories_grid_column_title_adm_author', '20%', 0, '25', '', 6),
  312. ('bx_stories_administration', 'actions', '', '20%', 0, '', '', 7),
  313. ('bx_stories_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
  314. ('bx_stories_common', 'switcher', '', '8%', 0, '', '', 2),
  315. ('bx_stories_common', 'title', '_bx_stories_grid_column_title_adm_title', '40%', 0, '', '', 3),
  316. ('bx_stories_common', 'added', '_bx_stories_grid_column_title_adm_added', '15%', 1, '25', '', 4),
  317. ('bx_stories_common', 'status_admin', '_bx_stories_grid_column_title_adm_status_admin', '15%', 0, '16', '', 5),
  318. ('bx_stories_common', 'actions', '', '20%', 0, '', '', 6);
  319. INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
  320. ('bx_stories_administration', 'bulk', 'delete', '_bx_stories_grid_action_title_adm_delete', '', 0, 1, 1),
  321. ('bx_stories_administration', 'bulk', 'clear_reports', '_bx_stories_grid_action_title_adm_clear_reports', '', 0, 1, 2),
  322. ('bx_stories_administration', 'single', 'edit', '_bx_stories_grid_action_title_adm_edit', 'pencil-alt', 1, 0, 1),
  323. ('bx_stories_administration', 'single', 'delete', '_bx_stories_grid_action_title_adm_delete', 'remove', 1, 1, 2),
  324. ('bx_stories_administration', 'single', 'settings', '_bx_stories_grid_action_title_adm_more_actions', 'cog', 1, 0, 3),
  325. ('bx_stories_administration', 'single', 'audit_content', '_bx_stories_grid_action_title_adm_audit_content', 'search', 1, 0, 4),
  326. ('bx_stories_administration', 'single', 'clear_reports', '_bx_stories_grid_action_title_adm_clear_reports', 'eraser', 1, 0, 5),
  327. ('bx_stories_common', 'bulk', 'delete', '_bx_stories_grid_action_title_adm_delete', '', 0, 1, 1),
  328. ('bx_stories_common', 'single', 'edit', '_bx_stories_grid_action_title_adm_edit', 'pencil-alt', 1, 0, 1),
  329. ('bx_stories_common', 'single', 'delete', '_bx_stories_grid_action_title_adm_delete', 'remove', 1, 1, 2),
  330. ('bx_stories_common', 'single', 'settings', '_bx_stories_grid_action_title_adm_more_actions', 'cog', 1, 0, 3);
  331. -- UPLOADERS
  332. INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
  333. ('bx_stories_html5', 1, 'BxStoriesUploaderHTML5', 'modules/boonex/stories/classes/BxStoriesUploaderHTML5.php'),
  334. ('bx_stories_record_video', 1, 'BxStoriesUploaderRecordVideo', 'modules/boonex/stories/classes/BxStoriesUploaderRecordVideo.php'),
  335. ('bx_stories_crop', 1, 'BxStoriesUploaderCrop', 'modules/boonex/stories/classes/BxStoriesUploaderCrop.php');
  336. -- ALERTS
  337. INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES
  338. ('bx_stories', 'BxStoriesAlertsResponse', 'modules/boonex/stories/classes/BxStoriesAlertsResponse.php', '');
  339. SET @iHandler := LAST_INSERT_ID();
  340. INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
  341. ('system', 'save_setting', @iHandler),
  342. ('profile', 'delete', @iHandler),
  343. ('bx_stories_files', 'file_deleted', @iHandler),
  344. ('bx_stories_video_mp4', 'transcoded', @iHandler);