RomanL 8 лет назад
Родитель
Сommit
190fe5aeb7

+ 2 - 0
modules/boonex/posts/classes/BxPostsConfig.php

@@ -127,10 +127,12 @@ class BxPostsConfig extends BxBaseModTextConfig
         );
 
         $this->_aJsClasses = array(
+			'main' => 'BxPostsMain',
         	'manage_tools' => 'BxPostsManageTools'
         );
 
         $this->_aJsObjects = array(
+			'main' => 'oBxPostsMain',
         	'manage_tools' => 'oBxPostsManageTools'
         );
 

+ 2 - 0
modules/boonex/posts/classes/BxPostsTemplate.php

@@ -21,6 +21,8 @@ class BxPostsTemplate extends BxBaseModTextTemplate
     {
         $this->MODULE = 'bx_posts';
         parent::__construct($oConfig, $oDb);
+		$this->addCss(array(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'flickity/|flickity.css'));
+        $this->addJs(array('flickity/flickity.pkgd.min.js', 'main.js'));
     }
 
     /**

+ 4 - 0
modules/boonex/posts/install/langs/en.xml

@@ -217,4 +217,8 @@
     <string name="_bx_posts_txt_sample_single_with_article"><![CDATA[a post]]></string>
     <string name="_bx_posts_txt_sample_comment_single"><![CDATA[comment to post]]></string>
     <string name="_bx_posts_txt_sample_vote_single"><![CDATA[vote to post]]></string>
+	
+	<string name="_bx_posts_option_per_page_browse_showcase"><![CDATA[Number of items in showcase view]]></string>
+	<string name="_bx_posts_page_block_title_recent_entries_view_showcase"><![CDATA[Latest Posts (Showcase View)]]></string>
+	<string name="_bx_posts_page_block_title_popular_entries_view_showcase"><![CDATA[Popular Posts (Showcase View)]]></string>
 </resources>

+ 7 - 2
modules/boonex/posts/install/sql/enable.sql

@@ -16,7 +16,9 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_posts_per_page_browse', '12', @iCategId, '_bx_posts_option_per_page_browse', 'digit', '', '', '', 10),
 ('bx_posts_per_page_profile', '6', @iCategId, '_bx_posts_option_per_page_profile', 'digit', '', '', '', 12),
 ('bx_posts_rss_num', '10', @iCategId, '_bx_posts_option_rss_num', 'digit', '', '', '', 20),
-('bx_posts_searchable_fields', 'title,text', @iCategId, '_bx_posts_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:8:"bx_posts";s:6:"method";s:21:"get_searchable_fields";}', 30);
+('bx_posts_searchable_fields', 'title,text', @iCategId, '_bx_posts_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:8:"bx_posts";s:6:"method";s:21:"get_searchable_fields";}', 30),
+('bx_posts_per_page_browse_showcase', '32', @iCategId, '_bx_posts_option_per_page_browse_showcase', 'digit', '', '', '', 10)
+;
 
 -- PAGE: create entry
 
@@ -157,7 +159,10 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbo
 
 ('', 0, 'bx_posts', '_bx_posts_page_block_title_recent_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 2),
 ('', 0, 'bx_posts', '_bx_posts_page_block_title_popular_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 3),
-('', 0, 'bx_posts', '_bx_posts_page_block_title_popular_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 4);
+('', 0, 'bx_posts', '_bx_posts_page_block_title_popular_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_posts";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 4),
+('', 0, 'bx_posts', '_bx_posts_page_block_title_recent_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_public\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:8:\"showcase\";s:13:\"empty_message\";b:1;s:13:\"ajax_paginate\";b:0;}}', 0, 1, IFNULL(@iBlockOrder, 0) + 5),
+('', 0, 'bx_posts', '_bx_posts_page_block_title_popular_entries_view_showcase', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_popular\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:8:\"showcase\";s:13:\"empty_message\";b:1;s:13:\"ajax_paginate\";b:0;}}', 0, 1, IFNULL(@iBlockOrder, 0) + 6);
+
 
 -- MENU: add to site menu
 

+ 36 - 0
modules/boonex/posts/js/main.js

@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Posts Posts
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxPostsMain(oOptions) {
+	this._sActionsUrl = oOptions.sActionUrl;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxPostsMain' : oOptions.sObjName;
+
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+
+    var $this = this;
+    $(document).ready(function() {
+    	$this.init();
+    });
+}
+
+BxPostsMain.prototype.init = function() {
+	$('.bx-base-text-unit-showcase-wrapper').flickity({
+		cellSelector: '.bx-base-text-unit-gallery',
+		cellAlign: 'left',
+		pageDots: false,
+		imagesLoaded: true
+	});
+};
+
+/** @} */

+ 1 - 0
modules/boonex/posts/template/unit_showcase.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/unit_showcase.html />