Skip to content

Commit

Permalink
Ticket #4558 - Build-in API support: Default page blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Dec 5, 2024
1 parent 7dc831a commit d7713df
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
25 changes: 14 additions & 11 deletions install/sql/system.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6025,21 +6025,24 @@ INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `
('', 0, 'system', '_sys_page_block_title_sys_ask_aqssistant', '_sys_page_block_title_ask_aqssistant', 11, 0, 0, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:23:"get_block_ask_assistant";s:6:"params";a:1:{i:0;a:0:{}}s:5:"class";s:13:"TemplServices";}', 0, 1, 1, @iBlockOrder + 8);

-- content blocks
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `tabs`, `async`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES

('sys_home', 0, 'system', '', '_sys_page_block_title_profile_avatar', 13, 0, 0, 2147483646, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"profile_avatar";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 1, 1),

('sys_home', 0, 'system', '', '_sys_page_block_title_profile_menu', 13, 0, 0, 2147483644, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:12:"profile_menu";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 1, 2),

('sys_home', 0, 'system', '', '_sys_page_block_title_profile_followings', 13, 0, 0, 2147483644, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:18:"profile_followings";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 1, 3),
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `tabs`, `async`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `active_api`, `order`) VALUES
('sys_home', 0, 'system', '', '_sys_page_block_title_profile_avatar', 13, 0, 0, 2147483646, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"profile_avatar";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 1, 0, 1),
('sys_home', 0, 'system', '', '_sys_page_block_title_profile_menu', 13, 0, 0, 2147483644, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:12:"profile_menu";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 1, 0, 2),
('sys_home', 0, 'system', '', '_sys_page_block_title_profile_followings', 13, 0, 0, 2147483644, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:18:"profile_followings";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 1, 0, 3),

('sys_home', 1, 'system', '', '_sys_page_block_title_homepage_splash', 0, 0, 0, 2147483647, 'raw', '<style>\r\n /*--- Splash ---*/\r\n .bx-page {\r\n position: relative;\r\n }\r\n .bx-splash-block {\r\n position: relative;\r\n display: -webkit-flex;\r\n display: flex;\r\n -webkit-align-items: center;\r\n align-items: center;\r\n }\r\n .bx-spl-preload {\r\n position: absolute;\r\n\r\n top: 0px;\r\n left: 0px;\r\n width: 1px;\r\n height: 1px;\r\n\r\n overflow: hidden;\r\n }\r\n .bx-spl-line {\r\n position: relative;\r\n display: -webkit-flex;\r\n display: flex;\r\n -webkit-align-items: stretch;\r\n align-items: stretch;\r\n }\r\n .bx-media-phone .bx-spl-line {\r\n -webkit-flex-direction: column;\r\n flex-direction: column;\r\n }\r\n .bx-spl-cell {\r\n position: relative;\r\n }\r\n .bx-media-phone .bx-spl-cell {\r\n -webkit-basis: 100% !important; \r\n flex-basis: 100% !important;\r\n width: 100% !important;\r\n }\r\n .bx-spl-line.bx-spl-l1 .bx-spl-cell {\r\n display: -webkit-flex;\r\n display: flex;\r\n -webkit-align-items: center;\r\n align-items: center;\r\n }\r\n .bx-spl-line.bx-spl-l1 .bx-spl-cell.bx-spl-c1 {\r\n -webkit-flex: 1 1 70%; \r\n flex: 1 1 70%;\r\n width: 70%;\r\n }\r\n .bx-media-phone .bx-spl-line.bx-spl-l1 .bx-spl-cell.bx-spl-c1 {\r\n text-align: center;\r\n }\r\n .bx-spl-line.bx-spl-l1 .bx-spl-cell.bx-spl-c2 {\r\n -webkit-flex: 0 0 30%; \r\n flex: 0 1 30%;\r\n -webkit-justify-content: center;\r\n justify-content: center;\r\n width: 30%;\r\n }\r\n .bx-spl-line.bx-spl-l1 .bx-spl-image {\r\n max-width: 100%;\r\n }\r\n .bx-spl-line.bx-spl-l2 .bx-spl-cell {\r\n -webkit-flex: 1 1 33%; \r\n flex: 1 1 33%;\r\n width: 33%;\r\n }\r\n .bx-media-phone .bx-spl-line.bx-spl-l2 .bx-spl-cell {\r\n text-align: center;\r\n }\r\n .bx-spl-line.bx-spl-l2 .bx-spl-cicon {\r\n position: relative;\r\n display: -webkit-flex;\r\n display: flex;\r\n -webkit-align-items: flex-start;\r\n align-items: flex-start;\r\n justify-content: flex-start;\r\n -webkit-justify-content: flex-start;\r\n }\r\n .bx-media-phone .bx-spl-line.bx-spl-l2 .bx-spl-cicon {\r\n justify-content: center;\r\n -webkit-justify-content: center;\r\n }\r\n .bx-spl-line.bx-spl-l2 .bx-spl-cicon .animation {\r\n width: 4.25rem;\r\n height: 4.25rem;\r\n }\r\n</style>\r\n<div class=\"bx-page bx-def-color-bg-page\">\r\n <div class=\"bx-splash-block\">\r\n <div class=\"bx-splash-cnt bx-def-page-width bx-def-centered bx-def-padding-leftright\">\r\n <div class=\"bx-spl-preload\">\r\n <img src=\"<bx_image_url:spl-image-main.svg />\">\r\n </div>\r\n <div class=\"bx-spl-line bx-spl-l1\">\r\n <div class=\"bx-spl-cell bx-spl-c1\">\r\n <div class=\"bx-spl-ccnt bx-def-padding\">\r\n <div class=\"bx-spl-title bx-def-font-h1 bx-def-font-semibold\"><bx_text:_sys_txt_splash_title /></div>\r\n <div class=\"bx-spl-slogan bx-def-padding-sec-top bx-def-padding-bottom bx-def-font-grayed\"><bx_text:_sys_txt_splash_slogan /></div>\r\n <div class=\"bx-spl-image bx-def-padding-top\">\r\n <img class=\"bx-spl-image\" src=\"<bx_image_url:spl-image-main.svg />\" />\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"bx-spl-cell bx-spl-c2 bx-hide-when-logged-in\">\r\n <div class=\"bx-spl-ccnt bx-def-padding\">__join_form_in_box__</div>\r\n </div>\r\n </div>\r\n <div class=\"bx-spl-line bx-spl-l2 bx-def-padding\">\r\n <div class=\"bx-spl-cell bx-spl-c1\">\r\n <div class=\"bx-spl-ccnt bx-def-padding\">\r\n <div class=\"bx-spl-cicon connect\"><div class=\"animation\"></div></div>\r\n <div class=\"bx-spl-ctitle bx-def-padding-sec-topbottom bx-def-font-h2\"><bx_text:_sys_txt_splash_connect /></div>\r\n <div class=\"bx-spl-ctext bx-def-font-grayed\"><bx_text:_sys_txt_splash_connect_text /></div>\r\n </div>\r\n </div>\r\n <div class=\"bx-spl-cell bx-spl-c2\">\r\n <div class=\"bx-spl-ccnt bx-def-padding\">\r\n <div class=\"bx-spl-cicon share\"><div class=\"animation\"></div></div>\r\n <div class=\"bx-spl-ctitle bx-def-padding-sec-topbottom bx-def-font-h2\"><bx_text:_sys_txt_splash_share /></div>\r\n <div class=\"bx-spl-ctext bx-def-font-grayed\"><bx_text:_sys_txt_splash_share_text /></div>\r\n </div>\r\n </div>\r\n <div class=\"bx-spl-cell bx-spl-c3\">\r\n <div class=\"bx-spl-ccnt bx-def-padding\">\r\n <div class=\"bx-spl-cicon create\"><div class=\"animation\"></div></div>\r\n <div class=\"bx-spl-ctitle bx-def-padding-sec-topbottom bx-def-font-h2\"><bx_text:_sys_txt_splash_create /></div>\r\n <div class=\"bx-spl-ctext bx-def-font-grayed\"><bx_text:_sys_txt_splash_create_text /></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<script>\r\n var animConnect = bodymovin.loadAnimation({\r\n container: $(\'.bx-spl-cicon.connect .animation\').get(0),\r\n path: \'<bx_image_url:spl-icon-connect.json />\',\r\n renderer: \'svg\',\r\n loop: true,\r\n autoplay: true,\r\n });\r\n var animShare = bodymovin.loadAnimation({\r\n container: $(\'.bx-spl-cicon.share .animation\').get(0),\r\n path: \'<bx_image_url:spl-icon-share.json />\',\r\n renderer: \'svg\',\r\n loop: true,\r\n autoplay: true,\r\n });\r\n var animCreate = bodymovin.loadAnimation({\r\n container: $(\'.bx-spl-cicon.create .animation\').get(0),\r\n path: \'<bx_image_url:spl-icon-create.json />\',\r\n renderer: \'svg\',\r\n loop: true,\r\n autoplay: true,\r\n });\r\n</script>', 0, 1, 0, 0),
-- for API only
('sys_home', 1, 'system', '', '_sys_page_block_title_create_account', 11, 0, 0, 1, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:19:"create_account_form";s:6:"params";a:0:{}s:5:"class";s:19:"TemplServiceAccount";}', 0, 0, 0, 1, 0),
('sys_home', 1, 'system', '_sys_page_block_system_title_login', '_sys_page_block_title_login', 11, 0, 0, 1, 'service', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:10:"login_form";s:5:"class";s:17:"TemplServiceLogin";}', 0, 0, 0, 1, 0),
('sys_home', 1, 'system', '', '_sys_page_block_title_forgot_password', 13, 0, 0, 1, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:15:"forgot_password";s:6:"params";a:0:{}s:5:"class";s:19:"TemplServiceAccount";}', 0, 0, 0, 1, 0),
-- for API only

('sys_home', 1, 'system', '', '_sys_page_block_title_homepage_menu', 13, 0, 0, 2147483647, 'menu', 'sys_homepage', 0, 1, 1, 0),
('sys_home', 1, 'system', '', '_sys_page_block_title_homepage_splash', 0, 0, 0, 2147483647, 'raw', '<style>\r\n /*--- Splash ---*/\r\n .bx-page {\r\n position: relative;\r\n }\r\n .bx-splash-block {\r\n position: relative;\r\n display: -webkit-flex;\r\n display: flex;\r\n -webkit-align-items: center;\r\n align-items: center;\r\n }\r\n .bx-spl-preload {\r\n position: absolute;\r\n\r\n top: 0px;\r\n left: 0px;\r\n width: 1px;\r\n height: 1px;\r\n\r\n overflow: hidden;\r\n }\r\n .bx-spl-line {\r\n position: relative;\r\n display: -webkit-flex;\r\n display: flex;\r\n -webkit-align-items: stretch;\r\n align-items: stretch;\r\n }\r\n .bx-media-phone .bx-spl-line {\r\n -webkit-flex-direction: column;\r\n flex-direction: column;\r\n }\r\n .bx-spl-cell {\r\n position: relative;\r\n }\r\n .bx-media-phone .bx-spl-cell {\r\n -webkit-basis: 100% !important; \r\n flex-basis: 100% !important;\r\n width: 100% !important;\r\n }\r\n .bx-spl-line.bx-spl-l1 .bx-spl-cell {\r\n display: -webkit-flex;\r\n display: flex;\r\n -webkit-align-items: center;\r\n align-items: center;\r\n }\r\n .bx-spl-line.bx-spl-l1 .bx-spl-cell.bx-spl-c1 {\r\n -webkit-flex: 1 1 70%; \r\n flex: 1 1 70%;\r\n width: 70%;\r\n }\r\n .bx-media-phone .bx-spl-line.bx-spl-l1 .bx-spl-cell.bx-spl-c1 {\r\n text-align: center;\r\n }\r\n .bx-spl-line.bx-spl-l1 .bx-spl-cell.bx-spl-c2 {\r\n -webkit-flex: 0 0 30%; \r\n flex: 0 1 30%;\r\n -webkit-justify-content: center;\r\n justify-content: center;\r\n width: 30%;\r\n }\r\n .bx-spl-line.bx-spl-l1 .bx-spl-image {\r\n max-width: 100%;\r\n }\r\n .bx-spl-line.bx-spl-l2 .bx-spl-cell {\r\n -webkit-flex: 1 1 33%; \r\n flex: 1 1 33%;\r\n width: 33%;\r\n }\r\n .bx-media-phone .bx-spl-line.bx-spl-l2 .bx-spl-cell {\r\n text-align: center;\r\n }\r\n .bx-spl-line.bx-spl-l2 .bx-spl-cicon {\r\n position: relative;\r\n display: -webkit-flex;\r\n display: flex;\r\n -webkit-align-items: flex-start;\r\n align-items: flex-start;\r\n justify-content: flex-start;\r\n -webkit-justify-content: flex-start;\r\n }\r\n .bx-media-phone .bx-spl-line.bx-spl-l2 .bx-spl-cicon {\r\n justify-content: center;\r\n -webkit-justify-content: center;\r\n }\r\n .bx-spl-line.bx-spl-l2 .bx-spl-cicon .animation {\r\n width: 4.25rem;\r\n height: 4.25rem;\r\n }\r\n</style>\r\n<div class=\"bx-page bx-def-color-bg-page\">\r\n <div class=\"bx-splash-block\">\r\n <div class=\"bx-splash-cnt bx-def-page-width bx-def-centered bx-def-padding-leftright\">\r\n <div class=\"bx-spl-preload\">\r\n <img src=\"<bx_image_url:spl-image-main.svg />\">\r\n </div>\r\n <div class=\"bx-spl-line bx-spl-l1\">\r\n <div class=\"bx-spl-cell bx-spl-c1\">\r\n <div class=\"bx-spl-ccnt bx-def-padding\">\r\n <div class=\"bx-spl-title bx-def-font-h1 bx-def-font-semibold\"><bx_text:_sys_txt_splash_title /></div>\r\n <div class=\"bx-spl-slogan bx-def-padding-sec-top bx-def-padding-bottom bx-def-font-grayed\"><bx_text:_sys_txt_splash_slogan /></div>\r\n <div class=\"bx-spl-image bx-def-padding-top\">\r\n <img class=\"bx-spl-image\" src=\"<bx_image_url:spl-image-main.svg />\" />\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"bx-spl-cell bx-spl-c2 bx-hide-when-logged-in\">\r\n <div class=\"bx-spl-ccnt bx-def-padding\">__join_form_in_box__</div>\r\n </div>\r\n </div>\r\n <div class=\"bx-spl-line bx-spl-l2 bx-def-padding\">\r\n <div class=\"bx-spl-cell bx-spl-c1\">\r\n <div class=\"bx-spl-ccnt bx-def-padding\">\r\n <div class=\"bx-spl-cicon connect\"><div class=\"animation\"></div></div>\r\n <div class=\"bx-spl-ctitle bx-def-padding-sec-topbottom bx-def-font-h2\"><bx_text:_sys_txt_splash_connect /></div>\r\n <div class=\"bx-spl-ctext bx-def-font-grayed\"><bx_text:_sys_txt_splash_connect_text /></div>\r\n </div>\r\n </div>\r\n <div class=\"bx-spl-cell bx-spl-c2\">\r\n <div class=\"bx-spl-ccnt bx-def-padding\">\r\n <div class=\"bx-spl-cicon share\"><div class=\"animation\"></div></div>\r\n <div class=\"bx-spl-ctitle bx-def-padding-sec-topbottom bx-def-font-h2\"><bx_text:_sys_txt_splash_share /></div>\r\n <div class=\"bx-spl-ctext bx-def-font-grayed\"><bx_text:_sys_txt_splash_share_text /></div>\r\n </div>\r\n </div>\r\n <div class=\"bx-spl-cell bx-spl-c3\">\r\n <div class=\"bx-spl-ccnt bx-def-padding\">\r\n <div class=\"bx-spl-cicon create\"><div class=\"animation\"></div></div>\r\n <div class=\"bx-spl-ctitle bx-def-padding-sec-topbottom bx-def-font-h2\"><bx_text:_sys_txt_splash_create /></div>\r\n <div class=\"bx-spl-ctext bx-def-font-grayed\"><bx_text:_sys_txt_splash_create_text /></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<script>\r\n var animConnect = bodymovin.loadAnimation({\r\n container: $(\'.bx-spl-cicon.connect .animation\').get(0),\r\n path: \'<bx_image_url:spl-icon-connect.json />\',\r\n renderer: \'svg\',\r\n loop: true,\r\n autoplay: true,\r\n });\r\n var animShare = bodymovin.loadAnimation({\r\n container: $(\'.bx-spl-cicon.share .animation\').get(0),\r\n path: \'<bx_image_url:spl-icon-share.json />\',\r\n renderer: \'svg\',\r\n loop: true,\r\n autoplay: true,\r\n });\r\n var animCreate = bodymovin.loadAnimation({\r\n container: $(\'.bx-spl-cicon.create .animation\').get(0),\r\n path: \'<bx_image_url:spl-icon-create.json />\',\r\n renderer: \'svg\',\r\n loop: true,\r\n autoplay: true,\r\n });\r\n</script>', 0, 1, 0, 0, 0),
('sys_home', 1, 'system', '', '_sys_page_block_title_homepage_menu', 13, 0, 0, 2147483647, 'menu', 'sys_homepage', 0, 1, 1, 0, 0),

('sys_home', 2, 'system', '', '_sys_page_block_title_profile_stats', 3, 0, 0, 2147483644, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:13:"profile_stats";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 0, 1, 1),
('sys_home', 2, 'system', '', '_sys_page_block_title_profile_stats', 3, 0, 0, 2147483644, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:13:"profile_stats";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 0, 1, 0, 1),
('sys_home', 3, 'system', '_sys_page_block_title_sys_create_post', '_sys_page_block_title_create_post', 11, 1, 4, 2147483644, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:20:"get_create_post_form";s:6:"params";a:1:{i:0;i:0;}s:5:"class";s:13:"TemplServices";}', 0, 0, 1, 0, 1);

('sys_home', 3, 'system', '_sys_page_block_title_sys_create_post', '_sys_page_block_title_create_post', 11, 1, 4, 2147483644, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:20:"get_create_post_form";s:6:"params";a:1:{i:0;i:0;}s:5:"class";s:13:"TemplServices";}', 0, 0, 1, 1),
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `tabs`, `async`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES

('sys_about', 1, 'system', '', '_sys_page_block_title_about', 11, 0, 0, 2147483647, 'lang', '_sys_page_lang_block_about', 0, 1, 1, 1),

Expand Down
6 changes: 6 additions & 0 deletions modules/boonex/invites/install/sql/enable.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_invites_invites', 1, @sName, '_bx_invites_page_block_title_invites', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_invites";s:6:"method";s:24:"get_block_manage_invites";}', 0, 1, 1);

-- PAGES: add page block on homepage
SET @iPBCellDashboard = 1;
SET @iPBOrderDashboard = 0;
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `active_api`, `order`) VALUES
('sys_home', @iPBCellDashboard, @sName, '_bx_invites_page_block_title_request_form', 11, 1, 'service', 'a:2:{s:6:"module";s:10:"bx_invites";s:6:"method";s:22:"get_block_form_request";}', 0, 0, 0, 1, @iPBOrderDashboard);

-- PAGES: add page block on dashboard
SET @iPBCellDashboard = 3;
SET @iPBOrderDashboard = 2; --(SELECT IFNULL(MAX(`order`), 0) FROM `sys_pages_blocks` WHERE `object` = 'sys_dashboard' AND `cell_id` = @iPBCellDashboard LIMIT 1);
Expand Down

0 comments on commit d7713df

Please sign in to comment.