diff --git a/inc/classes/BxDolPage.php b/inc/classes/BxDolPage.php index 8150e820f7..3e7678ed1c 100644 --- a/inc/classes/BxDolPage.php +++ b/inc/classes/BxDolPage.php @@ -525,6 +525,11 @@ public function getName () return $this->_sObject; } + public function getObject () + { + return $this->_aObject; + } + public function getInjections() { $aResult = array(); diff --git a/inc/classes/BxDolTemplate.php b/inc/classes/BxDolTemplate.php index c725a57659..f8e6c3cbbd 100644 --- a/inc/classes/BxDolTemplate.php +++ b/inc/classes/BxDolTemplate.php @@ -832,6 +832,22 @@ function getCode() { return $this->_sCode; } + + /** + * Get embed code. + * + * @return string embed's code. + */ + function getEmbed($sContent) + { + $this->addJs(['inc/js/|embed.js']); + $this->addCss(['embed.css']); + + $this->setPageNameIndex (BX_PAGE_EMBED); + $this->setPageContent('page_main_code', '
' . $sContent . '
'); + $this->getPageCode(); + + } /** * Get code key. @@ -1173,7 +1189,7 @@ function getMetaInfo() if (!empty($this->aPage['rss']) && !empty($this->aPage['rss']['url'])) $sRet .= ''; - $sRet .= "aPage['header']) ? bx_html_attribute(strip_tags($this->aPage['header'])) : '') . "\" />"; + $sRet .= "aPage['header']) ? bx_html_attribute(strip_tags($this->aPage['header'])) : '') . "\" />"; return $sRet; } diff --git a/install/sql/system.sql b/install/sql/system.sql index a974397979..39599fe394 100644 --- a/install/sql/system.sql +++ b/install/sql/system.sql @@ -319,10 +319,10 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex (@iCategoryId, 'sys_live_updates_interval', '_adm_stg_cpt_option_sys_live_updates_interval', '10000', 'digit', '', '', '', '', 60), -(@iCategoryId, 'sys_quill_toolbar_mini', '_adm_stg_cpt_option_sys_quill_toolbar_mini', '[\'bold\',\'italic\',\'underline\',\'clean\'],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'}],[{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'}],[\'blockquote\'],[\'link\',\'image\',\'embed\']', 'digit', '', '', '', '', 70), -(@iCategoryId, 'sys_quill_toolbar_standard', '_adm_stg_cpt_option_sys_quill_toolbar_standard', '[\'bold\',\'italic\',\'underline\',\'clean\'],[{ \'header\': [1, 2, 3, 4, 5, 6, false] }],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'}],[{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'},{\'align\':\'justify\'}],[\'blockquote\'],[\'link\',\'image\',\'embed\']', 'digit', '', '', '', '', 73), -(@iCategoryId, 'sys_quill_toolbar_full', '_adm_stg_cpt_option_sys_quill_toolbar_full', '[{ \'header\': [1, 2, 3, 4, 5, 6, false] }],[\'bold\',\'italic\',\'underline\',\'clean\'], - [{ \'align\': [] }],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'}],[\'blockquote\'],[{ \'color\': [] }, { \'background\': [] }],[{ \'direction\': \'rtl\' }],[{ \'script\': \'sub\'}, { \'script\': \'super\' }],[\'link\',\'image\',\'embed\',\'code-block\']', 'digit', '', '', '', '', 76), +(@iCategoryId, 'sys_quill_toolbar_mini', '_adm_stg_cpt_option_sys_quill_toolbar_mini', '[\'bold\',\'italic\',\'underline\',\'clean\',{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'},\'blockquote\',\'link\',\'image\',\'embed\']', 'digit', '', '', '', '', 70), +(@iCategoryId, 'sys_quill_toolbar_standard', '_adm_stg_cpt_option_sys_quill_toolbar_standard', '[\'bold\',\'italic\',\'underline\',\'clean\',{ \'header\': [1, 2, 3, 4, 5, 6, false] },{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'},{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'},{\'align\':\'justify\'},\'blockquote\',\'link\',\'image\',\'embed\']', 'digit', '', '', '', '', 73), +(@iCategoryId, 'sys_quill_toolbar_full', '_adm_stg_cpt_option_sys_quill_toolbar_full', '[{ \'header\': [1, 2, 3, 4, 5, 6, false] },\'bold\',\'italic\',\'underline\',\'clean\'], + [{ \'align\': [] },{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'},\'blockquote\',{ \'color\': [] }, { \'background\': [] },{ \'direction\': \'rtl\' },\'link\',\'image\',\'embed\',\'code-block\']', 'digit', '', '', '', '', 76), (@iCategoryId, 'sys_search_keyword_min_len', '_adm_stg_cpt_option_sys_search_keyword_min_len', '1', 'digit', '', '', '', '', 80), diff --git a/modules/base/general/classes/BxBaseModGeneralModule.php b/modules/base/general/classes/BxBaseModGeneralModule.php index be9e27222f..6374cfd222 100644 --- a/modules/base/general/classes/BxBaseModGeneralModule.php +++ b/modules/base/general/classes/BxBaseModGeneralModule.php @@ -107,7 +107,8 @@ public function actionEmbed($iContentId) if(empty($sUnitTemplate)) $sUnitTemplate = 'unit_gallery.html'; - echo $this->_oTemplate->unit($aContentInfo, true, $sUnitTemplate); + $oTemplate = BxDolTemplate::getInstance(); + $oTemplate->getEmbed($this->_oTemplate->unit($aContentInfo, true, $sUnitTemplate)); } public function subactionDelete() diff --git a/modules/base/general/template/embed.html b/modules/base/general/template/embed.html deleted file mode 100644 index 83da2f9b6a..0000000000 --- a/modules/base/general/template/embed.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/modules/boonex/artificer/data/template/system/unit_meta_item.html b/modules/boonex/artificer/data/template/system/unit_meta_item.html index bf37545d55..b7a05e3129 100644 --- a/modules/boonex/artificer/data/template/system/unit_meta_item.html +++ b/modules/boonex/artificer/data/template/system/unit_meta_item.html @@ -18,6 +18,6 @@  ·  - __content__ + __content__ \ No newline at end of file diff --git a/modules/boonex/forum/classes/BxForumGrid.php b/modules/boonex/forum/classes/BxForumGrid.php index f57f8b0eff..430ae4cfa5 100644 --- a/modules/boonex/forum/classes/BxForumGrid.php +++ b/modules/boonex/forum/classes/BxForumGrid.php @@ -199,13 +199,14 @@ protected function _getCellAuthor($mixedValue, $sKey, $aField, $aRow) protected function _getCellCategory($mixedValue, $sKey, $aField, $aRow) { - $sIcon = ''; + $sIcon = $this->_oModule->_oTemplate->parseHtmlByName('default_category.html', []); $o = BxDolCategory::getObjectInstance('bx_forum_cats'); $aCategoryData = $this->_oModule->_oDb->getCategories(array('type' => 'by_category', 'category' => $aRow['cat'])); if(isset($aCategoryData['icon'])) $sIcon = $this->_oTemplate->getImage($aCategoryData['icon'], array('class' => 'sys-icon')); + // echo $sIcon; $mixedValue = $this->_oModule->_oTemplate->parseHtmlByName('thumb.html', ['icon' => $sIcon, 'title' => $o->getCategoryTitle($aRow['cat'])]); return self::_getCellDefault($mixedValue, $sKey, $aField, $aRow); } diff --git a/modules/boonex/forum/classes/BxForumMenuSnippetMeta.php b/modules/boonex/forum/classes/BxForumMenuSnippetMeta.php index 155356046c..b3f662ada1 100644 --- a/modules/boonex/forum/classes/BxForumMenuSnippetMeta.php +++ b/modules/boonex/forum/classes/BxForumMenuSnippetMeta.php @@ -104,14 +104,14 @@ protected function _getMenuItemStatus($aItem) $sIcon = ''; if ($this->_aContentInfo['resolvable']){ if ($this->_aContentInfo['resolved']){ - $sIcon .= 'checked-circle'; + $sIcon .= 'check-circle'; } else{ $sIcon .= 'question-circle'; } } else{ - $sIcon .= 'comment-alt'; + $sIcon .= 'comment'; } return $this->getUnitMetaItemCustom($this->_oModule->_oTemplate->parseHtmlByName('status.html', ['icon' => $sIcon , 'counter' => (int)$oObject->getCommentsCountAll()])); } diff --git a/modules/boonex/forum/classes/BxForumModule.php b/modules/boonex/forum/classes/BxForumModule.php index b273de3876..aa1b63df16 100644 --- a/modules/boonex/forum/classes/BxForumModule.php +++ b/modules/boonex/forum/classes/BxForumModule.php @@ -195,7 +195,9 @@ public function serviceCategoriesList($aParams = array()) $aCategoryData = $this->_oDb->getCategories(array('type' => 'by_category', 'category' => $aCategory['value'])); if(isset($aCategoryData['icon'])) - $aCategories['bx_repeat:cats'][$sKey]['icon'] = $this->_oTemplate->getImage($aCategoryData['icon'], array('class' => 'sys-icon sys-colored')); + $aCategories['bx_repeat:cats'][$sKey]['icon'] = $this->_oTemplate->getImage($aCategoryData['icon'], array('class' => 'sys-icon sys-colored')); + else + $aCategories['bx_repeat:cats'][$sKey]['icon'] = $this->_oTemplate->parseHtmlByName('default_category.html', []); if(isset($aCategoryData['visible_for_levels']) && $aCategoryData['visible_for_levels'] != '' && !BxDolAcl::getInstance()->isMemberLevelInSet($aCategoryData['visible_for_levels'])){ unset($aCategories['bx_repeat:cats'][$sKey]); diff --git a/modules/boonex/forum/install/langs/en.xml b/modules/boonex/forum/install/langs/en.xml index b9e6b6010a..df44467201 100644 --- a/modules/boonex/forum/install/langs/en.xml +++ b/modules/boonex/forum/install/langs/en.xml @@ -100,7 +100,7 @@ - + @@ -249,10 +249,10 @@ - - - - + + + + @@ -316,6 +316,11 @@ + + + + + @@ -362,8 +367,8 @@ - - + + diff --git a/modules/boonex/forum/install/sql/enable.sql b/modules/boonex/forum/install/sql/enable.sql index 5f3b958a2a..c0531a34fb 100644 --- a/modules/boonex/forum/install/sql/enable.sql +++ b/modules/boonex/forum/install/sql/enable.sql @@ -350,8 +350,8 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl ('bx_forum_snippet_meta_main', 'bx_forum', 'author', '_sys_menu_item_title_system_sm_author', '_sys_menu_item_title_sm_author', '', '', '', '', '', 2147483647, 1, 0, 1, 1), ('bx_forum_snippet_meta_main', 'bx_forum', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 1, 0, 1, 2), ('bx_forum_snippet_meta_main', 'bx_forum', 'category', '_sys_menu_item_title_system_sm_category', '_sys_menu_item_title_sm_category', '', '', '', '', '', 2147483647, 1, 0, 1, 3), -('bx_forum_snippet_meta_main', 'bx_forum', 'status', '_sys_menu_item_title_system_sm_status', '_sys_menu_item_title_sm_status', '', '', '', '', '', 2147483647, 1, 0, 1, 4), -('bx_forum_snippet_meta_main', 'bx_forum', 'badges', '_sys_menu_item_title_system_sm_badges', '_sys_menu_item_title_sm_badges', '', '', '', '', '', 2147483647, 1, 0, 1, 5); +('bx_forum_snippet_meta_main', 'bx_forum', 'status', '_bx_forum_menu_item_title_system_sm_status', '_bx_forum_menu_item_title_sm_status', '', '', '', '', '', 2147483647, 1, 0, 1, 4), +('bx_forum_snippet_meta_main', 'bx_forum', 'badges', '_bx_forum_menu_item_title_system_sm_badges', '_bx_forum_menu_item_title_sm_badges', '', '', '', '', '', 2147483647, 1, 0, 1, 5); -- MENU: custom menu for 'counters' snippet meta info INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES diff --git a/modules/boonex/forum/js/main.js b/modules/boonex/forum/js/main.js index 44456f8928..45c42e3b24 100644 --- a/modules/boonex/forum/js/main.js +++ b/modules/boonex/forum/js/main.js @@ -42,13 +42,21 @@ BxForumMain.prototype.init = function() { var iInnerWidth = oTable.parent().innerWidth(); oTable.find('.bx-forum-grid-preview').each(function () { var eWrapper = $(this).parent(); - // var w = iInnerWidth - iCalcWidth - parseInt(eWrapper.css('padding-left')) - parseInt(eWrapper.css('padding-right')); - // $(this).width(w + 'px'); }); - oTable.find('tr').each(function () { - $(this).click(function() { - location = $(this).find('.bx-forum-gp-title A').attr('href'); + oTable.find('tr').each(function () { + $(this).removeClass('bx-def-color-bg-hl') + $(this).click(function (evt) { + console.log(event.srcElement.localName); + if (!event.srcElement.closest('a')) { + location = $(this).find('.bx-forum-gp-title A').attr('href'); + } + }) + $(this).mouseover(function (evt) { + $(this).addClass('bx-def-color-bg-box') + }) + $(this).mouseout(function (evt) { + $(this).removeClass('bx-def-color-bg-box') }) }); diff --git a/modules/boonex/forum/template/css/main.css b/modules/boonex/forum/template/css/main.css index a1ee1e02dc..8fb97a910e 100644 --- a/modules/boonex/forum/template/css/main.css +++ b/modules/boonex/forum/template/css/main.css @@ -144,7 +144,6 @@ font-size: 1rem; line-height: 1.5; font-weight: 500; - color:rgb(17,24,29) } .bx-forum-grid-preview .bx-forum-gp-title .sys-icon, @@ -329,6 +328,8 @@ .bx-forum-thumb .sys-icon{ width: 3rem; height: 3rem; + color: #fff; + font-size: 1.75rem; } .bx-forum-thumb .sys-icon-svg{ width: 2.4rem; @@ -360,7 +361,6 @@ vertical-align: top; } .bx-forum-grid tr:hover{ - background: rgb(243,244,246) !important; cursor: pointer; } .bx-forum-grid tr td:first-child{ diff --git a/modules/boonex/forum/template/status.html b/modules/boonex/forum/template/status.html index 1bb3c5b626..662d9bbb6a 100644 --- a/modules/boonex/forum/template/status.html +++ b/modules/boonex/forum/template/status.html @@ -1 +1 @@ - __counter__ + __counter__ diff --git a/modules/boonex/lucid/data/template/system/css/editor.less b/modules/boonex/lucid/data/template/system/css/editor.less index 7e7913f579..f2560f14ad 100644 --- a/modules/boonex/lucid/data/template/system/css/editor.less +++ b/modules/boonex/lucid/data/template/system/css/editor.less @@ -4,7 +4,6 @@ .ql-toolbar.ql-snow{ border: none !important; border-bottom: 1px solid rgba(50, 100, 180, 0.2) !important; - border-radius: 10px; } .ql-container.bx-form-input-html-quill-empty.ql-snow{ border-radius: 0.3rem; diff --git a/page.php b/page.php index f8b54caf22..dc3519e835 100644 --- a/page.php +++ b/page.php @@ -31,11 +31,9 @@ $oPage = BxDolPage::getObjectInstanceByURI('', false, true); if ($oPage) { - $oPage->displayPage(); } else { - $oTemplate = BxDolTemplate::getInstance(); $oTemplate->displayPageNotFound(); } diff --git a/template/css/embed.css b/template/css/embed.css new file mode 100644 index 0000000000..af26d8e2a1 --- /dev/null +++ b/template/css/embed.css @@ -0,0 +1,7 @@ +body, +.bx-embed{ + background-color: transparent !important; +} +.bx-embed{ + width:calc(100% - 2px); +} \ No newline at end of file diff --git a/template/embed.html b/template/embed.html new file mode 100644 index 0000000000..5006de0718 --- /dev/null +++ b/template/embed.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/template/embed_card.html b/template/embed_card.html new file mode 100644 index 0000000000..f1de725246 --- /dev/null +++ b/template/embed_card.html @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/template/scripts/BxBasePage.php b/template/scripts/BxBasePage.php index 6f37683a1b..cb246fdee1 100644 --- a/template/scripts/BxBasePage.php +++ b/template/scripts/BxBasePage.php @@ -59,6 +59,31 @@ public function performActionGetHelp () 'content' => _t($aBlock['help']) )); } + + public function performActionEmbed () + { + $aCover = $this->getPageCoverImage(); + $this->_oTemplate->getEmbed($this->_oTemplate->parseHtmlByName('embed_card.html', [ + 'title' => _t($this->_aObject['title']), + 'url' => BxDolPermalinks::getInstance()->permalink($this->_aObject['url']), + 'bx_if:thumb' => [ + 'condition' => $this->isPageCover() && count($aCover) > 0, + 'content' => [ + 'title' => _t($this->_aObject['title']), + 'url' => BxDolPermalinks::getInstance()->permalink($this->_aObject['url']), + 'background' => BxDolCover::getInstance(BxDolTemplate::getInstance())->getCoverImageUrl($aCover) + ], + ], + 'bx_if:no_thumb' => [ + 'condition' => count($aCover) == 0 || !$this->isPageCover(), + 'content' => [ + 'title' => _t($this->_aObject['title']), + 'url' => BxDolPermalinks::getInstance()->permalink($this->_aObject['url']), + ] + ] + ] + )); + } /** * Very similar to BxBasePage::getCode