瀏覽代碼

Ticket #1447 - General part and Forum.

AntonLV 8 年之前
父節點
當前提交
4202cc78ac

+ 1 - 1
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -560,7 +560,7 @@ class BxBaseModGeneralModule extends BxDolModule
      */
     public function serviceEntityAllActions ($iContentId = 0)
     {
-        return $this->_oTemplate->entryAllActions('', $this->serviceEntitySocialSharing($iContentId));
+        return $this->_oTemplate->entryAllActions($this->serviceEntityActions($iContentId), $this->serviceEntitySocialSharing($iContentId));
     }
 
     /**

+ 5 - 2
modules/base/general/classes/BxBaseModGeneralTemplate.php

@@ -201,16 +201,19 @@ class BxBaseModGeneralTemplate extends BxDolModuleTemplate
         return $this->entryAttachmentsByStorage($this->getModule()->_oConfig->CNF['OBJECT_STORAGE'], $aData, $aParams);
     }
 
-	function entryAttachmentsByStorage ($sStorage, $aData, $aParams = array())
+    function entryAttachmentsByStorage ($sStorage, $aData, $aParams = array())
     {
         if (!($a = $this->getAttachments($sStorage, $aData, $aParams)))
             return '';
 
+        $this->addCss(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'flickity/|flickity.css');
+    	$this->addJs('flickity/flickity.pkgd.min.js');
+
     	return $this->parseHtmlByName('attachments.html', array(
             'bx_repeat:attachments' => $a,
         ));
     }
-    
+
     protected function getUnitMetaItem($sName, $sContent, $aAttrs = array(), $sTemplate = 'unit_meta_item.html')
     {
         if(empty($sContent))

+ 11 - 7
modules/base/general/template/attachments.html

@@ -1,5 +1,4 @@
 <div class="bx-base-general-attachments bx-clearfix">
-
     <bx_repeat:attachments>
         <div class="bx-base-general-attachment bx-def-box bx-def-color-bg-box bx-def-gal-img-size" style="float:left;">
             <bx_if:image>
@@ -19,10 +18,15 @@
         </div>
     </bx_repeat:attachments>
 
-    <script>
-        $(document).ready(function() {
-            bx_center_content('.bx-base-general-attachments', '.bx-base-general-attachment', true);
-        });
+    <script type="text/javascript" language="javascript">
+        var oAttachments = $('.bx-base-general-attachments');
+        if(oAttachments.find('.bx-base-general-attachment').length > 2) {
+            oAttachments.flickity({
+		cellSelector: '.bx-base-general-attachment',
+		cellAlign: 'left',
+		pageDots: false,
+		imagesLoaded: true
+            });
+        }
     </script>
-
-</div>
+</div>

+ 17 - 0
modules/base/general/template/css/main.css

@@ -4,6 +4,23 @@
     margin-top:0;
 }
 
+.bx-base-general-entity-actions-all {
+    position: relative;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-align-items: center;
+    align-items: center;
+    -webkit-justify-content: flex-start;
+    justify-content: flex-start;
+}
+.bx-base-general-entity-actions-all > * {
+    margin-left: 16px;
+    margin-left: 1rem;
+}
+.bx-base-general-entity-actions-all > *:first-child {
+    margin-left: 0;
+}
+
 .bx-base-general-entity-share .bx-base-general-comments,
 .bx-base-general-entity-share .bx-view,
 .bx-base-general-entity-share .bx-vote,

+ 10 - 10
modules/boonex/forum/install/sql/enable.sql

@@ -48,18 +48,18 @@ INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designb
 
 -- PAGE: view entry
 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 
-('bx_forum_view_entry', 'view-discussion', '_bx_forum_page_title_sys_view_entry', '_bx_forum_page_title_view_entry', @sName, 10, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxForumPageEntry', 'modules/boonex/forum/classes/BxForumPageEntry.php');
+('bx_forum_view_entry', 'view-discussion', '_bx_forum_page_title_sys_view_entry', '_bx_forum_page_title_view_entry', @sName, 12, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxForumPageEntry', 'modules/boonex/forum/classes/BxForumPageEntry.php');
 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
-('bx_forum_view_entry', 1, @sName,'', '_bx_forum_page_block_title_entry_breadcrumb', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:17:"entity_breadcrumb";}', 0, 0, 1, 0),
-('bx_forum_view_entry', 2, @sName,'', '_bx_forum_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:13:"entity_author";}', 0, 0, 1, 0),
-('bx_forum_view_entry', 2, @sName, '_bx_forum_page_block_title_sys_entry_context', '_bx_forum_page_block_title_entry_context', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_forum\";s:6:\"method\";s:14:\"entity_context\";}', 0, 0, 1, 1),
-('bx_forum_view_entry', 3, @sName,'', '_bx_forum_page_block_title_entry_participants', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:19:"entity_participants";}', 0, 0, 1, 0),
-('bx_forum_view_entry', 3, @sName, '', '_bx_forum_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_forum\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 0, 1),
-('bx_forum_view_entry', 4, @sName,'', '_bx_forum_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:17:"entity_text_block";}', 0, 0, 1, 0),
-('bx_forum_view_entry', 4, @sName,'', '_bx_forum_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:18:"entity_all_actions";}', 0, 0, 1, 1),
-('bx_forum_view_entry', 4, @sName,'', '_bx_forum_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:18:"entity_attachments";}', 0, 0, 1, 2),
-('bx_forum_view_entry', 4, @sName,'', '_bx_forum_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:15:"entity_comments";}', 0, 0, 1, 3);
+('bx_forum_view_entry', 1, @sName,'', '_bx_forum_page_block_title_entry_breadcrumb', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:17:"entity_breadcrumb";}', 0, 0, 1, 1),
+('bx_forum_view_entry', 3, @sName,'', '_bx_forum_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:13:"entity_author";}', 0, 0, 1, 1),
+('bx_forum_view_entry', 3, @sName, '_bx_forum_page_block_title_sys_entry_context', '_bx_forum_page_block_title_entry_context', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_forum\";s:6:\"method\";s:14:\"entity_context\";}', 0, 0, 1, 2),
+('bx_forum_view_entry', 3, @sName,'', '_bx_forum_page_block_title_entry_participants', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:19:"entity_participants";}', 0, 0, 1, 3),
+('bx_forum_view_entry', 3, @sName, '', '_bx_forum_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_forum\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 0, 0),
+('bx_forum_view_entry', 2, @sName,'', '_bx_forum_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:17:"entity_text_block";}', 0, 0, 1, 1),
+('bx_forum_view_entry', 1, @sName,'', '_bx_forum_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:18:"entity_all_actions";}', 0, 0, 1, 2),
+('bx_forum_view_entry', 2, @sName,'', '_bx_forum_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:18:"entity_attachments";}', 0, 0, 1, 2),
+('bx_forum_view_entry', 2, @sName,'', '_bx_forum_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:15:"entity_comments";}', 0, 0, 1, 3);
 
 -- PAGE: new entries
 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 

+ 2 - 3
modules/boonex/forum/template/entry-text.html

@@ -1,5 +1,4 @@
-
 <div class="bx-base-text-entity-content bx-def-constraint-list bx-def-constraint-pre bx-def-constraint-object bx-def-constraint-iframe bx-def-constraint-img">
+    <h1>__entry_title__</h1>
     __text__
-</div>
-
+</div>