AntonLV 7 years ago
parent
commit
bfbe7b4d88

+ 28 - 11
modules/boonex/forum/classes/BxForumCmts.php

@@ -77,22 +77,39 @@ class BxForumCmts extends BxTemplCmts
 
     public function getComment($mixedCmt, $aBp = array(), $aDp = array())
     {
-    	return parent::getComment($mixedCmt, $aBp, array_merge($aDp, array(
-    		'class_comment' => ' bx-def-box bx-def-padding bx-def-round-corners bx-def-color-bg-box'
-    	)));
+        return parent::getComment($mixedCmt, $aBp, array_merge($aDp, array(
+            'class_comment' => 'bx-def-box bx-def-padding bx-def-round-corners bx-def-color-bg-box'
+        )));
     }
 
-	protected function _getFormObject($sAction = BX_CMT_ACTION_POST)
+    protected function _getEmpty($aDp = array())
     {
-    	$CNF = &$this->_oModule->_oConfig->CNF;
+        return parent::_getEmpty(array_merge($aDp, array(
+            'class' => 'bx-def-box bx-def-padding bx-def-round-corners bx-def-color-bg-box'
+        )));
+    }
+
+    protected function _getFormBox($sType, $aBp, $aDp)
+    {
+        if(!isset($aBp['parent_id']) || (int)$aBp['parent_id'] == 0)
+            $aDp = array_merge($aDp, array(
+                'class' => 'bx-def-box bx-def-padding bx-def-round-corners bx-def-color-bg-box'
+            ));
+
+        return parent::_getFormBox($sType, $aBp, $aDp);
+    }
+
+    protected function _getFormObject($sAction = BX_CMT_ACTION_POST)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
 
-    	$oResult = parent::_getFormObject($sAction);
-    	if(!isset($oResult->aInputs['cmt_image']))
-    		return $oResult;
+        $oResult = parent::_getFormObject($sAction);
+        if(!isset($oResult->aInputs['cmt_image']))
+            return $oResult;
 
-		$oResult->aInputs['cmt_image']['storage_object'] = $CNF['OBJECT_STORAGE_CMTS']; 
-		$oResult->aInputs['cmt_image']['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_CMTS'];
-		$oResult->aInputs['cmt_image']['upload_buttons_titles'] = array('Simple' => 'paperclip');
+        $oResult->aInputs['cmt_image']['storage_object'] = $CNF['OBJECT_STORAGE_CMTS']; 
+        $oResult->aInputs['cmt_image']['images_transcoder'] = $CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW_CMTS'];
+        $oResult->aInputs['cmt_image']['upload_buttons_titles'] = array('Simple' => 'paperclip');
 
         return $oResult;
     }

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

@@ -58,7 +58,7 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('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);
+('bx_forum_view_entry', 2, @sName,'', '_bx_forum_page_block_title_entry_comments', 0, 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 

+ 1 - 1
template/comment_empty.html

@@ -1 +1 @@
-<li class="__style_prefix__-no bx-def-padding-top bx-def-margin-bottom">__content__</li>
+<li class="__style_prefix__-no__class__ bx-def-padding-top bx-def-margin-bottom">__content__</li>

+ 2 - 2
template/comment_reply_box.html

@@ -2,12 +2,12 @@
     <div class="__style_prefix__-cont __style_prefix__-post-reply">
         <div class="__style_prefix__-cont-cnt">
             <bx_if:show_form_min>
-                <div class="__style_prefix__-body-min">
+                <div class="__style_prefix__-body-min__class_body_min__">
                     <div class="__style_prefix__-bm-user">__author_unit__</div>
                     <div class="__style_prefix__-bm-content bx-def-thumb-size-min-height bx-def-thumb-size-left-indent bx-def-font-grayed">__placeholder__</div>
                 </div>
             </bx_if:show_form_min>
-            <div class="__style_prefix__-body">__form__</div>
+            <div class="__style_prefix__-body__class_body__">__form__</div>
         </div>
     </div>
 </div>

+ 26 - 9
template/scripts/BxBaseCmts.php

@@ -160,7 +160,7 @@ class BxBaseCmts extends BxDolCmts
         		return MsgBox(_t('_cmt_msg_login_required', $oPermalink->permalink('page.php?i=login'), $oPermalink->permalink('page.php?i=create-account')));
         	}
 
-            return isset($aDp['show_empty']) && $aDp['show_empty'] === true ? $this->_getEmpty() : '';
+            return isset($aDp['show_empty']) && $aDp['show_empty'] === true ? $this->_getEmpty($aDp) : '';
         }
 
         $sCmts = '';
@@ -230,15 +230,15 @@ class BxBaseCmts extends BxDolCmts
         if($aCmt['cmt_author_id'] == $iUserId)
             $sClass .= ' ' . $this->_sStylePrefix . '-mine';
 
-		if(!empty($aDp['blink']) && in_array($aCmt['cmt_id'], $aDp['blink']))
-			$sClass .= ' ' . $this->_sStylePrefix . '-blink';
+        if(!empty($aDp['blink']) && in_array($aCmt['cmt_id'], $aDp['blink']))
+            $sClass .= ' ' . $this->_sStylePrefix . '-blink';
 
-		if(!empty($aDp['class_comment']))
-			$sClass .= ' ' . $aDp['class_comment'];
+        if(!empty($aDp['class_comment']))
+            $sClass .= ' ' . $aDp['class_comment'];
+
+        if(!empty($aDp['class_comment_content']))
+            $sClassCnt .= ' ' . $aDp['class_comment_content'];
 
-		if(!empty($aDp['class_comment_content']))
-			$sClassCnt .= ' ' . $aDp['class_comment_content'];
-			
         $sActions = $this->_getActionsBox($aCmt, $aDp);
 
         $aTmplReplyTo = array();
@@ -735,6 +735,12 @@ class BxBaseCmts extends BxDolCmts
             $sClass .= ' ' . $this->_sStylePrefix . '-reply-' . $sPosition;
         if($bFormMin)
             $sClass .= ' ' . $this->_sStylePrefix . '-reply-min';
+        if(!empty($aDp['class']))
+            $sClass .= ' ' . $aDp['class'];
+
+        $sClassBody = '';
+        if(!empty($aDp['class_body']))
+            $sClassBody .= ' ' . $aDp['class_body'];
 
         $aTmplVarsFormMin = array();
         if($bFormMin) {
@@ -752,8 +758,13 @@ class BxBaseCmts extends BxDolCmts
                 'value' => '',
             );
 
+            $sClassBodyMin = '';
+            if(!empty($aDp['class_body_min']))
+                $sClassBodyMin .= ' ' . $aDp['class_body_min'];
+
             $aTmplVarsFormMin = array(
                 'js_object' => $this->_sJsObjName,
+                'class_body_min' => $sClassBodyMin,
                 'style_prefix' => $this->_sStylePrefix,
                 'author_unit' => $sAuthorUnit,
                 'placeholder' => $oForm->genRow($aInputPlaceholder)
@@ -767,6 +778,7 @@ class BxBaseCmts extends BxDolCmts
             'js_object' => $this->_sJsObjName,
             'style_prefix' => $this->_sStylePrefix,
             'class' => $sClass,
+            'class_body' => $sClassBody,
             'bx_if:show_form_min' => array(
                 'condition' => $bFormMin,
                 'content' => $aTmplVarsFormMin
@@ -962,10 +974,15 @@ class BxBaseCmts extends BxDolCmts
         return $sCmts;
     }
 
-    protected function _getEmpty()
+    protected function _getEmpty($aDp = array())
     {
+        $sClass = '';
+        if(!empty($aDp['class']))
+            $sClass .= ' ' . $aDp['class'];
+
         return $this->_oTemplate->parseHtmlByName('comment_empty.html', array(
             'style_prefix' => $this->_sStylePrefix,
+            'class' => $sClass,
             'content' => MsgBox(_t('_Empty'))
         ));
     }