AntonLV 9 سال پیش
والد
کامیت
f182a6eeb7

+ 4 - 4
inc/classes/BxDolCmts.php

@@ -712,7 +712,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
         $sCmtBrowse = isset($_REQUEST['CmtBrowse']) ? bx_process_input($_REQUEST['CmtBrowse'], BX_DATA_TEXT) : '';
         $sCmtDisplay = isset($_REQUEST['CmtDisplay']) ? bx_process_input($_REQUEST['CmtDisplay'], BX_DATA_TEXT) : '';
 
-        return $this->getFormBoxPost(array('parent_id' => $iCmtParentId, 'type' => $sCmtBrowse), array('type' => $sCmtDisplay));
+        return $this->getFormBoxPost(array('parent_id' => $iCmtParentId, 'type' => $sCmtBrowse), array('type' => $sCmtDisplay, 'dynamic_mode' => true));
     }
 
     public function actionGetFormEdit ()
@@ -723,7 +723,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
         }
 
         $iCmtId = bx_process_input(bx_get('Cmt'), BX_DATA_INT);
-        echoJson($this->getFormEdit($iCmtId));
+        echoJson($this->getFormEdit($iCmtId, array('dynamic_mode' => true)));
     }
 
     public function actionGetCmt ()
@@ -774,7 +774,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
         if(bx_get('cmt_parent_id') !== false)
             $iCmtParentId = bx_process_input(bx_get('cmt_parent_id'), BX_DATA_INT);
 
-        echoJson($this->getFormPost($iCmtParentId));
+        echoJson($this->getFormPost($iCmtParentId, array('dynamic_mode' => true)));
     }
 
     public function actionSubmitEditForm()
@@ -788,7 +788,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
         if(bx_get('cmt_id') !== false)
             $iCmtId = bx_process_input(bx_get('cmt_id'), BX_DATA_INT);
 
-        echoJson($this->getFormEdit($iCmtId));
+        echoJson($this->getFormEdit($iCmtId, array('dynamic_mode' => true)));
     }
 
     public function actionRemove()

+ 2 - 2
modules/boonex/convos/classes/BxCnvCmts.php

@@ -60,9 +60,9 @@ class BxCnvCmts extends BxTemplCmts
         return $oForm;
     }
 
-    function getCommentsBlock($iParentId = 0, $iVParentId = 0, $bInDesignbox = true)
+    function getCommentsBlock($iParentId = 0, $iVParentId = 0, $bInDesignbox = true, $bDynamic = false)
     {
-        $mixedBlock = parent::getCommentsBlock($iParentId, $iVParentId, $bInDesignbox);
+        $mixedBlock = parent::getCommentsBlock($iParentId, $iVParentId, $bInDesignbox, $bDynamic);
         if (is_array($mixedBlock) && isset($mixedBlock['title']))
             $mixedBlock['title'] = _t('_bx_cnv_page_block_title_entry_comments', $this->getCommentsCount());
         return $mixedBlock;

+ 2 - 2
modules/boonex/forum/classes/BxForumCmts.php

@@ -44,9 +44,9 @@ class BxForumCmts extends BxTemplCmts
             BxDolConnection::getObjectInstance($CNF['OBJECT_CONNECTION_SUBSCRIBERS'])->actionAdd((int)$this->getId(), (int)$this->_getAuthorId());
     }
 
-    public function getCommentsBlock($iParentId = 0, $iVParentId = 0, $bInDesignbox = true)
+    public function getCommentsBlock($iParentId = 0, $iVParentId = 0, $bInDesignbox = true, $bDynamic = false)
     {
-        $mixedBlock = parent::getCommentsBlock($iParentId, $iVParentId, $bInDesignbox);
+        $mixedBlock = parent::getCommentsBlock($iParentId, $iVParentId, $bInDesignbox, $bDynamic);
         if (is_array($mixedBlock) && isset($mixedBlock['title']))
             $mixedBlock['title'] = _t('_bx_forum_page_block_title_entry_comments', $this->getCommentsCount());
         return $mixedBlock;

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -234,7 +234,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
 
         $sSystem = bx_process_input(bx_get('system'), BX_DATA_TEXT);
         $iId = bx_process_input(bx_get('id'), BX_DATA_INT);
-        $sComments = $this->_oTemplate->getComments($sSystem, $iId);
+        $sComments = $this->_oTemplate->getComments($sSystem, $iId, true);
 
         echoJson(array('content' => $sComments));
     }

+ 2 - 2
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -359,7 +359,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         return $this->parseHtmlByName('load_more.html', $aTmplVars);
     }
 
-    public function getComments($sSystem, $iId)
+    public function getComments($sSystem, $iId, $bDynamic = false)
     {
         $oModule = $this->getModule();
         $sStylePrefix = $this->_oConfig->getPrefix('style');
@@ -368,7 +368,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if($oCmts === false)
             return '';
 
-        $aComments = $oCmts->getCommentsBlock(0, 0, false);
+        $aComments = $oCmts->getCommentsBlock(0, 0, false, $bDynamic);
         return $this->parseHtmlByName('comments.html', array(
             'style_prefix' => $sStylePrefix,
             'id' => $iId,

+ 3 - 0
modules/boonex/timeline/template/css/view.css

@@ -269,6 +269,9 @@ div.bx-tl-empty div.bx-msg-box-container {
 
 
 /*--- Comments Styles ---*/
+div.bx-tl-item-comments-holder .cmt.bx-def-box {
+	border-width: 0px;
+}
 div.bx-tl-item-comments-holder .bx-def-thumb-size {
 	width: 32px;
 	width: 2rem;

+ 17 - 12
template/scripts/BxBaseCmts.php

@@ -70,13 +70,14 @@ class BxBaseCmts extends BxDolCmts
     /**
      * get full comments block with initializations
      */
-    function getCommentsBlock($iParentId = 0, $iVParentId = 0, $bInDesignbox = true)
+    function getCommentsBlock($iParentId = 0, $iVParentId = 0, $bInDesignbox = true, $bDynamic = false)
     {
     	$aBp = $aDp = array();
 		$this->_getParams($aBp, $aDp);
 
         $aBp['parent_id'] = $iParentId;
         $aBp['vparent_id'] = $iVParentId;
+        $aDp['dynamic_mode'] = $bDynamic;
         $aDp['show_empty'] = false;
 
 		//add live update
@@ -92,8 +93,8 @@ class BxBaseCmts extends BxDolCmts
             'list_anchor' => $this->getListAnchor(),
             'id' => $this->getId(),
             'comments' => $this->getComments($aBp, $aDp),
-            'post_form_top' => $this->getFormBoxPost($aBp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_TOP)),
-            'post_form_bottom'  => $this->getFormBoxPost($aBp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_BOTTOM)),
+            'post_form_top' => $this->getFormBoxPost($aBp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_TOP, 'dynamic_mode' => $bDynamic)),
+            'post_form_bottom'  => $this->getFormBoxPost($aBp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_BOTTOM, 'dynamic_mode' => $bDynamic)),
         	'view_image_popup' => $this->_getViewImagePopup(),
             'script' => $this->getJsScript()
         ));
@@ -314,14 +315,14 @@ class BxBaseCmts extends BxDolCmts
         return $this->_getFormBox(BX_CMT_ACTION_EDIT, $aBp, $aDp);
     }
 
-    function getFormPost($iCmtParentId = 0)
+    function getFormPost($iCmtParentId = 0, $aDp = array())
     {
-        return $this->_getFormPost($iCmtParentId);
+        return $this->_getFormPost($iCmtParentId, $aDp);
     }
 
-    function getFormEdit($aCmt)
+    function getFormEdit($iCmtId, $aDp = array())
     {
-        return $this->_getFormEdit($aCmt);
+        return $this->_getFormEdit($iCmtId, $aDp);
     }
 
     function getNotification($iCountOld = 0, $iCountNew = 0)
@@ -507,7 +508,7 @@ class BxBaseCmts extends BxDolCmts
             return '';
 
         $sMethod = '_getForm' . ucfirst($sType);
-        $aForm = $this->$sMethod($iCmtParentId);
+        $aForm = $this->$sMethod($iCmtParentId, $aDp);
 
         return BxDolTemplate::getInstance()->parseHtmlByName('comment_reply_box.html', array(
             'js_object' => $this->_sJsObjName,
@@ -523,8 +524,10 @@ class BxBaseCmts extends BxDolCmts
         ));
     }
 
-    protected function _getFormPost($iCmtParentId = 0)
+    protected function _getFormPost($iCmtParentId = 0, $aDp = array())
     {
+        $bDynamic = isset($aDp['dynamic_mode']) && (bool)$aDp['dynamic_mode'];
+
         $oForm = $this->_getForm(BX_CMT_ACTION_POST, $iCmtParentId);
         $oForm->aInputs['cmt_parent_id']['value'] = $iCmtParentId;
         $oForm->initChecker();
@@ -581,11 +584,13 @@ class BxBaseCmts extends BxDolCmts
             return array('msg' => _t('_cmt_err_cannot_perform_action'));
         }
 
-        return array('form' => $oForm->getCode(), 'form_id' => $oForm->id);
+        return array('form' => $oForm->getCode($bDynamic), 'form_id' => $oForm->id);
     }
 
-    protected function _getFormEdit($iCmtId)
+    protected function _getFormEdit($iCmtId, $aDp = array())
     {
+        $bDynamic = isset($aDp['dynamic_mode']) && (bool)$aDp['dynamic_mode'];
+
         $aCmt = $this->_oQuery->getCommentSimple ((int)$this->getId(), $iCmtId);
         if(!$aCmt)
             return array('msg' => _t('_No such comment'));
@@ -620,7 +625,7 @@ class BxBaseCmts extends BxDolCmts
             return array('msg' => _t('_cmt_err_cannot_perform_action'));
         }
 
-        return array('form' => $oForm->getCode(), 'form_id' => $oForm->id);
+        return array('form' => $oForm->getCode($bDynamic), 'form_id' => $oForm->id);
     }
 
     protected function _getForm($sAction, $iId)