Browse Source

#1 - Comments.

AntonLV 13 years ago
parent
commit
81a5e02e0c
3 changed files with 10 additions and 12 deletions
  1. 3 0
      template/comment_empty.html
  2. 0 5
      template/comments_block.html
  3. 7 7
      template/scripts/BxBaseCmtsView.php

+ 3 - 0
template/comment_empty.html

@@ -0,0 +1,3 @@
+<li class="__style_prefix__-no">
+	<bx_text:_There_are_no_comments_yet />
+</li>

+ 0 - 5
template/comments_block.html

@@ -3,11 +3,6 @@
 	<div id="cmt0" class="cmts">
 		<a class="bx-anchor-invisible" name="__list_anchor__"></a>
 		<ul class="cmts">
-			<bx_if:show_empty>
-				<li class="__style_prefix__-no">
-					<bx_text:_There_are_no_comments_yet />
-				</li>
-			</bx_if:show_empty>
 			__comments__
 		</ul>
 	</div>

+ 7 - 7
template/scripts/BxBaseCmtsView.php

@@ -78,12 +78,6 @@ class BxBaseCmtsView extends BxDolCmts {
     		'system' => $this->_sSystem,
     		'list_anchor' => $this->getListAnchor(),
     		'id' => $this->getId(),
-    		'bx_if:show_empty' => array(
-				'condition' => $sCmts == '',
-				'content' => array(
-					'style_prefix' => $this->_sStylePrefix
-				)
-			),
     		'comments' => $sCmts,
     		'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)),
@@ -111,7 +105,7 @@ class BxBaseCmtsView extends BxDolCmts {
 
 		$aCmts = $this->getCommentsArray($aBp['vparent_id'], $aBp['filter'], $aBp['order'], $aBp['start'], $aBp['per_view']);
 		if(empty($aCmts) || !is_array($aCmts))
-			return '';
+			return $this->_getEmpty();
 
 		$sCmts = '';
 		foreach($aCmts as $k => $aCmt)
@@ -774,6 +768,12 @@ class BxBaseCmtsView extends BxDolCmts {
     	return $sCmts;
     }
 
+    protected function _getEmpty()
+    {
+    	return BxDolTemplate::getInstance()->parseHtmlByName('comment_empty.html', array(
+    		'style_prefix' => $this->_sStylePrefix
+    	));
+    } 
 	protected function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false) {
 
         header('Content-type: text/html; charset=utf-8');