Sfoglia il codice sorgente

Merge branch 'master' of github.com:boonex/dolphin

Alex Trofimov 12 anni fa
parent
commit
ddec0ca288

+ 1 - 1
modules/boonex/timeline/template/item.html

@@ -4,7 +4,7 @@
 	    	<div class="__style_prefix__-item-owner bx-def-margin-bottom"> 
 		       	<div class="__style_prefix__-owner-avatar bx-def-thumb bx-def-thumb-size">
 					<bx_if:show_icon>
-						<img src="__author_icon__" />
+						<img class="bx-def-thumb bx-def-thumb-size" src="__author_icon__" />
 					</bx_if:show_icon>
 					<bx_if:show_icon_empty>
 						<i class="sys-icon user"></i>

+ 1 - 1
template/comment.html

@@ -3,7 +3,7 @@
 		<a id="__system____id__" class="__style_prefix__-anchor bx-anchor-invisible">&nbsp;</a>
 		<div class="__style_prefix__-avatar bx-def-thumb bx-def-thumb-size">
 			<bx_if:show_icon>
-				<img src="__author_icon__" />
+				<img class="bx-def-thumb bx-def-thumb-size" src="__author_icon__" />
 			</bx_if:show_icon>
 			<bx_if:show_icon_empty>
 				<i class="sys-icon user"></i>

+ 4 - 1
template/comment_actions.html

@@ -1,6 +1,9 @@
 <div class="__style_prefix__-actions bx-def-margin-sec-top bx-clearfix">
 	<div class="__style_prefix__-ago bx-def-margin-right">
-		<a class="__style_prefix__-ago" href="__view_link__" rel="nofollow">__ago__</a>
+		<bx_if:show_ago_link>
+			<a class="__style_prefix__-ago" href="__view_link__" rel="nofollow">__ago__</a>
+		</bx_if:show_ago_link>
+		<bx_if:show_ago_text>__ago__</bx_if:show_ago_text>
 	</div>
 	__menu_actions__
 </div>

+ 20 - 6
template/scripts/BxBaseCmts.php

@@ -418,16 +418,30 @@ class BxBaseCmts extends BxDolCmts {
 			$sMenuManage = BxTemplFunctions::getInstance()->transBox($this->_sSystem . '-manage-' . $aCmt['cmt_id'], $sMenuManage, true);
 		}
 
+		$sAgo = bx_time_js($aCmt['cmt_time']);
+		$bObjectTitle = !empty($this->_aSystem['trigger_field_title']);
         return $oTemplate->parseHtmlByName('comment_actions.html', array(
         	'id' => $aCmt['cmt_id'],
         	'js_object' => $this->_sJsObjName,
         	'style_prefix' => $this->_sStylePrefix,
-        	'view_link' => bx_append_url_params($this->_sViewUrl, array(
-        		'sys' => $this->_sSystem,
-        		'id' => $this->_iId,
-        		'cmt_id' => $aCmt['cmt_id']
-        	)),
-        	'ago' => bx_time_js($aCmt['cmt_time']),
+        	'bx_if:show_ago_link' => array(
+        		'condition' => $bObjectTitle,
+        		'content' => array(
+        			'style_prefix' => $this->_sStylePrefix,
+        			'view_link' => bx_append_url_params($this->_sViewUrl, array(
+		        		'sys' => $this->_sSystem,
+		        		'id' => $this->_iId,
+		        		'cmt_id' => $aCmt['cmt_id']
+		        	)),
+		        	'ago' => $sAgo
+        		)
+        	),
+        	'bx_if:show_ago_text' => array(
+        		'condition' => !$bObjectTitle,
+        		'content' => array(
+        			'ago' => $sAgo
+        		)
+        	),
         	'menu_actions' => $sMenuActions,
 /*
         	'bx_if:hide_rate_count' => array(

+ 3 - 1
template/scripts/BxBaseCmtsMenu.php

@@ -36,12 +36,14 @@ class BxBaseCmtsMenu extends BxTemplMenu
 		if($oVote !== false)
 			$sVotesOnclick = $oVote->getJsClick();
 
+		$sJsObject = $oCmts->getJsObjectName();
 		$this->addMarkers(array(
+			'js_object' => $sJsObject,
 			'cmt_system' => $this->_oCmts->getSystemName(),
 			'cmt_id' => $this->_oCmts->getId(),
 			'content_id' => $iCmtId,
 			'vote_onclick' => $sVotesOnclick,
-			'rate_onclick' => $oCmts->getJsObjectName() . '.toggleReply(this, ' . $iCmtId . ')',
+			'reply_onclick' => $sJsObject . '.toggleReply(this, ' . $iCmtId . ')'
     	));
     }
 

+ 40 - 0
tests/units/inc/UtilTest.php

@@ -62,4 +62,44 @@ class UtilTest extends PHPUnit_Framework_TestCase
             array('1g', 1073741824),
         );
     }
+
+    /**
+     * @see title2uri
+     * @dataProvider providerForTitleToUri
+     */
+    function testTitleToUri($sIn, $sOut)
+    {
+    	$this->assertEquals(title2uri($sIn), $sOut);
+    }
+	public function providerForTitleToUri()
+    {
+        return array(
+            array('test', 'test'),
+            array('test & test', 'test [and] test'),
+            array('test + test', 'test [plus] test'),
+            array('"test"', '[quote]test[quote]'),
+            array('/test/', '[slash]test[slash]'),
+            array('\\test\\', '[backslash]test[backslash]'),
+        );
+    }
+
+	/**
+     * @see uri2title
+     * @dataProvider providerForUriToTitle
+     */
+    function testUriToTitle($sIn, $sOut)
+    {
+    	$this->assertEquals(uri2title($sIn), $sOut);
+    }
+	public function providerForUriToTitle()
+    {
+        return array(
+            array('test', 'test'),
+            array('test [and] test', 'test & test'),
+            array('test [plus] test', 'test + test'),
+            array('[quote]test[quote]', '"test"'),
+            array('[slash]test[slash]', '/test/'),
+            array('[backslash]test[backslash]', '\\test\\'),
+        );
+    }
 }