Quellcode durchsuchen

Ticket #562 - related changes.

AntonLV vor 9 Jahren
Ursprung
Commit
985a8a13dc

+ 1 - 1
inc/classes/BxDolFavorite.php

@@ -194,7 +194,7 @@ class BxDolFavorite extends BxDolObject
         $iAuthorId = $this->_getAuthorId();
 
         $bUndo = $this->isUndo();
-        $bPerformed = $this->_oQuery->isPerformed($iObjectId, $iAuthorId);
+        $bPerformed = $this->isPerformed($iObjectId, $iAuthorId);
         $bPerformUndo = $bPerformed && $bUndo ? true : false;
 
         if(!$bPerformUndo && !$this->isAllowedFavorite())

+ 5 - 0
inc/classes/BxDolObject.php

@@ -94,6 +94,11 @@ class BxDolObject extends BxDolFactory implements iBxDolReplaceable
         return $this->_aSystem && (int)$this->_aSystem['is_on'] == 1;
     }
 
+    public function isPerformed($iObjectId, $iAuthorId)
+    {
+        return $this->_oQuery->isPerformed($iObjectId, $iAuthorId);        
+    }
+
 	/**
 	 * Interface functions for outer usage
 	 */

+ 6 - 1
inc/classes/BxDolVote.php

@@ -216,7 +216,7 @@ class BxDolVote extends BxDolObject
         $bUndo = $this->isUndo();
         $bLikeMode = $this->isLikeMode();
 
-        $bVoted = $this->_oQuery->isPerformed($iObjectId, $iAuthorId);
+        $bVoted = $this->isPerformed($iObjectId, $iAuthorId);
         $bPerformUndo = $bVoted && $bUndo ? true : false;
 
         if(!$bPerformUndo && !$this->isAllowedVote(true)) {
@@ -307,6 +307,11 @@ class BxDolVote extends BxDolObject
     {
     	return $bVoted && $this->isUndo() ? '_vote_do_unlike' : '_vote_do_like';
     }
+
+    protected function _getTitleDoBy()
+    {
+    	return '_vote_do_by';
+    }
 }
 
 /** @} */

+ 0 - 1
modules/base/text/template/attachments.html

@@ -16,7 +16,6 @@
                     <div class="bx-def-round-corners bx-def-padding-sec">__file_name__</div>
                 </a>
             </bx_if:not_image>
-            </a>
         </div>
     </bx_repeat:attachments>
 

+ 1 - 1
modules/boonex/english/data/langs/system/en.xml

@@ -2392,7 +2392,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_vote_counter"><![CDATA[{0}]]></string>
 	<string name="_vote_do_like"><![CDATA[Thank you!]]></string>
 	<string name="_vote_do_unlike"><![CDATA[No thank you]]></string>
-	<string name="_vote_do_like_by"><![CDATA[Thanked by]]></string>
+	<string name="_vote_do_by"><![CDATA[Thanked by]]></string>
 	<string name="_vote_err_duplicate_vote"><![CDATA[Duplicate vote]]></string>
 	<string name="_week_fri"><![CDATA[Friday]]></string>
 	<string name="_week_mon"><![CDATA[Monday]]></string>

+ 1 - 1
modules/boonex/russian/data/langs/system/ru.xml

@@ -2390,7 +2390,7 @@
 	<string name="_vote_counter"><![CDATA[{0}]]></string>
 	<string name="_vote_do_like"><![CDATA[Спасибо!]]></string>
 	<string name="_vote_do_unlike"><![CDATA[Нет, спасибо]]></string>
-	<string name="_vote_do_like_by"><![CDATA[Поблагодарил]]></string>
+	<string name="_vote_do_by"><![CDATA[Поблагодарил]]></string>
 	<string name="_vote_err_duplicate_vote"><![CDATA[Повторный голос]]></string>
 	<string name="_week_fri"><![CDATA[Пятница]]></string>
 	<string name="_week_mon"><![CDATA[Понедельник]]></string>

+ 1 - 1
template/scripts/BxBaseFavorite.php

@@ -151,7 +151,7 @@ class BxBaseFavorite extends BxDolFavorite
         if(!$bAllowedFavorite && (!$this->isAllowedFavoriteView() || !$bCount))
             return '';
 
-        $aParams['is_favorited'] = $this->_oQuery->isPerformed($iObjectId, $iAuthorId) ? true : false;
+        $aParams['is_favorited'] = $this->isPerformed($iObjectId, $iAuthorId) ? true : false;
 
         $sTmplName = 'favorite_element_' . (!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_FAVORITE_USAGE_DEFAULT) . '.html';
         return $this->_oTemplate->parseHtmlByName($sTmplName, array(

+ 2 - 2
template/scripts/BxBaseReport.php

@@ -161,7 +161,7 @@ class BxBaseReport extends BxDolReport
         if(!$this->isAllowedReport() && (!$this->isAllowedReportView() || (int)$aReport['count'] == 0))
             return '';
 
-        $aParams['is_reported'] = $this->_oQuery->isPerformed($iObjectId, $iAuthorId) ? true : false;
+        $aParams['is_reported'] = $this->isPerformed($iObjectId, $iAuthorId) ? true : false;
 
         $sTmplName = 'report_element_' . (!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_REPORT_USAGE_DEFAULT) . '.html';
         return $this->_oTemplate->parseHtmlByName($sTmplName, array(
@@ -266,7 +266,7 @@ class BxBaseReport extends BxDolReport
         	if(!$this->isAllowedReport(true))
         		return array('code' => 2, 'msg' => $this->msgErrAllowedReport());
 
-	        $bPerformed = $this->_oQuery->isPerformed($iObjectId, $iAuthorId);
+	        $bPerformed = $this->isPerformed($iObjectId, $iAuthorId);
 	        if($bPerformed)
 	        	return array('code' => 4, 'msg' => _t('_report_err_duplicate_report'));
 

+ 3 - 3
template/scripts/BxBaseVote.php

@@ -134,7 +134,7 @@ class BxBaseVote extends BxDolVote
 
         return $this->_oTemplate->parseHtmlByName($this->_sTmplNameCounter, array(
             'href' => 'javascript:void(0)',
-            'title' => _t('_vote_do_like_by'),
+            'title' => _t($this->_getTitleDoBy()),
             'bx_repeat:attrs' => array(
                 array('key' => 'id', 'value' => $this->_aHtmlIds['counter']),
                 array('key' => 'class', 'value' => $sClass),
@@ -222,7 +222,7 @@ class BxBaseVote extends BxDolVote
         $bCount = (int)$aVote['count'] != 0;
 
         $isAllowedVote = $this->isAllowedVote();
-        $aParams['is_voted'] = $this->_oQuery->isPerformed($iObjectId, $iAuthorId) ? true : false;
+        $aParams['is_voted'] = $this->isPerformed($iObjectId, $iAuthorId) ? true : false;
 
         //--- Do Vote
         $bTmplVarsDoVote = $bShowDoVote && (!$this->_bLike || $bCount || $isAllowedVote);
@@ -344,7 +344,7 @@ class BxBaseVote extends BxDolVote
         return $this->_oTemplate->parseHtmlByName($this->_sTmplNameDoVoteLikes, array(
             'style_prefix' => $this->_sStylePrefix,
             'class' => $sClass,
-            'title' => _t($bVoted && $this->isUndo() ? '_vote_do_unlike' : '_vote_do_like'),
+            'title' => bx_html_attribute(_t($this->_getTitleDoLike($bVoted))),
         	'bx_if:show_onclick' => array(
         		'condition' => !$bDisabled,
         		'content' => array(