AntonLV 11 ani în urmă
părinte
comite
0842b516f4

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

@@ -542,7 +542,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         if(empty($sSystem) || (int)$iId == 0)
             return false;
 
-        $oCmts = BxDolCmts::getObjectInstance($sSystem, $iId);
+        $oCmts = BxDolCmts::getObjectInstance($sSystem, $iId, true, $this->_oTemplate);
         if(!$oCmts->isEnabled())
             return false;
 

+ 0 - 17
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -519,7 +519,6 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                 'content' => $aTmplVarsMenuItemActions
             ),
             'comments' => $bBrowseItem ? $this->_getComments($aEvent['comments']) : '',
-            'votes' => '' //$this->_getVotes($aEvent['votes'])
         );
 
         return $this->parseHtmlByName('item.html', $aTmplVars);
@@ -545,22 +544,6 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         return $this->getComments($sSystem, $iObjectId);
     }
 
-    protected function _getVotes($aVotes)
-    {
-        $oModule = $this->getModule();
-
-        $mixedVotes = $oModule->getVotesData($aVotes);
-        if($mixedVotes === false)
-            return '';
-
-        list($sSystem, $iObjectId, $iCount) = $mixedVotes;
-        $oVote = $oModule->getVoteObject($sSystem, $iObjectId);
-        if($oVote === false)
-            return '';
-
-        return $oVote->getJsScript();
-    }
-
     protected function _getImagePopup()
     {
         $sViewImagePopupId = $this->_oConfig->getHtmlIds('view', 'photo_popup');

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

@@ -31,7 +31,6 @@
 				<div class="__style_prefix__-activity bx-def-margin-top bx-clearfix">__menu_item_actions__</div>
 			</bx_if:show_menu_item_actions>
 			<div class="__style_prefix__-item-comments-holder">__comments__</div>
-			__votes__
 		</div>
 	</div>
 </div>

+ 5 - 2
template/scripts/BxBaseVote.php

@@ -89,14 +89,17 @@ class BxBaseVote extends BxDolVote
             'sStylePrefix' => $this->_sStylePrefix,
             'aHtmlIds' => $this->_aHtmlIds
         );
-        $sCode = "var " . $this->_sJsObjName . " = new BxDolVote(" . json_encode($aParams) . ");";
+        $sCode = $this->_sJsObjName . " = new BxDolVote(" . json_encode($aParams) . ");";
 
         if($bDynamicMode) {
-			$sCode = "$.getScript('" . bx_js_string($this->_oTemplate->getJsUrl('BxDolVote.js'), BX_ESCAPE_STR_APOS) . "', function(data, textStatus, jqxhr) {
+			$sCode = "var " . $this->_sJsObjName . " = null; 
+			$.getScript('" . bx_js_string($this->_oTemplate->getJsUrl('BxDolVote.js'), BX_ESCAPE_STR_APOS) . "', function(data, textStatus, jqxhr) {
 				bx_get_style('" . bx_js_string($this->_oTemplate->getCssUrl('vote.css'), BX_ESCAPE_STR_APOS) . "');
 				" . $sCode . "
         	}); ";
         }
+        else
+        	$sCode = "var " . $sCode;
 
         $this->addCssJs($bDynamicMode);
         return $this->_oTemplate->_wrapInTagJsCode($sCode);