Просмотр исходного кода

Ticket #2430 - Including refactoring for objects like Views, Votes, Reports, etc.

AntonLV 7 лет назад
Родитель
Сommit
1b4fbb18ef
89 измененных файлов с 1369 добавлено и 579 удалено
  1. 1 1
      inc/classes/BxDolCmtsQuery.php
  2. 5 4
      inc/classes/BxDolFavorite.php
  3. 4 3
      inc/classes/BxDolFeature.php
  4. 5 0
      inc/classes/BxDolModuleProxy.php
  5. 41 4
      inc/classes/BxDolObject.php
  6. 12 11
      inc/classes/BxDolReport.php
  7. 10 5
      inc/classes/BxDolScore.php
  8. 4 3
      inc/classes/BxDolView.php
  9. 5 4
      inc/classes/BxDolVote.php
  10. 37 7
      inc/classes/BxDolVoteReactions.php
  11. 14 4
      inc/classes/BxDolVoteReactionsQuery.php
  12. 1 1
      inc/js/classes/BxDolFavorite.js
  13. 1 1
      inc/js/classes/BxDolFeature.js
  14. 1 1
      inc/js/classes/BxDolReport.js
  15. 35 35
      inc/js/classes/BxDolScore.js
  16. 1 1
      inc/js/classes/BxDolVoteLikes.js
  17. 17 4
      inc/js/classes/BxDolVoteReactions.js
  18. 1 1
      modules/base/text/classes/BxBaseModTextVotePollAnswers.php
  19. 6 3
      modules/boonex/decorous/data/template/system/css/menu.less
  20. 3 1
      modules/boonex/english/data/langs/system/en.xml
  21. 2 2
      modules/boonex/forum/template/css/main.css
  22. 1 1
      modules/boonex/market/classes/BxMarketVoteStars.php
  23. 1 1
      modules/boonex/polls/classes/BxPollsVoteSubentries.php
  24. 0 8
      modules/boonex/protean/data/template/bx_timeline/css/view.less
  25. 6 3
      modules/boonex/protean/data/template/system/css/menu.less
  26. 4 2
      modules/boonex/russian/data/langs/bx_timeline/ru.xml
  27. 3 1
      modules/boonex/russian/data/langs/system/ru.xml
  28. 1 1
      modules/boonex/shopify/install/sql/install.sql
  29. 1 0
      modules/boonex/timeline/classes/BxTimelineConfig.php
  30. 94 16
      modules/boonex/timeline/classes/BxTimelineMenuItemActions.php
  31. 52 0
      modules/boonex/timeline/classes/BxTimelineMenuItemCounters.php
  32. 2 0
      modules/boonex/timeline/classes/BxTimelineMenuItemManage.php
  33. 1 0
      modules/boonex/timeline/classes/BxTimelineModule.php
  34. 68 27
      modules/boonex/timeline/classes/BxTimelineTemplate.php
  35. 4 2
      modules/boonex/timeline/install/langs/en.xml
  36. 1 1
      modules/boonex/timeline/install/sql/disable.sql
  37. 15 1
      modules/boonex/timeline/install/sql/enable.sql
  38. 21 6
      modules/boonex/timeline/template/css/view.css
  39. 4 3
      modules/boonex/timeline/template/item_outline.html
  40. 4 3
      modules/boonex/timeline/template/item_timeline.html
  41. 4 0
      modules/boonex/timeline/template/menu_custom_item_hor.html
  42. 1 1
      modules/boonex/timeline/template/repost_do_repost_label.html
  43. 3 3
      modules/boonex/timeline/template/repost_element_block.html
  44. 1 1
      template/comment_counter.html
  45. 77 12
      template/css/cmts.css
  46. 7 16
      template/css/menu.css
  47. 26 0
      template/css/score.css
  48. 23 0
      template/css/view.css
  49. 186 12
      template/css/vote.css
  50. 1 1
      template/favorite_do_favorite_label.html
  51. 3 3
      template/favorite_element_block.html
  52. 2 2
      template/favorite_element_inline.html
  53. 1 1
      template/feature_do_feature_label.html
  54. 2 2
      template/feature_element_block.html
  55. 2 2
      template/feature_element_inline.html
  56. 1 1
      template/report_do_report_label.html
  57. 6 6
      template/report_element_block.html
  58. 2 2
      template/report_element_inline.html
  59. 2 6
      template/score_counter.html
  60. 1 0
      template/score_counter_label.html
  61. 1 1
      template/score_do_vote_label.html
  62. 10 10
      template/score_element_block.html
  63. 2 2
      template/score_element_inline.html
  64. 27 2
      template/scripts/BxBaseCmts.php
  65. 14 23
      template/scripts/BxBaseFavorite.php
  66. 11 20
      template/scripts/BxBaseFeature.php
  67. 53 63
      template/scripts/BxBaseReport.php
  68. 41 28
      template/scripts/BxBaseScore.php
  69. 88 71
      template/scripts/BxBaseView.php
  70. 21 38
      template/scripts/BxBaseVote.php
  71. 30 11
      template/scripts/BxBaseVoteLikes.php
  72. 173 31
      template/scripts/BxBaseVoteReactions.php
  73. 2 1
      template/scripts/BxBaseVoteStars.php
  74. 2 6
      template/view_counter.html
  75. 1 0
      template/view_counter_label.html
  76. 1 1
      template/view_do_view_label.html
  77. 4 4
      template/view_element_block.html
  78. 2 2
      template/view_element_inline.html
  79. 8 8
      template/vote_by_list.html
  80. 14 0
      template/vote_by_list_reactions.html
  81. 11 0
      template/vote_by_summary_reactions.html
  82. 2 6
      template/vote_counter.html
  83. 1 0
      template/vote_counter_label_likes.html
  84. 1 1
      template/vote_counter_label_reactions.html
  85. 1 1
      template/vote_counter_wrapper_reactions.html
  86. 1 0
      template/vote_do_vote_label_likes.html
  87. 1 0
      template/vote_do_vote_label_reactions.html
  88. 4 4
      template/vote_element_block.html
  89. 2 2
      template/vote_element_inline.html

+ 1 - 1
inc/classes/BxDolCmtsQuery.php

@@ -221,7 +221,7 @@ class BxDolCmtsQuery extends BxDolDb
 
                 $sWhereClause .= " AND `{$this->_sTable}`.`cmt_object_id` = :cmt_object_id";
 
-                $sOrderClause = "`{$this->_sTable}`.`cmt_time` ASC";
+                $sOrderClause = "`{$this->_sTable}`.`cmt_time` " . (!empty($aParams['order_way']) ? strtoupper($aParams['order_way']) : "ASC");
                 $sLimitClause = "";
                 if(isset($aParams['per_page']))
                     $sLimitClause = $this->prepareAsString("?, ?", $aParams['start'], $aParams['per_page']);

+ 5 - 4
inc/classes/BxDolFavorite.php

@@ -70,8 +70,9 @@ class BxDolFavorite extends BxDolObject
      */
     public static function getObjectInstance($sSys, $iId, $iInit = true)
     {
-        if(isset($GLOBALS['bxDolClasses']['BxDolFavorite!' . $sSys . $iId]))
-            return $GLOBALS['bxDolClasses']['BxDolFavorite!' . $sSys . $iId];
+        $sKey = 'BxDolFavorite!' . $sSys . $iId;
+        if(isset($GLOBALS['bxDolClasses'][$sKey]))
+            return $GLOBALS['bxDolClasses'][$sKey];
 
         $aSystems = self::getSystems();
         if(!isset($aSystems[$sSys]))
@@ -85,7 +86,7 @@ class BxDolFavorite extends BxDolObject
         }
 
         $o = new $sClassName($sSys, $iId, $iInit);
-        return ($GLOBALS['bxDolClasses']['BxDolFavorite!' . $sSys . $iId] = $o);
+        return ($GLOBALS['bxDolClasses'][$sKey] = $o);
     }
 
     public static function &getSystems()
@@ -224,7 +225,7 @@ class BxDolFavorite extends BxDolObject
         	'eval' => $this->getJsObjectName() . '.onFavorite(oData, oElement)',
         	'code' => 0, 
         	'count' => $aFavorite['count'],
-        	'countf' => (int)$aFavorite['count'] > 0 ? $this->_getLabelCounter($aFavorite['count']) : '',
+        	'countf' => (int)$aFavorite['count'] > 0 ? $this->_getCounterLabel($aFavorite['count']) : '',
             'label_icon' => $this->_getIconDoFavorite(!$bPerformed),
             'label_title' => _t($this->_getTitleDoFavorite(!$bPerformed)),
             'disabled' => !$bPerformed && !$bUndo

+ 4 - 3
inc/classes/BxDolFeature.php

@@ -60,8 +60,9 @@ class BxDolFeature extends BxDolObject
      */
     public static function getObjectInstance($sSys, $iId, $iInit = true)
     {
-        if(isset($GLOBALS['bxDolClasses']['BxDolFeature!' . $sSys . $iId]))
-            return $GLOBALS['bxDolClasses']['BxDolFeature!' . $sSys . $iId];
+        $sKey = 'BxDolFeature!' . $sSys . $iId;
+        if(isset($GLOBALS['bxDolClasses'][$sKey]))
+            return $GLOBALS['bxDolClasses'][$sKey];
 
         $aSystems = self::getSystems();
         if(!isset($aSystems[$sSys]))
@@ -75,7 +76,7 @@ class BxDolFeature extends BxDolObject
         }
 
         $o = new $sClassName($sSys, $iId, $iInit);
-        return ($GLOBALS['bxDolClasses']['BxDolFeature!' . $sSys . $iId] = $o);
+        return ($GLOBALS['bxDolClasses'][$sKey] = $o);
     }
 
     public static function &getSystems()

+ 5 - 0
inc/classes/BxDolModuleProxy.php

@@ -54,6 +54,11 @@ class BxDolModuleProxy
         }
     }
 
+    public function getClassName()
+    {
+        return get_class($this->_oProxifiedObject);
+    }
+
     public function isMethodExists($s)
     {
         return method_exists($this->_oProxifiedObject, $s);

+ 41 - 4
inc/classes/BxDolObject.php

@@ -14,7 +14,7 @@
 class BxDolObject extends BxDolFactory implements iBxDolReplaceable
 {
     protected $_oTemplate = null;
-	protected $_oQuery = null;
+    protected $_oQuery = null;
 
     protected $_iId = 0; ///< item id the action to be performed with
     protected $_sSystem = ''; ///< current system name
@@ -22,6 +22,13 @@ class BxDolObject extends BxDolFactory implements iBxDolReplaceable
 
     protected $_aMarkers = array ();
 
+    protected $_sTmplContentElementBlock = '';
+    protected $_sTmplContentElementInline = '';
+    protected $_sTmplContentDoAction;
+    protected $_sTmplContentDoActionLabel = '';
+    protected $_sTmplContentCounter = '';
+    protected $_sTmplContentCounterLabel = '';
+
     protected function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
     {
         parent::__construct();
@@ -207,15 +214,15 @@ class BxDolObject extends BxDolFactory implements iBxDolReplaceable
         return $a[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED ? $a[CHECK_ACTION_MESSAGE] : '';
     }
 
-	/**
+    /**
      * Actions' response functions
      */
-	public function onObjectDelete($iObjectId = 0)
+    public function onObjectDelete($iObjectId = 0)
     {
         $this->_oQuery->deleteObjectEntries($iObjectId ? $iObjectId : $this->getId());
     }
 
-	/**
+    /**
      * Internal functions
      */
 	protected function _getAuthorId ()
@@ -297,6 +304,36 @@ class BxDolObject extends BxDolFactory implements iBxDolReplaceable
     {
         return bx_replace_markers($mixed, $this->_aMarkers);
     }
+
+    protected function _getTmplContentElementBlock()
+    {
+        return $this->_sTmplContentElementBlock;
+    }
+
+    protected function _getTmplContentElementInline()
+    {
+        return $this->_sTmplContentElementInline;
+    }
+
+    protected function _getTmplContentDoAction()
+    {
+        return $this->_sTmplContentDoAction;
+    }
+
+    protected function _getTmplContentDoActionLabel()
+    {
+        return $this->_sTmplContentDoActionLabel;
+    }
+
+    protected function _getTmplContentCounter()
+    {
+        return $this->_sTmplContentCounter;
+    }
+
+    protected function _getTmplContentCounterLabel()
+    {
+        return $this->_sTmplContentCounterLabel;
+    }
 }
 
 /** @} */

+ 12 - 11
inc/classes/BxDolReport.php

@@ -68,14 +68,14 @@ define('BX_DOL_REPORT_USAGE_DEFAULT', BX_DOL_REPORT_USAGE_BLOCK);
 
 class BxDolReport extends BxDolObject
 {
-	protected $_oTemplate;
+    protected $_oTemplate;
 
-	protected $_sBaseUrl;
+    protected $_sBaseUrl;
 
-	protected $_sFormObject;
+    protected $_sFormObject;
     protected $_sFormDisplayPost;
 
-	protected $_aTypes;
+    protected $_aTypes;
 
     protected function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
     {
@@ -90,14 +90,14 @@ class BxDolReport extends BxDolObject
         else
             $this->_oTemplate = BxDolTemplate::getInstance();
 
-		$this->_sBaseUrl = BxDolPermalinks::getInstance()->permalink($this->_aSystem['base_url']);
+        $this->_sBaseUrl = BxDolPermalinks::getInstance()->permalink($this->_aSystem['base_url']);
         if(get_mb_substr($this->_sBaseUrl, 0, 4) != 'http')
             $this->_sBaseUrl = BX_DOL_URL_ROOT . $this->_sBaseUrl;
 
-		$this->_sFormObject = 'sys_report';
-		$this->_sFormDisplayPost = 'sys_report_post';
+        $this->_sFormObject = 'sys_report';
+        $this->_sFormDisplayPost = 'sys_report_post';
 
-		$this->_aTypes = array('spam', 'scam', 'fraud', 'nude', 'other');
+        $this->_aTypes = array('spam', 'scam', 'fraud', 'nude', 'other');
     }
 
     /**
@@ -109,8 +109,9 @@ class BxDolReport extends BxDolObject
      */
     public static function getObjectInstance($sSys, $iId, $iInit = true, $oTemplate = false)
     {
-        if(isset($GLOBALS['bxDolClasses']['BxDolReport!' . $sSys . $iId]))
-            return $GLOBALS['bxDolClasses']['BxDolReport!' . $sSys . $iId];
+        $sKey = 'BxDolReport!' . $sSys . $iId . ($oTemplate ? $oTemplate->getClassName() : '');
+        if(isset($GLOBALS['bxDolClasses'][$sKey]))
+            return $GLOBALS['bxDolClasses'][$sKey];
 
         $aSystems = self::getSystems();
         if(!isset($aSystems[$sSys]))
@@ -124,7 +125,7 @@ class BxDolReport extends BxDolObject
         }
 
         $o = new $sClassName($sSys, $iId, $iInit, $oTemplate);
-        return ($GLOBALS['bxDolClasses']['BxDolReport!' . $sSys . $iId] = $o);
+        return ($GLOBALS['bxDolClasses'][$sKey] = $o);
     }
 
     public static function &getSystems()

+ 10 - 5
inc/classes/BxDolScore.php

@@ -98,8 +98,9 @@ class BxDolScore extends BxDolObject
      */
     public static function getObjectInstance($sSys, $iId, $iInit = true, $oTemplate = false)
     {
-        if(isset($GLOBALS['bxDolClasses']['BxDolScore!' . $sSys . $iId]))
-            return $GLOBALS['bxDolClasses']['BxDolScore!' . $sSys . $iId];
+        $sKey = 'BxDolScore!' . $sSys . $iId . ($oTemplate ? $oTemplate->getClassName() : '');
+        if(isset($GLOBALS['bxDolClasses'][$sKey]))
+            return $GLOBALS['bxDolClasses'][$sKey];
 
         $aSystems = self::getSystems();
         if(!isset($aSystems[$sSys]))
@@ -113,7 +114,7 @@ class BxDolScore extends BxDolObject
         }
 
         $o = new $sClassName($sSys, $iId, $iInit, $oTemplate);
-        return ($GLOBALS['bxDolClasses']['BxDolScore!' . $sSys . $iId] = $o);
+        return ($GLOBALS['bxDolClasses'][$sKey] = $o);
     }
 
     public static function &getSystems()
@@ -293,7 +294,7 @@ class BxDolScore extends BxDolObject
             'code' => 0,
             'type' => $sType,
             'score' => $aScore['score'],
-        	'scoref' => $iCup > 0 || $iCdown > 0 ? $this->_getLabelCounter($aScore['score']) : '',
+        	'scoref' => $iCup > 0 || $iCdown > 0 ? $this->_getCounterLabel($aScore['score']) : '',
             'cup' => $iCup,
         	'cdown' => $iCdown,
             'counter' => $this->getCounter($aParams),
@@ -323,7 +324,7 @@ class BxDolScore extends BxDolObject
     	return $sResult;
     }
 
-    protected function _getIconDo($sType)
+    protected function _getIconDo($sType = '')
     {
         $sResult = '';
 
@@ -331,9 +332,13 @@ class BxDolScore extends BxDolObject
             case BX_DOL_SCORE_DO_UP:
                 $sResult = 'arrow-up';
                 break;
+
             case BX_DOL_SCORE_DO_DOWN:
                 $sResult = 'arrow-down';
                 break;
+
+            default:
+                $sResult = 'arrows-alt-v';
         }
 
     	return $sResult;

+ 4 - 3
inc/classes/BxDolView.php

@@ -68,8 +68,9 @@ class BxDolView extends BxDolObject
      */
     public static function getObjectInstance($sSys, $iId, $iInit = true)
     {
-        if(isset($GLOBALS['bxDolClasses']['BxDolView!' . $sSys . $iId]))
-            return $GLOBALS['bxDolClasses']['BxDolView!' . $sSys . $iId];
+        $sKey = 'BxDolView!' . $sSys . $iId;
+        if(isset($GLOBALS['bxDolClasses'][$sKey]))
+            return $GLOBALS['bxDolClasses'][$sKey];
 
         $aSystems = self::getSystems();
         if(!isset($aSystems[$sSys]))
@@ -83,7 +84,7 @@ class BxDolView extends BxDolObject
         }
 
         $o = new $sClassName($sSys, $iId, $iInit);
-        return ($GLOBALS['bxDolClasses']['BxDolView!' . $sSys . $iId] = $o);
+        return ($GLOBALS['bxDolClasses'][$sKey] = $o);
     }
 
     public static function &getSystems()

+ 5 - 4
inc/classes/BxDolVote.php

@@ -100,8 +100,9 @@ class BxDolVote extends BxDolObject
      */
     public static function getObjectInstance($sSys, $iId, $iInit = true, $oTemplate = false)
     {
-        if(isset($GLOBALS['bxDolClasses']['BxDolVote!' . $sSys . $iId]))
-            return $GLOBALS['bxDolClasses']['BxDolVote!' . $sSys . $iId];
+        $sKey = 'BxDolVote!' . $sSys . $iId . ($oTemplate ? $oTemplate->getClassName() : '');
+        if(isset($GLOBALS['bxDolClasses'][$sKey]))
+            return $GLOBALS['bxDolClasses'][$sKey];
 
         $aSystems = self::getSystems();
         if(!isset($aSystems[$sSys]))
@@ -118,7 +119,7 @@ class BxDolVote extends BxDolObject
         if($iInit && method_exists($o, 'init'))
             $o->init($iId);
 
-        return ($GLOBALS['bxDolClasses']['BxDolVote!' . $sSys . $iId] = $o);
+        return ($GLOBALS['bxDolClasses'][$sKey] = $o);
     }
 
     public static function &getSystems()
@@ -337,7 +338,7 @@ class BxDolVote extends BxDolObject
             'code' => 0,
             'rate' => $aVote['rate'],
             'count' => $aVote['count'],
-            'countf' => (int)$aVote['count'] > 0 ? $this->_getLabelCounter($aVote['count']) : '',
+            'countf' => (int)$aVote['count'] > 0 ? $this->_getCounterLabel($aVote['count']) : '',
             'label_icon' => $this->_getIconDo($bVoted),
             'label_title' => _t($this->_getTitleDo($bVoted)),
             'disabled' => $bVoted && !$bUndo,

+ 37 - 7
inc/classes/BxDolVoteReactions.php

@@ -12,6 +12,9 @@
  */
 class BxDolVoteReactions extends BxTemplVote
 {
+    protected static $_sCounterStyleDivided = 'divided';
+    protected static $_sCounterStyleCompound = 'compound';
+
     protected $_sMenuDoVote; //--- Do vote (reaction)  menu name.
 
     protected $_sDataList; //--- Reactions list name.
@@ -97,13 +100,23 @@ class BxDolVoteReactions extends BxTemplVote
 
     public function actionGetVotedBy()
     {
-        if (!$this->isEnabled())
+        if(!$this->isEnabled())
            return '';
 
+        $aParams = array();
+
         $sReaction = bx_get('reaction');
-        $sReaction = $sReaction !== false ? bx_process_input($sReaction) : $this->_sDefault;
+        if($sReaction !== false) {
+            $sReaction = bx_process_input($sReaction);
+            
+            $aReactions = $this->getReactions();
+            if(!in_array($sReaction, $aReactions))
+                $sReaction = $this->_sDefault;
+
+            $aParams['reaction'] = $sReaction;
+        }
 
-        return $this->_getVotedBy(array('reaction' => $sReaction));
+        return $this->_getVotedBy($aParams);
     }
 
     /**
@@ -142,6 +155,7 @@ class BxDolVoteReactions extends BxTemplVote
 
     protected function _returnVoteData($iObjectId, $iAuthorId, $iAuthorIp, $aData, $bVoted)
     {
+        $aReactions = $this->getReactions();
         $sReaction = $aData['reaction'];
 
         $bUndo = $this->isUndo();
@@ -154,18 +168,32 @@ class BxDolVoteReactions extends BxTemplVote
         if(!$bDisabled)
             $sJsClick = $bVoted && $bUndo ? $this->getJsClickDo($sReaction) : $this->getJsClick();
 
+        $iTotalC = $iTotalS = 0;
+        foreach($aReactions as $sName) {
+            $iTotalC += (int)$aVote['count_' . $sName];
+            $iTotalS += (int)$aVote['sum_' . $sName];
+        }
+        $fTotalR = $iTotalC != 0 ? round($iTotalS / $iTotalC, 2) : 0;
+
         $iCount = (int)$aVote['count_' . $sReaction];
-        return array(
+        $aResult = array(
             'code' => 0,
             'reaction' => $sReaction,
             'rate' => $aVote['rate_' . $sReaction],
             'count' => $iCount,
-            'countf' => $iCount > 0 ? $this->_getLabelCounter($iCount, array('reaction' => $sReaction)) : '',
+            'countf' => $iCount > 0 ? $this->_getCounterLabel($iCount, array('reaction' => $sReaction)) : '',
             'label_icon' => $this->_getIconDoWithTrack($bVoted, $aTrack),
             'label_title' => _t($this->_getTitleDoWithTrack($bVoted, $aTrack)),
             'label_click' => $sJsClick,
             'disabled' => $bVoted && !$this->isUndo(),
+            'total' => array(
+                'rate' => $fTotalR,
+                'count' => $iTotalC,
+                'countf' => $iTotalC > 0 ? $this->_getCounterLabel($iTotalC, array('show_counter_label_icon' => false, 'reaction' => '')) : '',
+            )
         );
+
+        return $aResult;
     }
 
     protected function _getIconDoWithTrack($bVoted, $aTrack = array())
@@ -184,9 +212,11 @@ class BxDolVoteReactions extends BxTemplVote
     
     protected function _getTitleDoBy($aParams = array())
     {
-        $sReaction = !empty($aParams['reaction']) ? $aParams['reaction'] : $this->_sDefault;
+        if(isset($aParams['show_counter_style']) && $aParams['show_counter_style'] == self::$_sCounterStyleCompound)
+            return _t('_vote_do_by_reactions');
 
-    	return _t('_vote_do_by_reactions', _t($this->_aDataList[$sReaction]['title']));
+        $sReaction = !empty($aParams['reaction']) ? $aParams['reaction'] : $this->_sDefault;
+    	return _t('_vote_do_by_x_reaction', _t($this->_aDataList[$sReaction]['title']));
     }
 }
 

+ 14 - 4
inc/classes/BxDolVoteReactionsQuery.php

@@ -103,12 +103,22 @@ class BxDolVoteReactionsQuery extends BxDolVoteQuery
     	if(!empty($aParams['type']))
             switch($aParams['type']) {
                 case 'by':
-                    $aMethod['name'] = 'getColumn';
                     $aBindings['object_id'] = $aParams['object_id'];
-                    $aBindings['reaction'] = $aParams['reaction'];
 
-                    $sSelectClause = '`author_id`';
-                    $sWhereClause = 'AND `object_id` = :object_id AND `reaction`=:reaction';
+                    $sWhereClause = 'AND `object_id` = :object_id';
+
+                    if(!empty($aParams['reaction'])) {
+                        $aMethod['name'] = 'getColumn';
+                        $aBindings['reaction'] = $aParams['reaction'];
+
+                        $sSelectClause = '`author_id`';
+                        $sWhereClause .= ' AND `reaction`=:reaction';
+                    }
+                    else {
+                        $aMethod['name'] = 'getAll';
+
+                        $sSelectClause = '`author_id`, `reaction`';
+                    }
                     break;
             }
 

+ 1 - 1
inc/js/classes/BxDolFavorite.js

@@ -64,7 +64,7 @@ BxDolFavorite.prototype.onFavorite = function(oData, oElement)
 
 		if(oData && oData.label_title) {
 			$(oElement).attr('title', oData.label_title);
-			$(oElement).find('span').html(oData.label_title);
+			$(oElement).find('span:not(.sys-action-do-icon)').html(oData.label_title);
 		}
 
 		if(oData && oData.disabled)

+ 1 - 1
inc/js/classes/BxDolFeature.js

@@ -52,7 +52,7 @@ BxDolFeature.prototype.onFeature = function(oData, oElement)
 
 		if(oData && oData.label_title) {
 			$(oElement).attr('title', oData.label_title);
-			$(oElement).find('span').html(oData.label_title);
+			$(oElement).find('span:not(.sys-action-do-icon)').html(oData.label_title);
 		}
 
 		if(oData && oData.disabled)

+ 1 - 1
inc/js/classes/BxDolReport.js

@@ -64,7 +64,7 @@ BxDolReport.prototype.onReport = function(oData, oElement)
 
 		if(oData && oData.label_title) {
 			$(oElement).attr('title', oData.label_title);
-			$(oElement).find('span').html(oData.label_title);
+			$(oElement).find('span:not(.sys-action-do-icon)').html(oData.label_title);
 		}
 
 		if(oData && oData.disabled)

+ 35 - 35
inc/js/classes/BxDolScore.js

@@ -8,10 +8,10 @@
 
 function BxDolScore(options)
 {
-	this._sObjName = undefined == options.sObjName ? 'oScore' : options.sObjName; // javascript object name, to run current object instance from onTimer
-	this._sSystem = options.sSystem; // current score system
-	this._iAuthorId = options.iAuthorId; // score's author ID.
-	this._iObjId = options.iObjId; // object id the scores are collected for
+    this._sObjName = undefined == options.sObjName ? 'oScore' : options.sObjName; // javascript object name, to run current object instance from onTimer
+    this._sSystem = options.sSystem; // current score system
+    this._iAuthorId = options.iAuthorId; // score's author ID.
+    this._iObjId = options.iObjId; // object id the scores are collected for
     this._sElementParams = options.sElementParams;
 
     this._sActionsUri = 'score.php';
@@ -26,7 +26,7 @@ function BxDolScore(options)
 }
 
 BxDolScore.prototype.toggleByPopup = function(oLink) {
-	var $this = this;
+    var $this = this;
     var oData = this._getDefaultParams();
     oData['action'] = 'GetVotedBy';
 
@@ -56,37 +56,37 @@ BxDolScore.prototype._vote = function (oLink, sType, onComplete)
     	this._sActionsUrl,
     	oParams,
     	function(oData) {
-    		var fContinue = function() {
-    			if(oData && oData.code != 0)
-                    return;
-
-	    		if(oData && oData.label_icon)
-	    			$(oLink).find('.sys-icon').attr('class', 'sys-icon ' + oData.label_icon);
-
-	    		if(oData && oData.label_title) {
-	    			$(oLink).attr('title', oData.label_title);
-	    			$(oLink).find('span').html(oData.label_title);
-	    		}
-
-	    		if(oData && oData.disabled)
-	    			$this._getActions(oLink).removeAttr('onclick').addClass($(oLink).hasClass('bx-btn') ? 'bx-btn-disabled' : 'bx-score-disabled');
-
-                var oCounter = $this._getCounter(oLink);
-                if(oCounter && oCounter.length > 0) {
-                	if(oData && oData.counter)
-                		oCounter.replaceWith(oData.counter);
-                	else
-	                	oCounter.html(oData.scoref).parents('.' + $this._sSP + '-counter-holder:first:hidden').bx_anim('show');
-                }
-
-                if(typeof onComplete == 'function')
-                	onComplete(oLink, oData);
-    		};
-
-    		if(oData && oData.message != undefined)
+            var fContinue = function() {
+            if(oData && oData.code != 0)
+                return;
+
+            if(oData && oData.label_icon)
+                $(oLink).find('.sys-icon').attr('class', 'sys-icon ' + oData.label_icon);
+
+            if(oData && oData.label_title) {
+                $(oLink).attr('title', oData.label_title);
+                $(oLink).find('span:not(.sys-action-do-icon)').html(oData.label_title);
+            }
+
+            if(oData && oData.disabled)
+                $this._getActions(oLink).removeAttr('onclick').addClass($(oLink).hasClass('bx-btn') ? 'bx-btn-disabled' : 'bx-score-disabled');
+
+            var oCounter = $this._getCounter(oLink);
+            if(oCounter && oCounter.length > 0) {
+                if(oData && oData.counter)
+                    oCounter.replaceWith(oData.counter);
+                else
+                    oCounter.html(oData.scoref).parents('.' + $this._sSP + '-counter-holder:first:hidden').bx_anim('show');
+            }
+
+            if(typeof onComplete == 'function')
+                onComplete(oLink, oData);
+            };
+
+            if(oData && oData.message != undefined)
                 bx_alert(oData.message, fContinue);
-    		else
-    			fContinue();
+            else
+                fContinue();
         },
         'json'
     );

+ 1 - 1
inc/js/classes/BxDolVoteLikes.js

@@ -24,7 +24,7 @@ BxDolVoteLikes.prototype.onVote = function (oLink, oData, onComplete)
 
     if(oData && oData.label_title) {
         $(oLink).attr('title', oData.label_title);
-        $(oLink).find('span').html(oData.label_title);
+        $(oLink).find('span:not(.sys-action-do-icon)').html(oData.label_title);
     }
 
     if(oData && oData.disabled)

+ 17 - 4
inc/js/classes/BxDolVoteReactions.js

@@ -86,7 +86,7 @@ BxDolVoteReactions.prototype.onVote = function (oLink, oData, onComplete)
 
     if(oData && oData.label_title) {
         oLink.attr('title', oData.label_title);
-        oLink.find('span').html(oData.label_title);
+        oLink.find('span:not(.sys-action-do-icon)').html(oData.label_title);
     }
 
     if(oData && oData.label_click)
@@ -99,9 +99,14 @@ BxDolVoteReactions.prototype.onVote = function (oLink, oData, onComplete)
 
     //--- Update Counter.
     var oCounter = this._getCounter(oLink);
-    if(oCounter && oCounter.length > 0)
+    if(oCounter && oCounter.length > 0) {
         oCounter.filter('.' + oData.reaction).html(oData.countf).toggleClass('bx-vc-hidden', !oData.count);
 
+        //--- Update Total.
+        if(oData.total)
+            oCounter.filter('.total-count').html(oData.total.countf).toggleClass('bx-vc-hidden', !oData.total.count);
+    }
+
     if(typeof onComplete == 'function')
         onComplete(oLink, oData);
 };
@@ -208,15 +213,23 @@ BxDolVoteReactions.prototype.toggleByPopup = function(oLink, sReaction)
 {
     var oParams = this._getDefaultParams();
     oParams['action'] = 'GetVotedBy';
-    oParams['reaction'] = sReaction;
+    if(sReaction)
+        oParams['reaction'] = sReaction;
 
     $(oLink).dolPopupAjax({
-        id: this._aHtmlIds['by_popup'], 
+        id: {value: this._aHtmlIds['by_popup'], force: true}, 
         url: bx_append_url_params(this._sActionsUri, oParams),
         removeOnClose: true
     });
 };
 
+BxDolVoteReactions.prototype.changeVotedBy = function(oLink, sReaction)
+{
+    var oContent = $('#' + this._aHtmlIds['by_popup'] + ' .' + this._sSP + '-bls-content');
+    if(oContent.length > 0)
+        oContent.children(':visible').hide().siblings('.' + this._sSP + '-bl-' + sReaction).show();
+};
+
 BxDolVoteReactions.prototype._getCounter = function(oElement)
 {
     var oCounter = BxDolVote.prototype._getCounter.call(this, oElement);

+ 1 - 1
modules/base/text/classes/BxBaseModTextVotePollAnswers.php

@@ -138,7 +138,7 @@ class BxBaseModTextVotePollAnswers extends BxTemplVoteLikes
     	return _t($CNF['T']['txt_poll_answer_vote_do_by']);
     }
 
-    protected function _getLabelCounter($iCount, $aParams = array())
+    protected function _getCounterLabel($iCount, $aParams = array())
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
 

+ 6 - 3
modules/boonex/decorous/data/template/system/css/menu.less

@@ -212,8 +212,8 @@
     padding: 0;
 }
 .bx-popup ul.bx-menu-ver li a > div > span,
-.bx-popup ul.bx-menu-custom.bx-menu-ver li a > span,
-.bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > span {
+.bx-popup ul.bx-menu-custom.bx-menu-ver li a > span:not(.sys-action-do-icon),
+.bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > span:not(.sys-action-do-icon) {
     margin-left: 1.0rem;
     line-height: 1.5rem;
     .font-size(@bx-font-size-middle);
@@ -226,8 +226,11 @@
 .bx-popup ul.bx-menu-ver li a > div .sys-icon,
 .bx-popup ul.bx-menu-custom.bx-menu-ver li a > img,
 .bx-popup ul.bx-menu-custom.bx-menu-ver li a > .sys-icon,
+.bx-popup ul.bx-menu-custom.bx-menu-ver li a > span.sys-action-do-icon,
+.bx-popup ul.bx-menu-custom.bx-menu-ver li a > span.sys-action-do-icon .sys-icon,
 .bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > img,
-.bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > .sys-icon {
+.bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > .sys-icon,
+.bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > span.sys-action-do-icon .sys-icon {
     width: 1.0rem;
     height: 1.0rem;
     line-height: 1.0rem;

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

@@ -2950,7 +2950,9 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_vote_do_like"><![CDATA[Thank you!]]></string>
 	<string name="_vote_do_unlike"><![CDATA[No thank you]]></string>
 	<string name="_vote_do_by"><![CDATA[Thanked by]]></string>
-        <string name="_vote_do_by_reactions"><![CDATA["{0}" by]]></string>
+        <string name="_vote_do_by_reactions"><![CDATA[Reacted by]]></string>
+        <string name="_vote_do_by_x_reaction"><![CDATA["{0}" by]]></string>
+        <string name="_vote_do_by_summary"><![CDATA[All]]></string>
 	<string name="_vote_err_not_enabled"><![CDATA[The feature is not available right now. Please, try again later.]]></string>
 	<string name="_vote_err_duplicate_vote"><![CDATA[Duplicate vote]]></string>
         <string name="_vote_n_votes"><![CDATA[{0} votes]]></string>

+ 2 - 2
modules/boonex/forum/template/css/main.css

@@ -193,7 +193,7 @@
     display: none;
 }
 
-.bx-base-general-unit-meta ul.bx-menu-object-bx_forum_snippet_meta_counters li span {
+.bx-base-general-unit-meta ul.bx-menu-object-bx_forum_snippet_meta_counters li > span {
     position: relative;
     display: inline-block;
     vertical-align: top;
@@ -203,7 +203,7 @@
     border-width: 0px;
     line-height: 1.5rem;
 }
-.bx-base-general-unit-meta ul.bx-menu-object-bx_forum_snippet_meta_counters li .sys-icon {
+.bx-base-general-unit-meta ul.bx-menu-object-bx_forum_snippet_meta_counters li .sys-icon:not(.cmt-counter-icon) {
     width: 1.0rem;
     height: 1.0rem;
     text-align: center;

+ 1 - 1
modules/boonex/market/classes/BxMarketVoteStars.php

@@ -36,7 +36,7 @@ class BxMarketVoteStars extends BxTemplVoteStars
     	return parent::isAllowedVote($isPerformAction);
     }
 
-    protected function _getLabelCounter($iCount, $aParams = array())
+    protected function _getCounterLabel($iCount, $aParams = array())
     {
         return _t('_bx_market_vote_counter', $iCount);
     }

+ 1 - 1
modules/boonex/polls/classes/BxPollsVoteSubentries.php

@@ -133,7 +133,7 @@ class BxPollsVoteSubentries extends BxTemplVoteLikes
     	return _t('_bx_polls_txt_subentry_vote_do_by');
     }
 
-    protected function _getLabelCounter($iCount, $aParams = array())
+    protected function _getCounterLabel($iCount, $aParams = array())
     {
         return _t('_bx_polls_txt_subentry_vote_counter', $iCount);
     }

+ 0 - 8
modules/boonex/protean/data/template/bx_timeline/css/view.less

@@ -24,12 +24,4 @@ div.bx-tl-item-meta-activity {
 .bx-media-phone div.bx-tl-item-meta-activity {
     -webkit-flex-wrap: wrap;
     flex-wrap: wrap;
-}
-
-/*--- Activity Menu Styles ---*/
-div.bx-tl-item-activity .bx-menu-custom.bx-menu-hor li .sys-icon {
-    width: 1.25rem;
-    height: 1.25rem;
-    line-height: 1.25rem;
-    font-size: 1.25rem;
 }

+ 6 - 3
modules/boonex/protean/data/template/system/css/menu.less

@@ -87,8 +87,8 @@ ul.bx-menu-ver.bx-menu-profile-stats li.bx-menu-item-profile-stats-profile .bx-m
     padding: 0;
 }
 .bx-popup ul.bx-menu-ver li a > div > span,
-.bx-popup ul.bx-menu-custom.bx-menu-ver li a > span,
-.bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > span {
+.bx-popup ul.bx-menu-custom.bx-menu-ver li a > span:not(.sys-action-do-icon),
+.bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > span:not(.sys-action-do-icon) {
     margin-left: 1.0rem;
     line-height: 1.5rem;
 }
@@ -100,8 +100,11 @@ ul.bx-menu-ver.bx-menu-profile-stats li.bx-menu-item-profile-stats-profile .bx-m
 .bx-popup ul.bx-menu-ver li a > div .sys-icon,
 .bx-popup ul.bx-menu-custom.bx-menu-ver li a > img,
 .bx-popup ul.bx-menu-custom.bx-menu-ver li a > .sys-icon,
+.bx-popup ul.bx-menu-custom.bx-menu-ver li a > span.sys-action-do-icon,
+.bx-popup ul.bx-menu-custom.bx-menu-ver li a > span.sys-action-do-icon .sys-icon,
 .bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > img,
-.bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > .sys-icon {
+.bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > .sys-icon,
+.bx-popup ul.bx-menu-custom.bx-menu-custom-ver li a > span.sys-action-do-icon .sys-icon {
     width: 1.0rem;
     height: 1.0rem;
     line-height: 1.0rem;

+ 4 - 2
modules/boonex/russian/data/langs/bx_timeline/ru.xml

@@ -184,14 +184,16 @@
 
     <string name="_bx_timeline_menu_title_item_actions"><![CDATA[Элемент - Действия]]></string>
     <string name="_bx_timeline_menu_set_title_item_actions"><![CDATA[Элемент - Действия]]></string>
+    <string name="_bx_timeline_menu_title_item_counters"><![CDATA[Элемент - Счетчики]]></string>
+    <string name="_bx_timeline_menu_set_title_item_counters"><![CDATA[Элемент - Счетчики]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_comment"><![CDATA[Комментарий]]></string>
-    <string name="_bx_timeline_menu_item_title_item_comment"><![CDATA[]]></string>
+    <string name="_bx_timeline_menu_item_title_item_comment"><![CDATA[Прокомментировать]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_view"><![CDATA[Посмотреть]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_vote"><![CDATA[Голосовать (Нравится)]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_score"><![CDATA[Голосовать (За/Против)]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_reaction"><![CDATA[Отреагировать]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_share"><![CDATA[Поделиться]]></string>
-    <string name="_bx_timeline_menu_item_title_item_share"><![CDATA[]]></string>
+    <string name="_bx_timeline_menu_item_title_item_share"><![CDATA[Поделиться]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_report"><![CDATA[Пожаловаться]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_more"><![CDATA[Дополнительные действия]]></string>
     <string name="_bx_timeline_menu_item_title_item_more"><![CDATA[]]></string>

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

@@ -2918,7 +2918,9 @@
 	<string name="_vote_do_like"><![CDATA[Спасибо!]]></string>
 	<string name="_vote_do_unlike"><![CDATA[Нет, спасибо]]></string>
 	<string name="_vote_do_by"><![CDATA[Поблагодарили]]></string>
-        <string name="_vote_do_by_reactions"><![CDATA["{0}" от]]></string>
+        <string name="_vote_do_by_reactions"><![CDATA[Отреагировали]]></string>
+        <string name="_vote_do_by_x_reaction"><![CDATA["{0}" от]]></string>
+        <string name="_vote_do_by_summary"><![CDATA[Все]]></string>
 	<string name="_vote_err_not_enabled"><![CDATA[Ваш голос не может быть принят в данный момент. Пожалуйста, попробуйте позднее.]]></string>
 	<string name="_vote_err_duplicate_vote"><![CDATA[Повторный голос]]></string>
         <string name="_vote_n_votes"><![CDATA[{0} голосов]]></string>

+ 1 - 1
modules/boonex/shopify/install/sql/install.sql

@@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS `bx_shopify_entries` (
   `added` int(11) NOT NULL,
   `changed` int(11) NOT NULL,
   `title` varchar(255) NOT NULL,
-  `code` varchar(16) NOT NULL default '',
+  `code` varchar(255) NOT NULL default '',
   `cat` int(11) NOT NULL,
   `location` text NOT NULL,
   `views` int(11) NOT NULL default '0',

+ 1 - 0
modules/boonex/timeline/classes/BxTimelineConfig.php

@@ -174,6 +174,7 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
             'menu_view' => $this->_sName . '_menu_view',
             'menu_item_manage' => $this->_sName . '_menu_item_manage',
             'menu_item_actions' => $this->_sName . '_menu_item_actions',
+            'menu_item_counters' => $this->_sName . '_menu_item_counters',
             'menu_item_meta' => $this->_sName . '_menu_item_meta',
             'menu_post_attachments' => $this->CNF['OBJECT_MENU_ENTRY_ATTACHMENTS'],
 

+ 94 - 16
modules/boonex/timeline/classes/BxTimelineMenuItemActions.php

@@ -14,6 +14,9 @@
  */
 class BxTimelineMenuItemActions extends BxTemplMenuCustom
 {
+    protected static $_sModeActions = 'actions';
+    protected static $_sModeCounters = 'counters';
+
     protected $_oModule;
 
     protected $_iEvent;
@@ -21,7 +24,12 @@ class BxTimelineMenuItemActions extends BxTemplMenuCustom
 
     protected $_sType;
     protected $_sView;
+
+    protected $_sMode;
     protected $_bShowTitles;
+    protected $_bShowCounters;
+
+    protected $_sTmplNameItem;
 
     public function __construct($aObject, $oTemplate = false)
     {
@@ -31,7 +39,10 @@ class BxTimelineMenuItemActions extends BxTemplMenuCustom
 
         $this->_setBrowseParams();
 
-        $this->_bShowTitles = false;
+        $this->_sMode = self::$_sModeActions;
+        $this->_bShowTitles = true;
+        $this->_bShowCounters = false;
+        $this->_sTmplNameItem = 'menu_custom_item_hor.html';
     }
 
     public function setEvent($aEvent, $aBrowseParams = array())
@@ -109,10 +120,22 @@ class BxTimelineMenuItemActions extends BxTemplMenuCustom
         $sViewsSystem = $this->_aEvent['views']['system'];
         $iViewsObject = $this->_aEvent['views']['object_id'];
         $aViewsParams = array('dynamic_mode' => $this->_bDynamicMode);
-        if($this->_bShowTitles)
-            $aViewsParams['show_do_view_label'] = true;
 
-        return $this->_oModule->getViewObject($sViewsSystem, $iViewsObject)->getElementInline($aViewsParams);
+        switch($this->_sMode) {
+            case self::$_sModeActions:
+                $sViewsMethod = 'getElementInline';
+                $aViewsParams['show_do_view_label'] = $this->_bShowTitles;
+                $aViewsParams['show_counter'] = $this->_bShowCounters;
+                break;
+
+            case self::$_sModeCounters:
+                $sViewsMethod = 'getCounter';
+                $aViewsParams['show_counter'] = true;
+                $aViewsParams['show_counter_label_icon'] = true;
+                break;
+        }
+
+        return $this->_oModule->getViewObject($sViewsSystem, $iViewsObject)->$sViewsMethod($aViewsParams);
     }
 
     protected function _getMenuItemItemVote($aItem)
@@ -123,10 +146,22 @@ class BxTimelineMenuItemActions extends BxTemplMenuCustom
         $sVotesSystem = $this->_aEvent['votes']['system'];
         $iVotesObject = $this->_aEvent['votes']['object_id'];
         $aVotesParams = array('dynamic_mode' => $this->_bDynamicMode);
-        if($this->_bShowTitles)
-            $aVotesParams['show_do_vote_label'] = true;
 
-        return $this->_oModule->getVoteObject($sVotesSystem, $iVotesObject)->getElementInline($aVotesParams);
+        switch($this->_sMode) {
+            case self::$_sModeActions:
+                $sVotesMethod = 'getElementInline';
+                $aVotesParams['show_do_vote_label'] = $this->_bShowTitles;
+                $aVotesParams['show_counter'] = $this->_bShowCounters;
+                break;
+
+            case self::$_sModeCounters:
+                $sVotesMethod = 'getCounter';
+                $aVotesParams['show_counter'] = true;
+                $aVotesParams['show_counter_empty'] = true;
+                break;
+        }
+
+        return $this->_oModule->getVoteObject($sVotesSystem, $iVotesObject)->$sVotesMethod($aVotesParams);
     }
 
     protected function _getMenuItemItemReaction($aItem)
@@ -137,10 +172,22 @@ class BxTimelineMenuItemActions extends BxTemplMenuCustom
         $sReactionsSystem = $this->_aEvent['reactions']['system'];
         $iReactionsObject = $this->_aEvent['reactions']['object_id'];
         $aReactionsParams = array('dynamic_mode' => $this->_bDynamicMode);
-        if($this->_bShowTitles)
-            $aReactionsParams['show_do_vote_label'] = true;
+        
+        switch($this->_sMode) {
+            case self::$_sModeActions:
+                $sReactionsMethod = 'getElementInline';
+                $aReactionsParams['show_do_vote_label'] = $this->_bShowTitles;
+                $aReactionsParams['show_counter'] = $this->_bShowCounters;
+                break;
 
-    	return $this->_oModule->getReactionObject($sReactionsSystem, $iReactionsObject)->getElementInline($aReactionsParams);
+            case self::$_sModeCounters:
+                $sReactionsMethod = 'getCounter';
+                $aReactionsParams['show_counter'] = true;
+                $aReactionsParams['show_counter_style'] = 'compound';
+                break;
+        }
+
+    	return $this->_oModule->getReactionObject($sReactionsSystem, $iReactionsObject)->$sReactionsMethod($aReactionsParams);
     }
 
     protected function _getMenuItemItemScore($aItem)
@@ -151,10 +198,22 @@ class BxTimelineMenuItemActions extends BxTemplMenuCustom
         $sScoresSystem = $this->_aEvent['scores']['system'];
         $iScoresObject = $this->_aEvent['scores']['object_id'];
         $aScoresParams = array('dynamic_mode' => $this->_bDynamicMode);
-        if($this->_bShowTitles)
-            $aScoresParams['show_do_vote_label'] = true;
+        
+        switch($this->_sMode) {
+            case self::$_sModeActions:
+                $sScoresMethod = 'getElementInline';
+                $aScoresParams['show_do_vote_label'] = $this->_bShowTitles;
+                $aScoresParams['show_counter'] = $this->_bShowCounters;
+                break;
+
+            case self::$_sModeCounters:
+                $sScoresMethod = 'getCounter';
+                $aScoresParams['show_counter'] = true;
+                $aScoresParams['show_counter_empty'] = true;
+                break;
+        }
 
-        return $this->_oModule->getScoreObject($sScoresSystem, $iScoresObject)->getElementInline($aScoresParams);
+        return $this->_oModule->getScoreObject($sScoresSystem, $iScoresObject)->$sScoresMethod($aScoresParams);
     }
 
     protected function _getMenuItemItemReport($aItem)
@@ -165,10 +224,21 @@ class BxTimelineMenuItemActions extends BxTemplMenuCustom
         $sReportsSystem = $this->_aEvent['reports']['system'];
         $iReportsObject = $this->_aEvent['reports']['object_id'];
         $aReportsParams = array('dynamic_mode' => $this->_bDynamicMode);
-        if($this->_bShowTitles)
-            $aReportsParams['show_do_report_label'] = true;
+        
+        switch($this->_sMode) {
+            case self::$_sModeActions:
+                $sReportsMethod = 'getElementInline';
+                $aReportsParams['show_do_report_label'] = $this->_bShowTitles;
+                $aReportsParams['show_counter'] = $this->_bShowCounters;
+                break;
+
+            case self::$_sModeCounters:
+                $sReportsMethod = 'getCounter';
+                $aReportsParams['show_counter'] = true;
+                break;
+        }
 
-        return $this->_oModule->getReportObject($sReportsSystem, $iReportsObject)->getElementInline($aReportsParams);
+        return $this->_oModule->getReportObject($sReportsSystem, $iReportsObject)->$sReportsMethod($aReportsParams);
     }
 
     protected function _getMenuItemDefault ($aItem)
@@ -269,6 +339,14 @@ class BxTimelineMenuItemActions extends BxTemplMenuCustom
 
         return call_user_func_array(array($this->_oModule, $sCheckFuncName), $aCheckFuncParams) === true;
     }
+    
+    protected function _getTmplContentItem()
+    {
+        if(empty($this->_sTmplNameItem))
+           return parent::_getTmplContentItem();
+
+        return $this->_oModule->_oTemplate->getHtml($this->_sTmplNameItem);
+    }
 }
 
 /** @} */

+ 52 - 0
modules/boonex/timeline/classes/BxTimelineMenuItemCounters.php

@@ -0,0 +1,52 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Timeline Timeline
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once('BxTimelineMenuItemActions.php');
+
+/**
+ * 'Item' menu.
+ */
+class BxTimelineMenuItemCounters extends BxTimelineMenuItemActions
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+
+        $this->_sMode = self::$_sModeCounters;
+    }
+
+    protected function _getMenuItemItemComment($aItem)
+    {
+        if(!isset($this->_aEvent['comments']) || !is_array($this->_aEvent['comments']) || !isset($this->_aEvent['comments']['system'])) 
+            return false;
+
+        $sCommentsSystem = $this->_aEvent['comments']['system'];
+        $iCommentsObject = $this->_aEvent['comments']['object_id'];
+        $aCommentsParams = array('dynamic_mode' => $this->_bDynamicMode);
+
+        switch($this->_sMode) {
+            case self::$_sModeActions:
+                $sCommentsMethod = 'getElementInline';
+                $aCommentsParams['show_do_comment_label'] = $this->_bShowTitles;
+                $aCommentsParams['show_counter'] = $this->_bShowCounters;
+                break;
+
+            case self::$_sModeCounters:
+                $sCommentsMethod = 'getCounter';
+                $aCommentsParams['show_counter'] = true;
+                break;
+        }
+
+        return $this->_oModule->getCmtsObject($sCommentsSystem, $iCommentsObject)->$sCommentsMethod($aCommentsParams);
+    }
+}
+
+/** @} */

+ 2 - 0
modules/boonex/timeline/classes/BxTimelineMenuItemManage.php

@@ -34,6 +34,8 @@ class BxTimelineMenuItemManage extends BxTimelineMenuItemActions
         $this->setEventById($iContentId, $aBrowseParams);
 
         $this->_bShowTitles = true;
+        $this->_bShowCounters = true;
+        $this->_sTmplNameItem = '';
     }
 }
 

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

@@ -2133,6 +2133,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
      * @code bx_srv('bx_timeline', 'get_menu_item_addon_comment', [...]); @endcode
      * 
      * Get addon for Comment menu item.
+     * NOTE. The service isn't used for now because comment functionality in card was updated.
      * 
      * @param $sSystem string value with comments engine system.
      * @param $iObjectId integer value with object ID. 

+ 68 - 27
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -1383,6 +1383,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
             $oModule->getViewObject($aEvent['views']['system'], $aEvent['views']['object_id'])->doView();
 
         $aTmplVarsNote = $this->_getTmplVarsNote($aEvent);
+        $aTmplVarsMenuItemCounters = $this->_getTmplVarsMenuItemCounters($aEvent, $aBrowseParams);
         $aTmplVarsMenuItemActions = $this->_getTmplVarsMenuItemActions($aEvent, $aBrowseParams);
         $aTmplVarsMenuItemMeta = $this->_getTmplVarsMenuItemMeta($aEvent, $aBrowseParams);
 
@@ -1390,8 +1391,6 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         $bTmplVarsOwnerActions = !empty($aTmplVarsOwnerActions); 
 
         $aTmplVarsTimelineOwner = $this->_getTmplVarsTimelineOwner($aEvent);
-        
-        $aTmplVarsReactions = $this->_getTmplVarsReactions($aEvent, $aBrowseParams);
 
         $bPinned = (int)$aEvent['pinned'] > 0;
         $bSticked = (int)$aEvent['sticked'] > 0;
@@ -1489,9 +1488,9 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                     'location' => $sLocation
             	)
             ),
-            'bx_if:show_reactions' => array(
-                'condition' => !empty($aTmplVarsReactions),
-                'content' => $aTmplVarsReactions
+            'bx_if:show_menu_item_counters' => array(
+                'condition' => !empty($aTmplVarsMenuItemCounters),
+                'content' => $aTmplVarsMenuItemCounters
             ),
             'bx_if:show_menu_item_actions' => array(
                 'condition' => !empty($aTmplVarsMenuItemActions),
@@ -1662,6 +1661,70 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         );
     }
 
+    protected function _getTmplVarsMenuItemCounters(&$aEvent, $aBrowseParams = array())
+    {
+        $oMenu = BxDolMenu::getObjectInstance($this->_oConfig->getObject('menu_item_counters'));
+        $oMenu->setEvent($aEvent, $aBrowseParams);
+        $oMenu->setDynamicMode(isset($aBrowseParams['dynamic_mode']) && $aBrowseParams['dynamic_mode'] === true);
+
+        $sMenu = $oMenu->getCode();
+        if(empty($sMenu))
+            return array();
+
+        return array(
+            'style_prefix' => $this->_oConfig->getPrefix('style'),
+            'js_object' => $this->_oConfig->getJsObjectView($aBrowseParams),
+            'menu_item_counters' => $sMenu
+        );
+    }
+    
+    /*
+    protected function _getTmplVarsReactions(&$aEvent, $aBrowseParams = array())
+    {
+        if(!isset($aEvent['reactions']) || !is_array($aEvent['reactions']) || !isset($aEvent['reactions']['system']))
+            return array();
+
+        $sReactionsSystem = $aEvent['reactions']['system'];
+        $iReactionsObject = $aEvent['reactions']['object_id'];
+        $aReactionsParams = array(
+            'show_counter' => true,
+            'show_counter_style' => 'compound', 
+            'dynamic_mode' => isset($aBrowseParams['dynamic_mode']) && $aBrowseParams['dynamic_mode'] === true
+        );
+
+        $oReactions = $this->getModule()->getReactionObject($sReactionsSystem, $iReactionsObject);
+        if(!$oReactions)
+            return array();
+
+        return array(
+            'style_prefix' => $this->_oConfig->getPrefix('style'),
+            'reactions' => $oReactions->getCounter($aReactionsParams)
+        );
+    }
+
+    protected function _getTmplVarsComments(&$aEvent, $aBrowseParams = array())
+    {
+        if(!isset($aEvent['comments']) || !is_array($aEvent['comments']) || !isset($aEvent['comments']['system']))
+            return array();
+
+        $sCmtsSystem = $aEvent['comments']['system'];
+        $iCmtsObject = $aEvent['comments']['object_id'];
+        $aCmtsParams = array(
+            'show_counter' => true, 
+            'dynamic_mode' => isset($aBrowseParams['dynamic_mode']) && $aBrowseParams['dynamic_mode'] === true
+        );
+
+        $oCmts = $this->getModule()->getCmtsObject($sCmtsSystem, $iCmtsObject);
+        if(!$oCmts)
+            return array();
+
+        return array(
+            'style_prefix' => $this->_oConfig->getPrefix('style'),
+            'comments' => $oCmts->getCounter($aCmtsParams)
+        );
+    }
+     */
+
     protected function _getTmplVarsMenuItemMeta(&$aEvent, $aBrowseParams = array())
     {
         $oMenu = BxDolMenu::getObjectInstance($this->_oConfig->getObject('menu_item_meta'));
@@ -2227,28 +2290,6 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         );
     }
 
-    protected function _getTmplVarsReactions(&$aEvent, $aBrowseParams = array())
-    {
-        if(!isset($aEvent['reactions']) || !is_array($aEvent['reactions']) || !isset($aEvent['reactions']['system']))
-            return array();
-
-        $sReactionsSystem = $aEvent['reactions']['system'];
-        $iReactionsObject = $aEvent['reactions']['object_id'];
-        $aReactionsParams = array(
-            'show_counter' => true, 
-            'dynamic_mode' => isset($aBrowseParams['dynamic_mode']) && $aBrowseParams['dynamic_mode'] === true
-        );
-
-        $oReactions = $this->getModule()->getReactionObject($sReactionsSystem, $iReactionsObject);
-        if(!$oReactions)
-            return array();
-
-        return array(
-            'style_prefix' => $this->_oConfig->getPrefix('style'),
-            'reactions' => $oReactions->getCounter($aReactionsParams)
-        );
-    }
-
     protected function _getSystemData(&$aEvent, $aBrowseParams = array())
     {
         $mixedResult = $this->_oConfig->getSystemData($aEvent, $aBrowseParams);

+ 4 - 2
modules/boonex/timeline/install/langs/en.xml

@@ -184,14 +184,16 @@
 
     <string name="_bx_timeline_menu_title_item_actions"><![CDATA[Item Actions]]></string>
     <string name="_bx_timeline_menu_set_title_item_actions"><![CDATA[Item Actions]]></string>
+    <string name="_bx_timeline_menu_title_item_counters"><![CDATA[Item Counters]]></string>
+    <string name="_bx_timeline_menu_set_title_item_counters"><![CDATA[Item Counters]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_comment"><![CDATA[Comment]]></string>
-    <string name="_bx_timeline_menu_item_title_item_comment"><![CDATA[]]></string>
+    <string name="_bx_timeline_menu_item_title_item_comment"><![CDATA[Comment]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_view"><![CDATA[View]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_vote"><![CDATA[Vote (Like)]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_score"><![CDATA[Vote (Up/Down)]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_reaction"><![CDATA[Reaction]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_share"><![CDATA[Share]]></string>
-    <string name="_bx_timeline_menu_item_title_item_share"><![CDATA[]]></string>
+    <string name="_bx_timeline_menu_item_title_item_share"><![CDATA[Share]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_report"><![CDATA[Report]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_more"><![CDATA[More Actions]]></string>
     <string name="_bx_timeline_menu_item_title_item_more"><![CDATA[]]></string>

+ 1 - 1
modules/boonex/timeline/install/sql/disable.sql

@@ -6,7 +6,7 @@ DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_timeline' OR `object` IN('bx
 -- MENU
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_timeline';
 DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_timeline';
-DELETE FROM `sys_menu_items` WHERE `module` = 'bx_timeline' OR `set_name` IN('bx_timeline_menu_view', 'bx_timeline_menu_item_share', 'bx_timeline_menu_item_manage', 'bx_timeline_menu_item_actions', 'bx_timeline_menu_item_meta', 'bx_timeline_menu_post_attachments');
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_timeline' OR `set_name` IN('bx_timeline_menu_view', 'bx_timeline_menu_item_share', 'bx_timeline_menu_item_manage', 'bx_timeline_menu_item_actions', 'bx_timeline_menu_item_counters', 'bx_timeline_menu_item_meta', 'bx_timeline_menu_post_attachments');
 
 
 -- SETTINGS

+ 15 - 1
modules/boonex/timeline/install/sql/enable.sql

@@ -125,13 +125,27 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-view', '_bx_timeline_menu_item_title_system_item_view', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 0, 0, 1, 0),
-('bx_timeline_menu_item_actions', 'bx_timeline', 'item-comment', '_bx_timeline_menu_item_title_system_item_comment', '_bx_timeline_menu_item_title_item_comment', 'javascript:void(0)', 'javascript:{comment_onclick}', '_self', 'comment', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_menu_item_addon_comment";s:6:"params";a:3:{i:0;s:16:"{comment_system}";i:1;s:16:"{comment_object}";i:2;a:3:{s:4:"name";s:6:"{name}";s:4:"view";s:6:"{view}";s:4:"type";s:6:"{type}";}}}', '', 0, 2147483647, 1, 0, 1, 10),
+('bx_timeline_menu_item_actions', 'bx_timeline', 'item-comment', '_bx_timeline_menu_item_title_system_item_comment', '_bx_timeline_menu_item_title_item_comment', 'javascript:void(0)', 'javascript:{comment_onclick}', '_self', 'comment', '', '', 0, 2147483647, 1, 0, 1, 10),
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-vote', '_bx_timeline_menu_item_title_system_item_vote', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 0, 0, 1, 20),
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-reaction', '_bx_timeline_menu_item_title_system_item_reaction', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 1, 0, 1, 30),
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-score', '_bx_timeline_menu_item_title_system_item_score', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 0, 0, 1, 40),
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-share', '_bx_timeline_menu_item_title_system_item_share', '_bx_timeline_menu_item_title_item_share', 'javascript:void(0)', 'bx_menu_popup(''bx_timeline_menu_item_share'', this, {''id'':''bx_timeline_menu_item_share_{content_id}''}, {content_id:{content_id}, name:''{name}'', view:''{view}'', type:''{type}''});', '', 'share-alt', '', 'bx_timeline_menu_item_share', 1, 2147483647, 1, 0, 1, 50),
 ('bx_timeline_menu_item_actions', 'bx_timeline', 'item-more', '_bx_timeline_menu_item_title_system_item_more', '_bx_timeline_menu_item_title_item_more', 'javascript:void(0)', 'bx_menu_popup(''bx_timeline_menu_item_manage'', this, {''id'':''bx_timeline_menu_item_manage_{content_id}''}, {content_id:{content_id}, name:''{name}'', view:''{view}'', type:''{type}''});', '', 'ellipsis-h', '', 'bx_timeline_menu_item_manage', 1, 2147483647, 1, 0, 1, 60);
 
+-- MENU: Item Counters (Comments, Votes, Reactions, etc)
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_timeline_menu_item_counters', '_bx_timeline_menu_title_item_counters', 'bx_timeline_menu_item_counters', 'bx_timeline', 15, 0, 1, 'BxTimelineMenuItemCounters', 'modules/boonex/timeline/classes/BxTimelineMenuItemCounters.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_timeline_menu_item_counters', 'bx_timeline', '_bx_timeline_menu_set_title_item_counters', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES
+('bx_timeline_menu_item_counters', 'bx_timeline', 'item-vote', '_bx_timeline_menu_item_title_system_item_vote', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 0, 0, 1, 0),
+('bx_timeline_menu_item_counters', 'bx_timeline', 'item-reaction', '_bx_timeline_menu_item_title_system_item_reaction', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 1, 0, 1, 10),
+('bx_timeline_menu_item_counters', 'bx_timeline', 'item-score', '_bx_timeline_menu_item_title_system_item_score', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 0, 0, 1, 20),
+('bx_timeline_menu_item_counters', 'bx_timeline', 'item-view', '_bx_timeline_menu_item_title_system_item_view', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 0, 0, 1, 30),
+('bx_timeline_menu_item_counters', 'bx_timeline', 'item-comment', '_bx_timeline_menu_item_title_system_item_comment', '', 'javascript:void(0)', '', '', '', '', '', 0, 2147483647, 1, 0, 1, 40);
+
 -- MENU: Item Meta Info
 INSERT INTO `sys_objects_menu` (`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
 ('bx_timeline_menu_item_meta', '_sys_menu_title_snippet_meta', 'bx_timeline_menu_item_meta', 'bx_timeline', 15, 0, 1, 'BxTimelineMenuSnippetMeta', 'modules/boonex/timeline/classes/BxTimelineMenuSnippetMeta.php');

+ 21 - 6
modules/boonex/timeline/template/css/view.css

@@ -385,11 +385,6 @@ div.bx-tl-item-text div.bx-tl-content img {
 	height: auto;
 }
 
-/*--- Item Reactions Style ---*/
-div.bx-tl-item-reactions .bx-vote-counter {
-    margin-top: 0.5rem;
-}
-
 /*--- Item Images Style ---*/
 div.bx-tl-item div.bx-tl-item-images {
     position: relative;
@@ -400,8 +395,9 @@ div.bx-tl-item div.bx-tl-item-image {
     display: inline-block;
 }
 
+/*--- Item Activity ---*/
 div.bx-tl-item div.bx-tl-item-activity .bx-menu-custom {
-    position: realtive;
+    position: relative;
     display: -webkit-flex;
     display: flex;
     -webkit-justify-content: space-between;
@@ -420,6 +416,25 @@ div.bx-tl-item div.bx-tl-item-activity .bx-menu-custom li > span img {
     background-position: center center;
 }
 
+div.bx-tl-item div.bx-tl-item-activity .bx-menu-custom li .sys-action-do-icon,
+div.bx-tl-item div.bx-tl-item-activity .bx-menu-custom li .bx-menu-item-icon {
+    display: inline-block;
+
+    width: 1.25rem;
+    height: 1.25rem;
+
+    background-color: rgba(0, 0, 0, 0.2);
+    border-radius: 1rem;
+
+    text-align: center;
+    line-height: 1.25rem;
+    font-size: 0.625rem;
+}
+div.bx-tl-item div.bx-tl-item-activity .bx-menu-custom li .sys-action-do-icon .sys-icon,
+div.bx-tl-item div.bx-tl-item-activity .bx-menu-custom li .bx-menu-item-icon .sys-icon {
+    vertical-align: top;
+}
+
 /*--- Item Style: Timeline ---*/
 div.bx-tl-view-timeline div.bx-tl-items:before {
     content: '';

+ 4 - 3
modules/boonex/timeline/template/item_outline.html

@@ -52,13 +52,14 @@
                 </bx_if:show_owner_actions>
             </div>
             <div class="__style_prefix__-item-content bx-clearfix">__content__</div>
-            <bx_if:show_reactions>
-                <div class="__style_prefix__-item-reactions bx-def-margin-leftright">__reactions__</div>
-            </bx_if:show_reactions>
             <bx_if:show_location>
                 <div class="__style_prefix__-item-location bx-def-margin-leftright bx-def-margin-sec-top bx-def-font-grayed bx-clearfix">__location__</div>
             </bx_if:show_location>
+            <bx_if:show_menu_item_counters>
+                <div class="__style_prefix__-item-activity __style_prefix__-ia-counters bx-def-margin-leftright bx-def-margin-sec-top bx-clearfix">__menu_item_counters__</div>
+            </bx_if:show_menu_item_counters>
             <bx_if:show_menu_item_actions>
+                <div class="__style_prefix__-item-activity-divider bx-def-hr bx-def-margin-sec-top"></div>
                 <div class="__style_prefix__-item-activity bx-def-margin-leftright bx-def-margin-sec-top bx-clearfix">__menu_item_actions__</div>
             </bx_if:show_menu_item_actions>
             <div class="__style_prefix__-item-comments-holder bx-def-margin-leftright">__comments__</div>

+ 4 - 3
modules/boonex/timeline/template/item_timeline.html

@@ -56,13 +56,14 @@
             </bx_if:show_owner_actions>
         </div>
         <div class="__style_prefix__-item-content bx-clearfix">__content__</div>
-        <bx_if:show_reactions>
-            <div class="__style_prefix__-item-reactions bx-def-margin-leftright">__reactions__</div>
-        </bx_if:show_reactions>
         <bx_if:show_location>
             <div class="__style_prefix__-item-location bx-def-margin-leftright bx-def-margin-sec-top bx-def-font-grayed bx-clearfix">__location__</div>
         </bx_if:show_location>
+        <bx_if:show_menu_item_counters>
+            <div class="__style_prefix__-item-activity __style_prefix__-ia-counters bx-def-margin-leftright bx-def-margin-sec-top bx-clearfix">__menu_item_counters__</div>
+        </bx_if:show_menu_item_counters>
         <bx_if:show_menu_item_actions>
+            <div class="__style_prefix__-item-activity-divider bx-def-hr bx-def-margin-sec-top"></div>
             <div class="__style_prefix__-item-activity bx-def-margin-leftright bx-def-margin-sec-top bx-clearfix">__menu_item_actions__</div>
         </bx_if:show_menu_item_actions>
         <div class="__style_prefix__-item-comments-holder bx-def-margin-leftright">__comments__</div>

+ 4 - 0
modules/boonex/timeline/template/menu_custom_item_hor.html

@@ -0,0 +1,4 @@
+<span class="__class_wrp__ bx-def-margin-thd-topbottom">
+    <a class="__class_link__" href="__link__" target="__target__" onclick="__onclick__" title="__title_attr__"><bx_if:icon><span class="bx-menu-item-icon"><i class="sys-icon __icon__"></i></span></bx_if:icon><bx_if:image><img style="background-image:url(__icon_url__)" src="<bx_icon_url:spacer.gif />" /></bx_if:image><bx_if:title><span class="bx-menu-item-title bx-def-margin-sec-left-auto">__title__</span></bx_if:title></a>
+    <bx_if:addon>__addon__</bx_if:addon>
+</span>

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

@@ -1 +1 @@
-<bx_if:show_image><img src="__src__" /></bx_if:show_image><bx_if:show_icon><i class="sys-icon __name__"></i></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>
+<bx_if:show_image><span class="sys-action-do-icon __style_prefix__-do-image"><img src="__src__" /></span></bx_if:show_image><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 3 - 3
modules/boonex/timeline/template/repost_element_block.html

@@ -1,7 +1,7 @@
-<div id="__html_id__" class="__style_prefix__-repost __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom bx-clearfix" bx_repost_data_count="__count__">
-    <div class="__style_prefix__-repost-element-holder">__do_repost__</div>
+<div id="__html_id__" class="sys-action __style_prefix__-repost __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom bx-clearfix" bx_repost_data_count="__count__">
+    <div class="sys-action-element-holder __style_prefix__-repost-element-holder">__do_repost__</div>
     <bx_if:show_counter>
-        <div class="__style_prefix__-repost-counter-holder bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
+        <div class="sys-action-counter-holder __style_prefix__-repost-counter-holder bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
     </bx_if:show_counter>
     __script__
 </div>

+ 1 - 1
template/comment_counter.html

@@ -1 +1 @@
-<span id="__id__" class="__class__ bx-def-font-grayed">__content__</a>
+<div id="__id__" class="__class__"><bx_repeat:profiles>__icon__</bx_repeat:profiles><bx_if:show_icon><div class="__sp__-counter-icon bx-def-icon-size bx-def-margin-sec-right"><i class="__sp__-counter-icon sys-icon comment"></i></div></bx_if:show_icon>__content__</div>

+ 77 - 12
template/css/cmts.css

@@ -350,44 +350,109 @@
         text-overflow: ellipsis;
         overflow: hidden;
     }
-        
+
 /*--- Comment Element Styles ---*/
 div.cmt div.cmt-element-holder,
 div.cmt div.cmt-counter-holder {
-	position: relative;
-	float: left;
+    position: relative;
+    float: left;
+}
+span.cmt span.cmt-element-holder,
+span.cmt span.cmt-counter-holder {
+    position: relative;
+    display: inline-block;
+    vertical-align: middle;
 }
 
 .cmt .cmt-element-holder,
 .cmt .cmt-counter-holder {
-	line-height: 20px;
-	line-height: 1.25rem;
+    line-height: 20px;
+    line-height: 1.25rem;
 }
 
 .cmt-button .cmt-element-holder,
 .cmt-button .cmt-counter-holder {
-	line-height: 36px;
-	line-height: 2.2rem;
+    line-height: 36px;
+    line-height: 2.2rem;
 }
 
 .cmt-button-small .cmt-element-holder,
 .cmt-button-small .cmt-counter-holder {
-	line-height: 24px;
-	line-height: 1.6rem;
+    line-height: 24px;
+    line-height: 1.6rem;
 }
 
 .cmt .cmt-element-holder .cmt-do-comment.cmt-disabled,
 .cmt .cmt-element-holder .cmt-do-comment.cmt-disabled .sys-icon {
-	color: #ddd;
+    color: #ddd;
 }
 
 .cmt-button .cmt-counter-holder,
 .cmt-button-small .cmt-counter-holder {
-	font-size: 1.5rem;
+    font-size: 1.5rem;
 }
 
 .cmt-link .cmt-counter-holder.bx-btn-border {
-	border-width: 0px;
+    border-width: 0px;
+}
+
+/* +++ Comment Element: Counter +++ */
+.cmt-counter {
+    position: relative;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-align-items: center;
+    align-items: center;
+    -webkit-flex-wrap:nowrap;
+    flex-wrap:nowrap;
+
+    padding-left: 4px;
+}
+.cmt-counter > * {
+    position: relative;
+}
+.cmt-counter div.cmt-counter-icon,
+.cmt-counter div.bx-base-pofile-unit-wo-info {
+    margin: 4px 0 4px -4px;
+}
+.cmt-counter div.cmt-counter-icon {
+    margin-right: 0.5rem;
+    box-sizing: border-box;
+
+    background-color: rgba(215, 215, 215, 1.0);
+    border: 1px solid #ffffff;
+    border-radius: 1rem;
+
+    text-align: center;
+}
+.cmt-counter .bx-def-icon-size {
+    width: 1.0rem;
+    height: 1.0rem;
+}
+.cmt-counter .bx-def-icon-size,
+.cmt-counter p.bx-base-pofile-unit-thumb.bx-def-icon-size {
+    line-height: 0.875rem;
+    font-size: 0.5rem;
+}
+.cmt-counter .bx-def-icon-size-min-height {
+    min-height: 1.0rem;
+}
+
+.cmt-counter .bx-def-icon-size-max-height {
+    max-height: 1.0rem;
+}
+
+.cmt-counter .bx-def-icon-size-left-indent {
+    margin-left: 1.25rem;
+}
+
+.cmt-counter .bx-def-unit-img .bx-base-pofile-unit-thumb {
+    display: block;
+    border-width: 1px;
+}
+
+.cmt-counter .bx-base-pofile-unit-online {
+    display: none;
 }
 
 

+ 7 - 16
template/css/menu.css

@@ -17,7 +17,7 @@ ul.bx-menu-hor {
 }
 
 .bx-menu-hor-inline li a {
-	display:inline;
+    display:inline;
 }
 
 .bx-menu-hor li.bx-menu-tab-active a {
@@ -26,7 +26,7 @@ ul.bx-menu-hor {
 
 .bx-menu-hor li img,
 .bx-menu-hor li .sys-icon {
-	display:inline-block;
+    display:inline-block;
     vertical-align:middle;
 }
 .bx-menu-hor li img {
@@ -36,6 +36,9 @@ ul.bx-menu-hor {
     background-position: center center;
     background-repeat: no-repeat;
 }
+.bx-menu-hor li a > span {
+    vertical-align:middle;
+}
 
 /* --------------- horizontal inline menu with 'special' buttons */
 .bx-menu-hor-inline-sbtn li a {
@@ -767,22 +770,10 @@ ul.bx-menu-btns-icon-hor li:last-child .bx-btn {
 .bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item .bx-btn {
     color: #3e8685;
 }
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-view-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-vote-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-score-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-favorite-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-feature-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-report-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-tl-repost-element-holder a span {
+.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-item.bx-base-general-ea-sa .sys-action-element-holder a span:not(.sys-action-do-icon) {
     display: none;
 }
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-view-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-vote-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-score-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-favorite-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-feature-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-report-element-holder a span,
-.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item.bx-base-general-ea-sa .bx-tl-repost-element-holder a span {
+.bx-menu-custom.bx-menu-hor.bx-menu-more-auto .bx-menu-submenu-more-auto .bx-menu-item.bx-base-general-ea-sa .sys-action-element-holder a span:not(.sys-action-do-icon) {
     display: inline;
 }
 

+ 26 - 0
template/css/score.css

@@ -71,3 +71,29 @@ div.bx-score-counter-holder {
 .bx-score-button-small .bx-score-counter-holder {
 	font-size: 1.5rem;
 }
+
+/*--- Counter Styles ---*/
+.bx-score-counter > span {
+    vertical-align: middle;
+}
+.bx-score-counter span.bx-score-counter-icon {
+    position: relative;
+    display: inline-block;
+    box-sizing: border-box;
+
+    width: 1.0rem;
+    height: 1.0rem;
+    margin-top: 4px;
+    margin-bottom: 4px;
+
+    background-color: rgba(215, 215, 215, 1.0);
+    border: 1px solid #ffffff;
+    border-radius: 1rem;
+
+    line-height: 0.875rem;
+    text-align: center;
+    font-size: 0.5rem;
+}
+.bx-score-counter span.bx-score-counter-icon .sys-icon {
+    vertical-align: top;
+}

+ 23 - 0
template/css/view.css

@@ -62,4 +62,27 @@ div.bx-view-counter-holder {
 .bx-view-button .bx-view-counter-holder,
 .bx-view-button-small .bx-view-counter-holder {
 	font-size: 1.5rem;
+}
+
+/*--- Counter Styles ---*/
+.bx-view-counter span.bx-view-counter-icon {
+    position: relative;
+    display: inline-block;
+    box-sizing: border-box;
+
+    width: 1.0rem;
+    height: 1.0rem;
+    margin-top: 4px;
+    margin-bottom: 4px;
+
+    background-color: rgba(215, 215, 215, 1.0);
+    border: 1px solid #ffffff;
+    border-radius: 1rem;
+
+    line-height: 0.875rem;
+    text-align: center;
+    font-size: 0.5rem;
+}
+.bx-view-counter span.bx-view-counter-icon .sys-icon {
+    vertical-align: top;
 }

+ 186 - 12
template/css/vote.css

@@ -1,16 +1,16 @@
-/*--- Comment Plused By ---*/
+/*--- Voted By ---*/
 div.bx-vote-by-list {}
 div.bx-vote-by-list-cnt {
-	max-height: 200px;
-	max-height: 12.5rem;
-	min-width: 220px;
-	min-width: 13.75rem;
-	overflow: auto;
+    max-height: 200px;
+    max-height: 12.5rem;
+    min-width: 220px;
+    min-width: 13.75rem;
+    overflow: auto;
 }
 div.bx-vote-by-list div.bx-base-pofile-unit {
-	float: none;
-	margin-right: 0px;
-	margin-bottom: 0px;
+    float: none;
+    margin-right: 0px;
+    margin-bottom: 0px;
 }
 
 /*--- Vote Element Styles ---*/
@@ -20,7 +20,10 @@ div.bx-vote div.bx-vote-counter-holder {
 	float: left;
 }
 
+
+/*----------------------------------*/
 /*--- Likes based Element Styles ---*/
+/*----------------------------------*/
 .bx-vote-likes .bx-vote-element-holder,
 .bx-vote-likes .bx-vote-counter-holder {
 	line-height: 20px;
@@ -53,7 +56,10 @@ div.bx-vote div.bx-vote-counter-holder {
     border-width: 0px;
 }
 
+
+/*--------------------------------------*/
 /*--- Reactions based Element Styles ---*/
+/*--------------------------------------*/
 .bx-vote-reactions .bx-vote-element-holder,
 .bx-vote-reactions .bx-vote-counter-holder {
 	line-height: 20px;
@@ -89,15 +95,183 @@ div.bx-vote div.bx-vote-counter-holder {
 .bx-vote-counter-wrapper-reactions .bx-vote-counter {
     display: inline-block;
 }
+.bx-vote-counter-wrapper-reactions.bx-vote-counter-wrapper-reactions-compound {
+    position: relative;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-align-items: center;
+    align-items: center;
+
+    padding-left: 4px;
+}
+.bx-vote-counter-wrapper-reactions.bx-vote-counter-wrapper-reactions-compound .bx-vote-counter {
+    display: block;
+}
+.bx-vote-counter-wrapper-reactions.bx-vote-counter-wrapper-reactions-divided a.bx-vote-counter {
+    margin-right: 0.5rem;
+}
+.bx-vote-counter-wrapper-reactions.bx-vote-counter-wrapper-reactions-compound a.bx-vote-counter {
+    margin-left: 0.5rem;
+}
+.bx-vote-counter-wrapper-reactions.bx-vote-counter-wrapper-reactions-compound span.bx-vote-counter {
+    width: 1.0rem;
+    height: 1.0rem;
+    box-sizing: border-box;
+
+    margin: 4px 0 4px -4px;
+}
+.bx-vote-counter-wrapper-reactions.bx-vote-counter-wrapper-reactions-compound span.bx-vote-counter:first-child {
+    margin-left: 0;
+}
+.bx-vote-counter-wrapper-reactions.bx-vote-counter-wrapper-reactions-compound span.bx-vote-counter > span {
+    vertical-align: top;
+}
+.bx-vote-counter-wrapper-reactions.bx-vote-counter-wrapper-reactions-compound span.bx-vote-counter > span:not(.bx-vote-counter-icon) {
+    display: none;
+}
 .bx-vote-counter-wrapper-reactions .bx-vote-counter.bx-vc-hidden {
     display: none;
 }
-.bx-vote-counter-wrapper-reactions .bx-vote-counter i,
-.bx-vote-counter-wrapper-reactions .bx-vote-counter span {
-    vertical-align: middle;
+
+
+/*--- Counter Styles ---*/
+.bx-vote-counter.bx-vote-counter-likes span.bx-vote-counter-icon,
+.bx-vote-counter-wrapper-reactions.bx-vote-counter-wrapper-reactions-compound .bx-vote-counter.bx-vote-counter-reactions span.bx-vote-counter-icon {
+    position: relative;
+    display: inline-block;
+    box-sizing: border-box;
+
+    width: 1.0rem;
+    height: 1.0rem;
+
+    background-color: rgba(215, 215, 215, 1.0);
+    border: 1px solid #ffffff;
+    border-radius: 1rem;
+
+    line-height: 0.875rem;
+    text-align: center;
+    font-size: 0.5rem;
+}
+.bx-vote-counter.bx-vote-counter-likes span.bx-vote-counter-icon {
+    margin-top: 4px;
+    margin-bottom: 4px;
+}
+.bx-vote-counter.bx-vote-counter-likes span.bx-vote-counter-icon .sys-icon {
+    vertical-align: top;
+}
+
+
+/*--- Voted By ---*/
+div.bx-vote-by-list {}
+div.bx-vote-by-list-cnt {
+    max-height: 200px;
+    max-height: 12.5rem;
+    min-width: 220px;
+    min-width: 13.75rem;
+    overflow: auto;
+}
+div.bx-vote-by-list div.bx-base-pofile-unit {
+    float: none;
+    margin-right: 0px;
+    margin-bottom: 0px;
+}
+.bx-vote-bls-header {
+    display: -webkit-flex;
+    display: flex;
+
+    margin: -1.25rem -1.25rem 0 -1.25rem;
+    
+    border-bottom-color: #e6f0fa;
+    border-bottom-width: 2px;
+}
+.bx-vote-bls-title,
+.bx-vote-bls-submenu {
+    -webkit-flex: 0 1 auto; 
+    -ms-flex:  0 1 auto; 
+    flex:  0 1 auto;
+    line-height: 3.125rem;
+}
+.bx-vote-bls-title,
+.bx-vote-bls-submenu-cnt {
+	height: 3.125rem;
+}
+
+.bx-vote-bls-title {
+    -webkit-flex-grow: 3;
+    flex-grow: 3;
+
+    border-bottom: 2px solid rgba(0,0,0,0.1);
+
+    white-space: nowrap;
+    font-size: 1rem;
+    font-weight: 400;
+}
+.bx-vote-bls-submenu {
+    overflow-x: auto;
+    overflow-y: hidden;
+
+    -webkit-overflow-scrolling: touch;
+}
+.bx-vote-bls-submenu::-webkit-scrollbar {
+    width: 0.5rem;
+}
+.bx-vote-bls-submenu::-webkit-scrollbar-track {
+    -webkit-border-radius: 0.5rem;
+    border-radius: 0.5rem;
+
+    background-color: rgba(0, 0, 0, 0.1); 
+}
+.bx-vote-bls-submenu::-webkit-scrollbar-thumb {
+    -webkit-border-radius: 0.5rem;
+    border-radius: 0.5rem;
+
+    background: rgba(255, 255, 255, 0.9); 
+    -webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.5);
+}
+.bx-vote-bls-submenu::-webkit-scrollbar-thumb:window-inactive {
+    background: rgba(255, 255, 255, 0.4); 
+}
+.bx-vote-bls-submenu-cnt ul {
+    display: -webkit-flex;
+    display: flex;
+}
+.bx-vote-bls-submenu-cnt ul li {
+    -webkit-flex: 0 1 auto; 
+    -ms-flex:  0 1 auto; 
+    flex:  0 1 auto;
+    box-sizing: border-box;
+    height: 3.125rem;
+
+    border-bottom: 2px solid rgba(0,0,0,0.1);
+    border-radius: 0;
+
+    line-height: 3.125rem;
+    white-space: nowrap;
+}
+.bx-vote-bls-submenu-cnt ul li div {
+    padding: 0 0.625rem;
+}
+.bx-vote-bls-submenu-cnt ul li.bx-menu-inter-act {
+    border-bottom-color: #364f6b;
+}
+.bx-vote-bls-submenu-cnt ul li.bx-menu-inter-act > div {
+    font-weight: bold;
+}
+.bx-vote-bls-content .bx-vote-by-list:not(.bx-vote-bl-summary) {
+    display: none;
+}
+.bx-vote-bls-content .bx-vote-by-item {
+    position: relative;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-align-items: center;
+    align-items: center;
 }
 
+
+/*----------------------------------*/
 /*--- Stars based Element Styles ---*/
+/*----------------------------------*/
 .bx-vote-stars,
 .bx-vote-stars .bx-vote-do,
 .bx-vote-stars .bx-vote-element-holder,

+ 1 - 1
template/favorite_do_favorite_label.html

@@ -1 +1 @@
-<bx_if:show_icon><i class="sys-icon __name__"></i></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>
+<bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 3 - 3
template/favorite_element_block.html

@@ -1,7 +1,7 @@
-<div id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom bx-clearfix" bx_favorite_data_count="__count__">
-    <div class="__style_prefix__-element-holder">__do_favorite__</div>
+<div id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom bx-clearfix" bx_favorite_data_count="__count__">
+    <div class="sys-action-element-holder __style_prefix__-element-holder">__do_favorite__</div>
     <bx_if:show_counter>
-        <div class="__style_prefix__-counter-holder bx-def-margin-sec-left bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
+        <div class="sys-action-counter-holder __style_prefix__-counter-holder bx-def-margin-sec-left bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
     </bx_if:show_counter>
     __script__
 </div>

+ 2 - 2
template/favorite_element_inline.html

@@ -1,3 +1,3 @@
-<span id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_favorite_data_count="__count__">
-    <span class="__style_prefix__-element-holder">__do_favorite__</span><bx_if:show_counter><span class="__style_prefix__-counter-holder bx-def-margin-thd-left bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter>__script__
+<span id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_favorite_data_count="__count__">
+    <span class="sys-action-element-holder __style_prefix__-element-holder">__do_favorite__</span><bx_if:show_counter><span class="sys-action-counter-holder __style_prefix__-counter-holder bx-def-margin-thd-left bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter>__script__
 </span>

+ 1 - 1
template/feature_do_feature_label.html

@@ -1 +1 @@
-<bx_if:show_icon><i class="sys-icon __name__"></i></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>
+<bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 2 - 2
template/feature_element_block.html

@@ -1,4 +1,4 @@
-<div id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom bx-clearfix" bx_feature_data_count="__count__">
-    <div class="__style_prefix__-element-holder">__do_feature__</div>
+<div id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom bx-clearfix" bx_feature_data_count="__count__">
+    <div class="sys-action-element-holder __style_prefix__-element-holder">__do_feature__</div>
     __script__
 </div>

+ 2 - 2
template/feature_element_inline.html

@@ -1,3 +1,3 @@
-<span id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_feature_data_count="__count__">
-    <span class="__style_prefix__-element-holder">__do_feature__</span>__script__
+<span id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_feature_data_count="__count__">
+    <span class="sys-action-element-holder __style_prefix__-element-holder">__do_feature__</span>__script__
 </span>

+ 1 - 1
template/report_do_report_label.html

@@ -1 +1 @@
-<bx_if:show_icon><i class="sys-icon __name__"></i></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>
+<bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 6 - 6
template/report_element_block.html

@@ -1,7 +1,7 @@
-<div id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom bx-clearfix" bx_report_data_count="__count__">
-	<div class="__style_prefix__-element-holder">__do_report__</div>
-	<bx_if:show_counter>
-		<div class="__style_prefix__-counter-holder bx-def-margin-sec-left bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
-	</bx_if:show_counter>
-	__script__
+<div id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom bx-clearfix" bx_report_data_count="__count__">
+    <div class="sys-action-element-holder __style_prefix__-element-holder">__do_report__</div>
+    <bx_if:show_counter>
+        <div class="sys-action-counter-holder __style_prefix__-counter-holder bx-def-margin-sec-left bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
+    </bx_if:show_counter>
+    __script__
 </div>

+ 2 - 2
template/report_element_inline.html

@@ -1,3 +1,3 @@
-<span id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_report_data_count="__count__">
-    <span class="__style_prefix__-element-holder">__do_report__</span><bx_if:show_counter><span class="__style_prefix__-counter-holder bx-def-margin-thd-left bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter>__script__
+<span id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_report_data_count="__count__">
+    <span class="sys-action-element-holder __style_prefix__-element-holder">__do_report__</span><bx_if:show_counter><span class="sys-action-counter-holder __style_prefix__-counter-holder bx-def-margin-thd-left bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter>__script__
 </span>

+ 2 - 6
template/score_counter.html

@@ -1,6 +1,2 @@
-<bx_if:show_link>
-    <a id="__id__" class="__class__" href="javascript:void(0)" onclick="__onclick__" title="__title__">__content__</a>
-</bx_if:show_link>
-<bx_if:show_text>
-    <span id="__id__" class="__class__ bx-def-font-grayed">__content__</a>
-</bx_if:show_text>
+<bx_if:show_link><a id="__id__" class="__class__" href="javascript:void(0)" onclick="__onclick__" title="__title__">__content__</a></bx_if:show_link><bx_if:show_text><span id="__id__" class="__class__ bx-def-font-grayed">__content__</a></bx_if:show_text>
+__script__

+ 1 - 0
template/score_counter_label.html

@@ -0,0 +1 @@
+<bx_if:show_icon><span class="__style_prefix__-counter-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 1 - 1
template/score_do_vote_label.html

@@ -1 +1 @@
-<bx_if:show_image><img src="__src__" /></bx_if:show_image><bx_if:show_icon><i class="sys-icon __name__"></i></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>
+<bx_if:show_image><span class="sys-action-do-image __style_prefix__-do-image"><img src="__src__" /></span></bx_if:show_image><bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 10 - 10
template/score_element_block.html

@@ -1,13 +1,13 @@
-<div id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_score_data_score="__score__" bx_score_data_cup="__cup__" bx_score_data_cdown="__cdown__">
-	<div class="__style_prefix__-do bx-clearfix">
-		<bx_if:show_do_vote_up>
-			<div class="__style_prefix__-element-holder __style_prefix__-eh-up">__do_vote__</div>
-		</bx_if:show_do_vote_up>
-		<bx_if:show_counter>
-			<div class="__style_prefix__-counter-holder bx-def-margin-sec-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
-		</bx_if:show_counter>
-		<bx_if:show_do_vote_down>
-            <div class="__style_prefix__-element-holder __style_prefix__-eh-down bx-def-margin-sec-left-auto">__do_vote__</div>
+<div id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_score_data_score="__score__" bx_score_data_cup="__cup__" bx_score_data_cdown="__cdown__">
+	<div class="sys-action-do __style_prefix__-do bx-clearfix">
+        <bx_if:show_do_vote_up>
+                <div class="sys-action-element-holder __style_prefix__-element-holder __style_prefix__-eh-up">__do_vote__</div>
+        </bx_if:show_do_vote_up>
+        <bx_if:show_counter>
+                <div class="sys-action-counter-holder __style_prefix__-counter-holder bx-def-margin-sec-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
+        </bx_if:show_counter>
+        <bx_if:show_do_vote_down>
+            <div class="sys-action-element-holder __style_prefix__-element-holder __style_prefix__-eh-down bx-def-margin-sec-left-auto">__do_vote__</div>
         </bx_if:show_do_vote_down>
 	</div>
 	<bx_if:show_legend>__legend__</bx_if:show_legend>

+ 2 - 2
template/score_element_inline.html

@@ -1,3 +1,3 @@
-<span id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_score_data_score="__score__" bx_score_data_cup="__cup__" bx_score_data_cdown="__cdown__">
-    <span class="__style_prefix__-do"><bx_if:show_do_vote_up><span class="__style_prefix__-element-holder __style_prefix__-eh-up">__do_vote__</span></bx_if:show_do_vote_up><bx_if:show_counter><span class="__style_prefix__-counter-holder bx-def-margin-thd-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter><bx_if:show_do_vote_down><span class="__style_prefix__-element-holder __style_prefix__-eh-down bx-def-margin-thd-left-auto">__do_vote__</span></bx_if:show_do_vote_down></span>__script__
+<span id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_score_data_score="__score__" bx_score_data_cup="__cup__" bx_score_data_cdown="__cdown__">
+    <span class="sys-action-do __style_prefix__-do"><bx_if:show_do_vote_up><span class="sys-action-element-holder __style_prefix__-element-holder __style_prefix__-eh-up">__do_vote__</span></bx_if:show_do_vote_up><bx_if:show_counter><span class="sys-action-counter-holder __style_prefix__-counter-holder bx-def-margin-thd-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter><bx_if:show_do_vote_down><span class="sys-action-element-holder __style_prefix__-element-holder __style_prefix__-eh-down bx-def-margin-thd-left-auto">__do_vote__</span></bx_if:show_do_vote_down></span>__script__
 </span>

+ 27 - 2
template/scripts/BxBaseCmts.php

@@ -592,10 +592,35 @@ class BxBaseCmts extends BxDolCmts
         if($bShowDoCommentAsButton)
             $sClass .= ' bx-btn-height';
 
+        $aCmts = $this->_oQuery->getCommentsBy(array('type' => 'object_id', 'object_id' => $this->getId(), 'order_way' => 'desc', 'start' => 0, 'per_page' => 5));
+        $aCmts = array_reverse($aCmts);
+
+        $aTmplVarsProfiles = array();
+        foreach($aCmts as $aCmt) {
+            $oAuthor = BxDolProfile::getInstanceMagic((int)$aCmt['cmt_author_id']);
+            if(!$oAuthor)
+                continue;
+            
+            $aTmplVarsProfiles[] = array(
+                'icon' => $oAuthor->getUnit(0, array('template' => array('name' => 'unit_wo_info_links', 'size' => 'icon'))) 
+            );
+        }
+
+        $sContent = $iCount != 0 || $bShowEmpty ? $this->_getCounterLabel($iCount) : '';
+        if(!empty($sContent))
+            $sContent = $this->_oTemplate->parseLink($this->getListUrl(), $sContent);
+
         return $this->_oTemplate->parseHtmlByContent($this->_getTmplCounter(), array(
             'id' => $this->_aHtmlIds['counter'],
             'class' => $sClass,
-            'content' => $iCount != 0 || $bShowEmpty ? $this->_getLabelCounter($iCount) : ''
+            'content' => $sContent,
+            'bx_repeat:profiles' => $aTmplVarsProfiles,
+            'bx_if:show_icon' => array(
+                'condition' => $bShowEmpty || !empty($aTmplVarsProfiles),
+                'content' => array(
+                    'sp' => $this->_sStylePrefix
+                )
+            )
         ));
     }
 
@@ -623,7 +648,7 @@ class BxBaseCmts extends BxDolCmts
         ));
     }
 
-    protected function _getLabelCounter($iCount)
+    protected function _getCounterLabel($iCount)
     {
         return (int)$iCount != 0 ? _t('_cmt_txt_counter', $iCount) : _t('_cmt_txt_counter_empty');
     }

+ 14 - 23
template/scripts/BxBaseFavorite.php

@@ -12,13 +12,9 @@
  */
 class BxBaseFavorite extends BxDolFavorite
 {
-    protected static $_sTmplContentElementBlock;
-    protected static $_sTmplContentElementInline;
-    protected static $_sTmplContentDoFavoriteLabel;
-
     protected $_bCssJsAdded;
 
-	protected $_sJsObjClass;
+    protected $_sJsObjClass;
     protected $_sJsObjName;
     protected $_sStylePrefix;
 
@@ -40,26 +36,21 @@ class BxBaseFavorite extends BxDolFavorite
         $this->_aHtmlIds = array(
             'main' => 'bx-favorite-' . $sHtmlId,
             'counter' => 'bx-favorite-counter-' . $sHtmlId,
-        	'do_link' => 'bx-favorite-do-link-' . $sHtmlId,
+            'do_link' => 'bx-favorite-do-link-' . $sHtmlId,
             'by_popup' => 'bx-favorite-by-popup-' . $sHtmlId
         );
 
         $this->_aElementDefaults = array(
-			'show_do_favorite_as_button' => false,
-			'show_do_favorite_as_button_small' => false,
-			'show_do_favorite_icon' => true,
-			'show_do_favorite_label' => false,
-			'show_counter' => true
+            'show_do_favorite_as_button' => false,
+            'show_do_favorite_as_button_small' => false,
+            'show_do_favorite_icon' => true,
+            'show_do_favorite_label' => false,
+            'show_counter' => true
         );
 
-        if(empty(self::$_sTmplContentElementBlock))
-            self::$_sTmplContentElementBlock = $this->_oTemplate->getHtml('favorite_element_block.html');
-
-        if(empty(self::$_sTmplContentElementInline))
-            self::$_sTmplContentElementInline = $this->_oTemplate->getHtml('favorite_element_inline.html');
-
-        if(empty(self::$_sTmplContentDoFavoriteLabel))
-            self::$_sTmplContentDoFavoriteLabel = $this->_oTemplate->getHtml('favorite_do_favorite_label.html');
+        $this->_sTmplContentElementBlock = $this->_oTemplate->getHtml('favorite_element_block.html');
+        $this->_sTmplContentElementInline = $this->_oTemplate->getHtml('favorite_element_inline.html');
+        $this->_sTmplContentDoActionLabel = $this->_oTemplate->getHtml('favorite_do_favorite_label.html');
     }
 
     public function getJsObjectName()
@@ -100,7 +91,7 @@ class BxBaseFavorite extends BxDolFavorite
         if($bShowDoFavoriteAsButton)
             $sClass .= ' bx-btn-height';
 
-        return $this->_oTemplate->parseLink('javascript:void(0)', (int)$aFavorite['count'] > 0 ? $this->_getLabelCounter($aFavorite['count']) : '', array(
+        return $this->_oTemplate->parseLink('javascript:void(0)', (int)$aFavorite['count'] > 0 ? $this->_getCounterLabel($aFavorite['count']) : '', array(
             'title' => _t('_favorite_do_favorite_by'),
         	'id' => $this->_aHtmlIds['counter'],
         	'class' => $sClass,
@@ -142,7 +133,7 @@ class BxBaseFavorite extends BxDolFavorite
 
         $aParams['is_favorited'] = $this->isPerformed($iObjectId, $iAuthorId) ? true : false;
 
-        $sTmplName = self::${'_sTmplContentElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_FAVORITE_USAGE_DEFAULT)};
+        $sTmplName = $this->{'_getTmplContentElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_FAVORITE_USAGE_DEFAULT)}();
         return $this->_oTemplate->parseHtmlByContent($sTmplName, array(
             'style_prefix' => $this->_sStylePrefix,
             'html_id' => $this->_aHtmlIds['main'],
@@ -188,7 +179,7 @@ class BxBaseFavorite extends BxDolFavorite
         ));
     }
 
-    protected function _getLabelCounter($iCount)
+    protected function _getCounterLabel($iCount)
     {
         return _t('_favorite_counter', $iCount);
     }
@@ -196,7 +187,7 @@ class BxBaseFavorite extends BxDolFavorite
     protected function _getLabelDoFavorite($aParams = array())
     {
     	$bFavorited = isset($aParams['is_favorited']) && $aParams['is_favorited'] === true;
-        return $this->_oTemplate->parseHtmlByContent(self::$_sTmplContentDoFavoriteLabel, array(
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoActionLabel(), array(
         	'bx_if:show_icon' => array(
         		'condition' => isset($aParams['show_do_favorite_icon']) && $aParams['show_do_favorite_icon'] == true,
         		'content' => array(

+ 11 - 20
template/scripts/BxBaseFeature.php

@@ -12,13 +12,9 @@
  */
 class BxBaseFeature extends BxDolFeature
 {
-    protected static $_sTmplContentElementBlock;
-    protected static $_sTmplContentElementInline;
-    protected static $_sTmplContentDoFeatureLabel;
-
     protected $_bCssJsAdded;
 
-	protected $_sJsObjClass;
+    protected $_sJsObjClass;
     protected $_sJsObjName;
     protected $_sStylePrefix;
 
@@ -39,24 +35,19 @@ class BxBaseFeature extends BxDolFeature
         $sHtmlId = str_replace(array('_' , ' '), array('-', '-'), $sSystem) . '-' . $iId;
         $this->_aHtmlIds = array(
             'main' => 'bx-feature-' . $sHtmlId,
-        	'do_link' => 'bx-feature-do-link-' . $sHtmlId
+            'do_link' => 'bx-feature-do-link-' . $sHtmlId
         );
 
         $this->_aElementDefaults = array(
-			'show_do_feature_as_button' => false,
-			'show_do_feature_as_button_small' => false,
-			'show_do_feature_icon' => true,
-			'show_do_feature_label' => false
+            'show_do_feature_as_button' => false,
+            'show_do_feature_as_button_small' => false,
+            'show_do_feature_icon' => true,
+            'show_do_feature_label' => false
         );
 
-        if(empty(self::$_sTmplContentElementBlock))
-            self::$_sTmplContentElementBlock = $this->_oTemplate->getHtml('feature_element_block.html');
-
-        if(empty(self::$_sTmplContentElementInline))
-            self::$_sTmplContentElementInline = $this->_oTemplate->getHtml('feature_element_inline.html');
-
-        if(empty(self::$_sTmplContentDoFeatureLabel))
-            self::$_sTmplContentDoFeatureLabel = $this->_oTemplate->getHtml('feature_do_feature_label.html');
+        $this->_sTmplContentElementBlock = $this->_oTemplate->getHtml('feature_element_block.html');
+        $this->_sTmplContentElementInline = $this->_oTemplate->getHtml('feature_element_inline.html');
+        $this->_sTmplContentDoActionLabel = $this->_oTemplate->getHtml('feature_do_feature_label.html');
     }
 
     public function getJsObjectName()
@@ -118,7 +109,7 @@ class BxBaseFeature extends BxDolFeature
 
         $aParams['is_featured'] = $this->isPerformed($iObjectId, $iAuthorId) ? true : false;
 
-        $sTmplName = self::${'_sTmplContentElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_FEATURED_USAGE_DEFAULT)};
+        $sTmplName = $this->{'_getTmplContentElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_FEATURED_USAGE_DEFAULT)}();
         return $this->_oTemplate->parseHtmlByContent($sTmplName, array(
             'style_prefix' => $this->_sStylePrefix,
             'html_id' => $this->_aHtmlIds['main'],
@@ -156,7 +147,7 @@ class BxBaseFeature extends BxDolFeature
     protected function _getLabelDoFeature($aParams = array())
     {
     	$bFeatured = isset($aParams['is_featured']) && $aParams['is_featured'] === true;
-        return $this->_oTemplate->parseHtmlByContent(self::$_sTmplContentDoFeatureLabel, array(
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoActionLabel(), array(
         	'bx_if:show_icon' => array(
         		'condition' => isset($aParams['show_do_feature_icon']) && $aParams['show_do_feature_icon'] == true,
         		'content' => array(

+ 53 - 63
template/scripts/BxBaseReport.php

@@ -12,14 +12,9 @@
  */
 class BxBaseReport extends BxDolReport
 {
-    protected static $_sTmplContentElementBlock;
-    protected static $_sTmplContentElementInline;
-    protected static $_sTmplContentDoReport;
-    protected static $_sTmplContentDoReportLabel;
+    protected $_bCssJsAdded;
 
-	protected $_bCssJsAdded;
-
-	protected $_sJsObjClass;
+    protected $_sJsObjClass;
     protected $_sJsObjName;
     protected $_sStylePrefix;
 
@@ -41,31 +36,24 @@ class BxBaseReport extends BxDolReport
         $this->_aHtmlIds = array(
             'main' => 'bx-report-' . $sHtmlId,
             'counter' => 'bx-report-counter-' . $sHtmlId,
-        	'do_link' => 'bx-report-do-link-' . $sHtmlId,
-        	'do_popup' => 'bx-report-do-popup-' . $sHtmlId,
-        	'do_form' => 'bx-report-do-form-' . $sHtmlId,
+            'do_link' => 'bx-report-do-link-' . $sHtmlId,
+            'do_popup' => 'bx-report-do-popup-' . $sHtmlId,
+            'do_form' => 'bx-report-do-form-' . $sHtmlId,
             'by_popup' => 'bx-report-by-popup-' . $sHtmlId
         );
 
         $this->_aElementDefaults = array(
-			'show_do_report_as_button' => false,
-			'show_do_report_as_button_small' => false,
-			'show_do_report_icon' => true,
-			'show_do_report_label' => false,
-			'show_counter' => true
+            'show_do_report_as_button' => false,
+            'show_do_report_as_button_small' => false,
+            'show_do_report_icon' => true,
+            'show_do_report_label' => false,
+            'show_counter' => true
         );
 
-        if(empty(self::$_sTmplContentElementBlock))
-            self::$_sTmplContentElementBlock = $this->_oTemplate->getHtml('report_element_block.html');
-
-        if(empty(self::$_sTmplContentElementInline))
-            self::$_sTmplContentElementInline = $this->_oTemplate->getHtml('report_element_inline.html');
-
-        if(empty(self::$_sTmplContentDoReport))
-            self::$_sTmplContentDoReport = $this->_oTemplate->getHtml('report_do_report.html');
-
-        if(empty(self::$_sTmplContentDoReportLabel))
-            self::$_sTmplContentDoReportLabel = $this->_oTemplate->getHtml('report_do_report_label.html');
+        $this->_sTmplContentElementBlock = $this->_oTemplate->getHtml('report_element_block.html');
+        $this->_sTmplContentElementInline = $this->_oTemplate->getHtml('report_element_inline.html');
+        $this->_sTmplContentDoAction = $this->_oTemplate->getHtml('report_do_report.html');
+        $this->_sTmplContentDoActionLabel = $this->_oTemplate->getHtml('report_do_report_label.html');
     }
 
     public function getJsObjectName()
@@ -108,7 +96,7 @@ class BxBaseReport extends BxDolReport
         if($bShowDoReportAsButton)
             $sClass .= ' bx-btn-height';
 
-        return $this->_oTemplate->parseLink('javascript:void(0)',  (int)$aReport['count'] > 0 ? $this->_getLabelCounter($aReport['count']) : '', array(
+        return $this->_oTemplate->parseLink('javascript:void(0)',  (int)$aReport['count'] > 0 ? $this->_getCounterLabel($aReport['count']) : '', array(
             'id' => $this->_aHtmlIds['counter'],
             'class' => $sClass, 
         	'title' => _t('_report_do_report_by'),
@@ -137,10 +125,10 @@ class BxBaseReport extends BxDolReport
 
         $bShowDoReportAsButtonSmall = isset($aParams['show_do_report_as_button_small']) && $aParams['show_do_report_as_button_small'] == true;
         $bShowDoReportAsButton = !$bShowDoReportAsButtonSmall && isset($aParams['show_do_report_as_button']) && $aParams['show_do_report_as_button'] == true;
-		$bShowCounter = isset($aParams['show_counter']) && $aParams['show_counter'] === true && $this->isAllowedReportView();
+        $bShowCounter = isset($aParams['show_counter']) && $aParams['show_counter'] === true && $this->isAllowedReportView();
 
-		$iObjectId = $this->getId();
-		$iAuthorId = $this->_getAuthorId();
+        $iObjectId = $this->getId();
+        $iAuthorId = $this->_getAuthorId();
         $aReport = $this->_oQuery->getReport($iObjectId);
 
         if(!$this->isAllowedReport() && (!$this->isAllowedReportView() || (int)$aReport['count'] == 0))
@@ -148,7 +136,7 @@ class BxBaseReport extends BxDolReport
 
         $aParams['is_reported'] = $this->isPerformed($iObjectId, $iAuthorId) ? true : false;
 
-        $sTmplName = self::${'_sTmplContentElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_REPORT_USAGE_DEFAULT)};
+        $sTmplName = $this->{'_getTmplContentElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_REPORT_USAGE_DEFAULT)}();
         return $this->_oTemplate->parseHtmlByContent($sTmplName, array(
             'style_prefix' => $this->_sStylePrefix,
             'html_id' => $this->_aHtmlIds['main'],
@@ -159,10 +147,10 @@ class BxBaseReport extends BxDolReport
                 'condition' => $bShowCounter,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
-        			'bx_if:show_hidden' => array(
-        				'condition' => (int)$aReport['count'] == 0,
-        				'content' => array()
-        			),
+                    'bx_if:show_hidden' => array(
+                        'condition' => (int)$aReport['count'] == 0,
+                        'content' => array()
+                    ),
                     'counter' => $this->getCounter($aParams)
                 )
             ),
@@ -175,33 +163,33 @@ class BxBaseReport extends BxDolReport
     	$bReported = isset($aParams['is_reported']) && $aParams['is_reported'] === true;
         $bShowDoReportAsButtonSmall = isset($aParams['show_do_report_as_button_small']) && $aParams['show_do_report_as_button_small'] == true;
         $bShowDoReportAsButton = !$bShowDoReportAsButtonSmall && isset($aParams['show_do_report_as_button']) && $aParams['show_do_report_as_button'] == true;
-		$bDisabled = !$this->isAllowedReport() || $bReported;
+        $bDisabled = !$this->isAllowedReport() || $bReported;
 
         $sClass = '';
-		if($bShowDoReportAsButton)
-			$sClass = 'bx-btn';
-		else if ($bShowDoReportAsButtonSmall)
-			$sClass = 'bx-btn bx-btn-small';
+        if($bShowDoReportAsButton)
+            $sClass = 'bx-btn';
+        else if ($bShowDoReportAsButtonSmall)
+            $sClass = 'bx-btn bx-btn-small';
 
-		if($bDisabled)
-			$sClass .= $bShowDoReportAsButton || $bShowDoReportAsButtonSmall ? ' bx-btn-disabled' : 'bx-report-disabled';
+        if($bDisabled)
+            $sClass .= $bShowDoReportAsButton || $bShowDoReportAsButtonSmall ? ' bx-btn-disabled' : 'bx-report-disabled';
 
-        return $this->_oTemplate->parseHtmlByContent(self::$_sTmplContentDoReport, array(
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoAction(), array(
             'style_prefix' => $this->_sStylePrefix,
-        	'html_id' => $this->_aHtmlIds['do_link'],
+            'html_id' => $this->_aHtmlIds['do_link'],
             'class' => $sClass,
             'title' => _t('_report_do_report'),
         	'bx_if:show_onclick' => array(
-        		'condition' => !$bDisabled,
-        		'content' => array(
-        			'js_object' => $this->getJsObjectName()
-        		)
+                    'condition' => !$bDisabled,
+                    'content' => array(
+                        'js_object' => $this->getJsObjectName()
+                    )
         	),
             'do_report' => $this->_getLabelDoReport($aParams),
         ));
     }
 
-    protected function _getLabelCounter($iCount)
+    protected function _getCounterLabel($iCount)
     {
         return _t('_report_counter', $iCount);
     }
@@ -209,19 +197,21 @@ class BxBaseReport extends BxDolReport
     protected function _getLabelDoReport($aParams = array())
     {
     	$bReported = isset($aParams['is_reported']) && $aParams['is_reported'] === true;
-        return $this->_oTemplate->parseHtmlByContent(self::$_sTmplContentDoReportLabel, array(
-        	'bx_if:show_icon' => array(
-        		'condition' => isset($aParams['show_do_report_icon']) && $aParams['show_do_report_icon'] == true,
-        		'content' => array(
-        			'name' => $this->_getIconDoReport($bReported)
-        		)
-        	),
-        	'bx_if:show_text' => array(
-        		'condition' => isset($aParams['show_do_report_label']) && $aParams['show_do_report_label'] == true,
-        		'content' => array(
-        			'text' => _t($this->_getTitleDoReport($bReported))
-        		)
-        	)
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoActionLabel(), array(
+            'bx_if:show_icon' => array(
+                'condition' => isset($aParams['show_do_report_icon']) && $aParams['show_do_report_icon'] == true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'name' => $this->_getIconDoReport($bReported)
+                )
+            ),
+            'bx_if:show_text' => array(
+                'condition' => isset($aParams['show_do_report_label']) && $aParams['show_do_report_label'] == true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'text' => _t($this->_getTitleDoReport($bReported))
+                )
+            )
         ));
     }
 
@@ -287,7 +277,7 @@ class BxBaseReport extends BxDolReport
 		        	'code' => 0,
 		        	'id' => $iId, 
 		        	'count' => $aReport['count'], 
-		        	'countf' => (int)$aReport['count'] > 0 ? $this->_getLabelCounter($aReport['count']) : '',
+		        	'countf' => (int)$aReport['count'] > 0 ? $this->_getCounterLabel($aReport['count']) : '',
 		        	'label_icon' => $this->_getIconDoReport(!$bPerformed),
 		        	'label_title' => _t($this->_getTitleDoReport(!$bPerformed)),
 		        	'disabled' => !$bPerformed

+ 41 - 28
template/scripts/BxBaseScore.php

@@ -12,11 +12,7 @@
  */
 class BxBaseScore extends BxDolScore
 {
-    protected static $_sTmplContentElementBlock;
-    protected static $_sTmplContentElementInline;
-    protected static $_sTmplContentDoVoteLabel;
-
-	protected $_bCssJsAdded;
+    protected $_bCssJsAdded;
 
     protected $_sJsObjName;
     protected $_sStylePrefix;
@@ -57,14 +53,10 @@ class BxBaseScore extends BxDolScore
         $this->_sTmplNameLegend = 'score_legend.html';
         $this->_sTmplNameByList = 'score_by_list.html';
 
-        if(empty(self::$_sTmplContentElementBlock))
-            self::$_sTmplContentElementBlock = $this->_oTemplate->getHtml('score_element_block.html');
-
-        if(empty(self::$_sTmplContentElementInline))
-            self::$_sTmplContentElementInline = $this->_oTemplate->getHtml('score_element_inline.html');
-
-        if(empty(self::$_sTmplContentDoVoteLabel))
-            self::$_sTmplContentDoVoteLabel = $this->_oTemplate->getHtml('score_do_vote_label.html');
+        $this->_sTmplContentElementBlock = $this->_oTemplate->getHtml('score_element_block.html');
+        $this->_sTmplContentElementInline = $this->_oTemplate->getHtml('score_element_inline.html');
+        $this->_sTmplContentDoActionLabel = $this->_oTemplate->getHtml('score_do_vote_label.html');
+        $this->_sTmplContentCounterLabel = $this->_oTemplate->getHtml('score_counter_label.html');
     }
 
     public function getJsObjectName()
@@ -74,10 +66,12 @@ class BxBaseScore extends BxDolScore
 
     public function getJsScript($aParams = array())
     {
+        $sJsObjName = $this->getJsObjectName();
+
         $bDynamicMode = isset($aParams['dynamic_mode']) && $aParams['dynamic_mode'] === true;
 
         $aParamsJs = array(
-            'sObjName' => $this->_sJsObjName,
+            'sObjName' => $sJsObjName,
             'sSystem' => $this->getSystemName(),
             'iAuthorId' => $this->_getAuthorId(),
             'iObjId' => $this->getId(),
@@ -86,7 +80,7 @@ class BxBaseScore extends BxDolScore
             'sStylePrefix' => $this->_sStylePrefix,
             'aHtmlIds' => $this->_aHtmlIds
         );
-        $sCode = "var " . $this->_sJsObjName . " = new BxDolScore(" . json_encode($aParamsJs) . ");";
+        $sCode = "if(window['" . $sJsObjName . "'] == undefined) var " . $sJsObjName . " = new BxDolScore(" . json_encode($aParamsJs) . ");";
 
         return $this->_oTemplate->_wrapInTagJsCode($sCode);
     }
@@ -105,9 +99,12 @@ class BxBaseScore extends BxDolScore
     {
         $sJsObject = $this->getJsObjectName();
 
+        $bDynamicMode = isset($aParams['dynamic_mode']) && $aParams['dynamic_mode'] === true;
         $bShowEmpty = isset($aParams['show_counter_empty']) && $aParams['show_counter_empty'] == true;
         $bShowDoVoteAsButtonSmall = isset($aParams['show_do_vote_as_button_small']) && $aParams['show_do_vote_as_button_small'] == true;
         $bShowDoVoteAsButton = !$bShowDoVoteAsButtonSmall && isset($aParams['show_do_vote_as_button']) && $aParams['show_do_vote_as_button'] == true;
+        $bShowScript = !isset($aParams['show_script']) || $aParams['show_script'] == true;
+
         $bAllowedViewViewVoters = $this->isAllowedVoteViewVoters();
 
         $aScore = $this->_oQuery->getScore($this->getId());
@@ -123,7 +120,7 @@ class BxBaseScore extends BxDolScore
             $sClass .= ' bx-btn-height';
 
         $bLink = $bAllowedViewViewVoters && !$bEmpty;
-        $sCounter = !$bEmpty || $bShowEmpty ? $this->_getLabelCounter($iCup - $iCdown) : '';
+        $sCounter = !$bEmpty || $bShowEmpty ? $this->_getCounterLabel($iCup - $iCdown) : '';
 
         $aTmplVars = array(
             'id' => $this->_aHtmlIds['counter'],
@@ -145,6 +142,7 @@ class BxBaseScore extends BxDolScore
                 'condition' => !$bLink,
                 'content' => $aTmplVars
             ),
+            'script' => $bShowScript ? $this->getJsScript($bDynamicMode) : ''
         ));
     }
 
@@ -228,7 +226,7 @@ class BxBaseScore extends BxDolScore
                     'condition' => !$bShowCounterEmpty && !$bCount,
                     'content' => array()
                 ),
-                'counter' => $this->getCounter($aParams)
+                'counter' => $this->getCounter(array_merge($aParams, array('show_script' => false)))
             );
 
         //--- Legend
@@ -240,9 +238,9 @@ class BxBaseScore extends BxDolScore
             );
 
         if(!$bTmplVarsDoVote && !$bTmplVarsCounter && !$bTmplVarsLegend)
-                return '';
+            return '';
 
-        $sTmplName = self::${'_sTmplContentElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_SCORE_USAGE_DEFAULT)};
+        $sTmplName = $this->{'_getTmplContentElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_SCORE_USAGE_DEFAULT)}();
         return $this->_oTemplate->parseHtmlByContent($sTmplName, array(
             'style_prefix' => $this->_sStylePrefix,
             'html_id' => $this->_aHtmlIds['main'],
@@ -278,13 +276,13 @@ class BxBaseScore extends BxDolScore
 		$bDisabled = !$isAllowedVote || $bVoted;
 
         $sClass = '';
-		if($bShowDoVoteAsButton)
-			$sClass = 'bx-btn';
-		else if ($bShowDoVoteAsButtonSmall)
-			$sClass = 'bx-btn bx-btn-small';
+        if($bShowDoVoteAsButton)
+            $sClass = 'bx-btn';
+        else if ($bShowDoVoteAsButtonSmall)
+            $sClass = 'bx-btn bx-btn-small';
 
-		if($bDisabled)
-			$sClass .= $bShowDoVoteAsButton || $bShowDoVoteAsButtonSmall ? ' bx-btn-disabled' : 'bx-score-disabled';
+        if($bDisabled)
+            $sClass .= $bShowDoVoteAsButton || $bShowDoVoteAsButtonSmall ? ' bx-btn-disabled' : 'bx-score-disabled';
 
         return $this->_oTemplate->parseLink('javascript:void(0)', $this->_getLabelDo($sType, $aParams), array(
             'class' => $this->_sStylePrefix . '-do-vote ' . $this->_sStylePrefix . '-dv-' . $sType . ' ' . $sClass,
@@ -293,14 +291,29 @@ class BxBaseScore extends BxDolScore
         ));
     }
 
-    protected function _getLabelCounter($iCount)
+    protected function _getCounterLabel($iCount)
     {
-        return (int)$iCount != 0 ? _t('_sys_score_counter', $iCount) : _t('_sys_score_counter_empty');
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounterLabel(), array(
+            'bx_if:show_icon' => array(
+                'condition' => !isset($aParams['show_counter_label_icon']) || $aParams['show_counter_label_icon'] === true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'name' => $this->_getIconDo()
+                )
+            ),
+            'bx_if:show_text' => array(
+                'condition' => !isset($aParams['show_counter_label_text']) || $aParams['show_counter_label_text'] === true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'text' => _t('_sys_score_counter', $iCount)
+                )
+            )
+        ));
     }
 
     protected function _getLabelDo($sType, $aParams = array())
     {
-        return $this->_oTemplate->parseHtmlByContent(self::$_sTmplContentDoVoteLabel, array(
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoActionLabel(), array(
             'bx_if:show_image' => array(
                 'condition' => isset($aParams['show_do_vote_image']) && $aParams['show_do_vote_image'] == true,
                 'content' => array(

+ 88 - 71
template/scripts/BxBaseView.php

@@ -12,12 +12,8 @@
  */
 class BxBaseView extends BxDolView
 {
-    protected static $_sTmplContentElementBlock;
-    protected static $_sTmplContentElementInline;
-    protected static $_sTmplContentCounter;
-    protected static $_sTmplContentDoViewLabel;
-
     protected $_sTmplNameByList;
+    protected $_sTmplContentDoViewLabel;
 
     protected $_bCssJsAdded;
     protected $_sStylePrefix;
@@ -47,22 +43,18 @@ class BxBaseView extends BxDolView
             'show_do_view_as_button_small' => false,
             'show_do_view_icon' => true,
             'show_do_view_label' => false,
-            'show_counter' => true
+            'show_counter' => true,
+            'show_counter_label_icon' => false,
+            'show_counter_label_text' => true,
+            'show_script' => true
         );
 
-        if(empty(self::$_sTmplContentElementBlock))
-            self::$_sTmplContentElementBlock = $this->_oTemplate->getHtml('view_element_block.html');
-
-        if(empty(self::$_sTmplContentElementInline))
-            self::$_sTmplContentElementInline = $this->_oTemplate->getHtml('view_element_inline.html');
-
-        if(empty(self::$_sTmplContentCounter))
-            self::$_sTmplContentCounter = $this->_oTemplate->getHtml('view_counter.html');
-
-        if(empty(self::$_sTmplContentDoViewLabel))
-            self::$_sTmplContentDoViewLabel = $this->_oTemplate->getHtml('view_do_view_label.html');
-
         $this->_sTmplNameByList = 'view_by_list.html';
+        $this->_sTmplContentElementBlock = $this->_oTemplate->getHtml('view_element_block.html');
+        $this->_sTmplContentElementInline = $this->_oTemplate->getHtml('view_element_inline.html');
+        $this->_sTmplContentCounter = $this->_oTemplate->getHtml('view_counter.html');
+        $this->_sTmplContentCounterLabel = $this->_oTemplate->getHtml('view_counter_label.html');
+        $this->_sTmplContentDoViewLabel = $this->_oTemplate->getHtml('view_do_view_label.html');
     }
 
     public function getJsObjectName()
@@ -72,8 +64,10 @@ class BxBaseView extends BxDolView
 
     public function getJsScript($bDynamicMode = false)
     {
+        $sJsObjName = $this->getJsObjectName();
+
         $aParams = array(
-            'sObjName' => $this->_sJsObjName,
+            'sObjName' => $sJsObjName,
             'sSystem' => $this->getSystemName(),
             'iAuthorId' => $this->_getAuthorId(),
             'iObjId' => $this->getId(),
@@ -81,7 +75,7 @@ class BxBaseView extends BxDolView
             'sStylePrefix' => $this->_sStylePrefix,
             'aHtmlIds' => $this->_aHtmlIds
         );
-        $sCode = "var " . $this->_sJsObjName . " = new BxDolView(" . json_encode($aParams) . ");";
+        $sCode = "if(window['" . $sJsObjName . "'] == undefined) var " . $sJsObjName . " = new BxDolView(" . json_encode($aParams) . ");";
 
         return $this->_oTemplate->_wrapInTagJsCode($sCode);
     }
@@ -90,8 +84,11 @@ class BxBaseView extends BxDolView
     {
         $sJsObject = $this->getJsObjectName();
 
+        $bDynamicMode = isset($aParams['dynamic_mode']) && $aParams['dynamic_mode'] === true;
         $bShowDoViewAsButtonSmall = isset($aParams['show_do_view_as_button_small']) && $aParams['show_do_view_as_button_small'] == true;
         $bShowDoViewAsButton = !$bShowDoViewAsButtonSmall && isset($aParams['show_do_view_as_button']) && $aParams['show_do_view_as_button'] == true;
+        $bShowScript = !isset($aParams['show_script']) || $aParams['show_script'] == true;
+
         $bAllowedViewViewViewers = $this->isAllowedViewViewViewers();
 
         $aView = $this->_oQuery->getView($this->getId());
@@ -101,9 +98,11 @@ class BxBaseView extends BxDolView
         if($bShowDoViewAsButton)
             $sClass .= ' bx-btn-height';
 
-        $sContent = (int)$aView['count'] > 0 ? $this->_getLabelCounter($aView['count']) : '';
-        return $this->_oTemplate->parseHtmlByContent(self::$_sTmplContentCounter, array(
-        	'bx_if:show_text' => array(
+        $sContent = (int)$aView['count'] > 0 ? $this->_getCounterLabel($aView['count'], $aParams) : '';
+        return $this->_oTemplate->parseHtmlByContent($this->_sTmplContentCounter, array(
+            'html_id' => $this->_aHtmlIds['counter'],
+            'style_prefix' => $this->_sStylePrefix,
+            'bx_if:show_text' => array(
                 'condition' => !$bAllowedViewViewViewers,
                 'content' => array(
                     'bx_repeat:attrs' => array(
@@ -125,7 +124,8 @@ class BxBaseView extends BxDolView
                     ),
                     'content' => $sContent
                 )
-            )
+            ),
+            'script' => $bShowScript ? $this->getJsScript($bDynamicMode) : ''
         ));
     }
 
@@ -156,9 +156,9 @@ class BxBaseView extends BxDolView
         $bShowDoViewAsButton = !$bShowDoViewAsButtonSmall && isset($aParams['show_do_view_as_button']) && $aParams['show_do_view_as_button'] == true;
         $bShowCounter = isset($aParams['show_counter']) && $aParams['show_counter'] === true && $bAllowedViewView;
 
-		$iObjectId = $this->getId();
-		$iAuthorId = $this->_getAuthorId();
-		$aView = $this->_oQuery->getView($iObjectId);
+        $iObjectId = $this->getId();
+        $iAuthorId = $this->_getAuthorId();
+        $aView = $this->_oQuery->getView($iObjectId);
         $bCount = (int)$aView['count'] != 0;
 
         if(!$bAllowedView && (!$bAllowedViewView || !$bCount))
@@ -168,41 +168,41 @@ class BxBaseView extends BxDolView
         $bTmplVarsDoView = $bShowDoView && ($bCount || $bAllowedView);
         $aTmplVarsDoView = array();
         if($bTmplVarsDoView)
-        	$aTmplVarsDoView = array(
-				'style_prefix' => $this->_sStylePrefix,
-				'do_view' => $this->_getDoView($aParams, $bAllowedView),
-			);
+            $aTmplVarsDoView = array(
+                'style_prefix' => $this->_sStylePrefix,
+                'do_view' => $this->_getDoView($aParams, $bAllowedView),
+            );
 
         //--- Counter
         $bTmplVarsCounter = $bShowCounter && ($bCount || $bAllowedView);
         $aTmplVarsCounter = array();
         if($bTmplVarsCounter)
-        	$aTmplVarsCounter = array(
-				'style_prefix' => $this->_sStylePrefix,
-				'bx_if:show_hidden' => array(
-					'condition' => !$bCount,
-					'content' => array()
-				),
-				'counter' => $this->getCounter($aParams)
-        	);
-
-		if(!$bTmplVarsDoView && !$bTmplVarsCounter)
-			return '';
-
-        $sTmplName = self::${'_sTmplContentElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_VIEW_USAGE_DEFAULT)};
+            $aTmplVarsCounter = array(
+                'style_prefix' => $this->_sStylePrefix,
+                'bx_if:show_hidden' => array(
+                    'condition' => !$bCount,
+                    'content' => array()
+                ),
+                'counter' => $this->getCounter(array_merge($aParams, array('show_script' => false)))
+            );
+
+        if(!$bTmplVarsDoView && !$bTmplVarsCounter)
+            return '';
+
+        $sTmplName = $this->{'_getTmplContentElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_VIEW_USAGE_DEFAULT)}();
         return $this->_oTemplate->parseHtmlByContent($sTmplName, array(
             'style_prefix' => $this->_sStylePrefix,
             'html_id' => $this->_aHtmlIds['main'],
             'class' => $this->_sStylePrefix . ($bShowDoViewAsButton ? '-button' : '') . ($bShowDoViewAsButtonSmall ? '-button-small' : ''),
             'count' => $aView['count'],
         	'bx_if:show_do_view' => array(
-        		'condition' => $bTmplVarsDoView,
-        		'content' => $aTmplVarsDoView
+                    'condition' => $bTmplVarsDoView,
+                    'content' => $aTmplVarsDoView
         	),
         	'bx_if:show_counter' => array(
-				'condition' => $bTmplVarsCounter,
-				'content' => $aTmplVarsCounter
-			),
+                    'condition' => $bTmplVarsCounter,
+                    'content' => $aTmplVarsCounter
+                ),
             'script' => $this->getJsScript($bDynamicMode)
         ));
     }
@@ -211,16 +211,16 @@ class BxBaseView extends BxDolView
     {
         $bShowDoViewAsButtonSmall = isset($aParams['show_do_view_as_button_small']) && $aParams['show_do_view_as_button_small'] == true;
         $bShowDoViewAsButton = !$bShowDoViewAsButtonSmall && isset($aParams['show_do_view_as_button']) && $aParams['show_do_view_as_button'] == true;
-		$bDisabled = !$bAllowedView;
+        $bDisabled = !$bAllowedView;
 
         $sClass = '';
-		if($bShowDoViewAsButton)
-			$sClass = 'bx-btn';
-		else if ($bShowDoViewAsButtonSmall)
-			$sClass = 'bx-btn bx-btn-small';
+        if($bShowDoViewAsButton)
+            $sClass = 'bx-btn';
+        else if ($bShowDoViewAsButtonSmall)
+            $sClass = 'bx-btn bx-btn-small';
 
-		if($bDisabled)
-			$sClass .= $bShowDoViewAsButton || $bShowDoViewAsButtonSmall ? ' bx-btn-disabled' : 'bx-view-disabled';
+        if($bDisabled)
+            $sClass .= $bShowDoViewAsButton || $bShowDoViewAsButtonSmall ? ' bx-btn-disabled' : 'bx-view-disabled';
 
         return $this->_oTemplate->parseLink('javascript:void(0)', $this->_getLabelDo($aParams), array(
             'class' => $this->_sStylePrefix . '-do-view ' . $sClass,
@@ -228,26 +228,43 @@ class BxBaseView extends BxDolView
         ));
     }
 
-    protected function _getLabelCounter($iCount)
+    protected function _getCounterLabel($iCount, $aParams = array())
     {
-        return _t('_view_counter', $iCount);
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounterLabel(), array(
+            'bx_if:show_icon' => array(
+                'condition' => !isset($aParams['show_counter_label_icon']) || $aParams['show_counter_label_icon'] === true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'name' => $this->_getIconDo()
+                )
+            ),
+            'bx_if:show_text' => array(
+                'condition' => !isset($aParams['show_counter_label_text']) || $aParams['show_counter_label_text'] === true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'text' => _t('_view_counter', $iCount)
+                )
+            )
+        ));
     }
 
     protected function _getLabelDo($aParams = array())
     {
-        return $this->_oTemplate->parseHtmlByContent(self::$_sTmplContentDoViewLabel, array(
-        	'bx_if:show_icon' => array(
-        		'condition' => isset($aParams['show_do_view_icon']) && $aParams['show_do_view_icon'] == true,
-        		'content' => array(
-        			'name' => $this->_getIconDo()
-        		)
-        	),
-        	'bx_if:show_text' => array(
-        		'condition' => isset($aParams['show_do_view_label']) && $aParams['show_do_view_label'] == true,
-        		'content' => array(
-        			'text' => _t($this->_getTitleDo())
-        		)
-        	)
+        return $this->_oTemplate->parseHtmlByContent($this->_sTmplContentDoViewLabel, array(
+            'bx_if:show_icon' => array(
+                'condition' => isset($aParams['show_do_view_icon']) && $aParams['show_do_view_icon'] == true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'name' => $this->_getIconDo()
+                )
+            ),
+            'bx_if:show_text' => array(
+                'condition' => isset($aParams['show_do_view_label']) && $aParams['show_do_view_label'] == true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'text' => _t($this->_getTitleDo())
+                )
+            )
         ));
     }
 

+ 21 - 38
template/scripts/BxBaseVote.php

@@ -12,10 +12,6 @@
  */
 class BxBaseVote extends BxDolVote
 {
-    protected static $_sTmplContentElementBlock;
-    protected static $_sTmplContentElementInline;
-    protected static $_sTmplContentCounter;
-
     protected $_aElementDefaults;
 
     protected $_bCssJsAdded;
@@ -50,14 +46,9 @@ class BxBaseVote extends BxDolVote
         $this->_sTmplNameLegend = 'vote_legend.html';
         $this->_sTmplNameByList = 'vote_by_list.html';
 
-        if(empty(self::$_sTmplContentElementBlock))
-            self::$_sTmplContentElementBlock = $this->_oTemplate->getHtml('vote_element_block.html');
-
-        if(empty(self::$_sTmplContentElementInline))
-            self::$_sTmplContentElementInline = $this->_oTemplate->getHtml('vote_element_inline.html');
-
-        if(empty(self::$_sTmplContentCounter))
-            self::$_sTmplContentCounter = $this->_oTemplate->getHtml('vote_counter.html');
+        $this->_sTmplContentElementBlock = $this->_oTemplate->getHtml('vote_element_block.html');
+        $this->_sTmplContentElementInline = $this->_oTemplate->getHtml('vote_element_inline.html');
+        $this->_sTmplContentCounter = $this->_oTemplate->getHtml('vote_counter.html');
     }
 
     public function getJsClassName()
@@ -72,8 +63,11 @@ class BxBaseVote extends BxDolVote
 
     public function getJsScript($bDynamicMode = false)
     {
+        $sJsObjName = $this->getJsObjectName();
+        $sJsObjClass = $this->getJsClassName();
+
         $aParams = array(
-            'sObjName' => $this->_sJsObjName,
+            'sObjName' => $sJsObjName,
             'sSystem' => $this->getSystemName(),
             'iAuthorId' => $this->_getAuthorId(),
             'iObjId' => $this->getId(),
@@ -81,7 +75,7 @@ class BxBaseVote extends BxDolVote
             'sStylePrefix' => $this->_sStylePrefix,
             'aHtmlIds' => $this->_aHtmlIds
         );
-        $sCode = "var " . $this->getJsObjectName() . " = new " . $this->getJsClassName() . "(" . json_encode($aParams) . ");";
+        $sCode = "if(window['" . $sJsObjName . "'] == undefined) var " . $sJsObjName . " = new " . $sJsObjClass . "(" . json_encode($aParams) . ");";
 
         return $this->_oTemplate->_wrapInTagJsCode($sCode);
     }
@@ -98,10 +92,12 @@ class BxBaseVote extends BxDolVote
 
     public function getCounter($aParams = array())
     {
+        $bDynamicMode = isset($aParams['dynamic_mode']) && $aParams['dynamic_mode'] === true;
         $bShowEmpty = isset($aParams['show_counter_empty']) && $aParams['show_counter_empty'] == true;
-        $bAllowedViewViewVoters = $this->isAllowedVoteViewVoters();
+        $bShowActive = $this->isAllowedVoteViewVoters() && (!isset($aParams['show_counter_active']) || $aParams['show_counter_active'] === true);
+        $bShowScript = !isset($aParams['show_script']) || $aParams['show_script'] == true;
 
-        $sClass = $this->_sStylePrefix . '-counter';
+        $sClass = $this->_sStylePrefix . '-counter ' . $this->_sStylePrefix . '-counter-' . $this->_sType;
         if(!empty($aParams['class_counter']))
             $sClass .= $aParams['class_counter'];
 
@@ -109,7 +105,7 @@ class BxBaseVote extends BxDolVote
             array('key' => 'class', 'value' => $sClass),
         );
 
-        if($bAllowedViewViewVoters)
+        if($bShowActive)
             $aTmplVarsAttrs = array_merge($aTmplVarsAttrs, array(
                 array('key' => 'href', 'value' => 'javascript:void(0)'),
                 array('key' => 'title', 'value' => bx_html_attribute($this->_getTitleDoBy($aParams))),
@@ -121,25 +117,26 @@ class BxBaseVote extends BxDolVote
             $aTmplVarsAttrs[] = array('key' => 'id', 'value' => $sHtmlId);
 
         $aVote = !empty($aParams['vote']) && is_array($aParams['vote']) ? $aParams['vote'] : $this->_getVote();
-        $sContent = $bShowEmpty || (int)$aVote['count'] > 0 ? $this->_getLabelCounter($aVote['count'], $aParams) : '';
+        $sContent = $bShowEmpty || (int)$aVote['count'] > 0 ? $this->_getCounterLabel($aVote['count'], $aParams) : '';
 
         return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounter(), array(
             'bx_if:show_text' => array(
-                'condition' => !$bAllowedViewViewVoters,
+                'condition' => !$bShowActive,
                 'content' => array(
                     'bx_repeat:attrs' => $aTmplVarsAttrs,
                     'content' => $sContent
                 )
             ),
             'bx_if:show_link' => array(
-                'condition' => $bAllowedViewViewVoters,
+                'condition' => $bShowActive,
                 'content' => array(
                     'bx_repeat:attrs' => $aTmplVarsAttrs,
                     'content' => $sContent
                 )
             ),
             'bx_repeat:attrs' => $aTmplVarsAttrs,
-            'content' => $sContent
+            'content' => $sContent,
+            'script' => $bShowScript ? $this->getJsScript($bDynamicMode) : ''
         ));
     }
 
@@ -215,7 +212,7 @@ class BxBaseVote extends BxDolVote
                     'condition' => !$bCount && !$bShowCounterEmpty,
                     'content' => array()
                 ),
-                'counter' => $this->getCounter($aParams)
+                'counter' => $this->getCounter(array_merge($aParams, array('show_script' => false)))
             );
 
         //--- Legend
@@ -262,7 +259,7 @@ class BxBaseVote extends BxDolVote
         return '';
     }
 
-    protected function _getLabelCounter($iCount, $aParams = array())
+    protected function _getCounterLabel($iCount, $aParams = array())
     {
         return _t('_vote_counter', $iCount);
     }
@@ -285,6 +282,7 @@ class BxBaseVote extends BxDolVote
 
         return $this->_oTemplate->parseHtmlByName($this->_sTmplNameByList, array(
             'style_prefix' => $this->_sStylePrefix,
+            'class' => '',
             'bx_repeat:list' => $aTmplUsers
         ));
     }
@@ -303,21 +301,6 @@ class BxBaseVote extends BxDolVote
     {
         return false;
     }
-
-    protected function _getTmplContentElementBlock()
-    {
-        return self::$_sTmplContentElementBlock;
-    }
-
-    protected function _getTmplContentElementInline()
-    {
-        return self::$_sTmplContentElementInline;
-    }
-
-    protected function _getTmplContentCounter()
-    {
-        return self::$_sTmplContentCounter;
-    }
 }
 
 /** @} */

+ 30 - 11
template/scripts/BxBaseVoteLikes.php

@@ -12,8 +12,6 @@
  */
 class BxBaseVoteLikes extends BxDolVoteLikes
 {
-    protected static $_sTmplContentDoVoteLabelLikes;
-
     public function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
     {
         parent::__construct($sSystem, $iId, $iInit, $oTemplate);
@@ -32,11 +30,14 @@ class BxBaseVoteLikes extends BxDolVoteLikes
             'show_do_vote_label' => false,
             'show_counter' => true,
             'show_counter_empty' => false,
-            'show_legend' => false
+            'show_counter_label_icon' => false,
+            'show_counter_label_text' => true,
+            'show_legend' => false,
+            'show_script' => true
         );
 
-        if(empty(self::$_sTmplContentDoVoteLabelLikes))
-            self::$_sTmplContentDoVoteLabelLikes = $this->_oTemplate->getHtml('vote_do_vote_likes_label.html');
+        $this->_sTmplContentDoActionLabel = $this->_oTemplate->getHtml('vote_do_vote_label_likes.html');
+        $this->_sTmplContentCounterLabel = $this->_oTemplate->getHtml('vote_counter_label_likes.html');
     }
 
     public function getJsClick($iValue = 0)
@@ -104,22 +105,45 @@ class BxBaseVoteLikes extends BxDolVoteLikes
     protected function _getDoVoteLabel($aParams = array())
     {
     	$bVoted = isset($aParams['is_voted']) && $aParams['is_voted'] === true;
-        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoVoteLabel(), array(
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoActionLabel(), array(
             'bx_if:show_icon' => array(
                 'condition' => isset($aParams['show_do_vote_icon']) && $aParams['show_do_vote_icon'] == true,
                 'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
                     'name' => $this->_getIconDo($bVoted)
                 )
             ),
             'bx_if:show_text' => array(
                 'condition' => isset($aParams['show_do_vote_label']) && $aParams['show_do_vote_label'] == true,
                 'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
                     'text' => _t($this->_getTitleDo($bVoted))
                 )
             )
         ));
     }
 
+    protected function _getCounterLabel($iCount, $aParams = array())
+    {
+        $bVoted = isset($aParams['is_voted']) && $aParams['is_voted'] === true;
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounterLabel(), array(
+            'bx_if:show_icon' => array(
+                'condition' => !isset($aParams['show_counter_label_icon']) || $aParams['show_counter_label_icon'] === true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'name' => $this->_getIconDo($bVoted)
+                )
+            ),
+            'bx_if:show_text' => array(
+                'condition' => !isset($aParams['show_counter_label_text']) || $aParams['show_counter_label_text'] === true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'text' => parent::_getCounterLabel($iCount)
+                )
+            )
+        ));
+    }
+
     protected function _isShowDoVote($aParams, $isAllowedVote, $bCount)
     {
         $bResult = parent::_isShowDoVote($aParams, $isAllowedVote, $bCount);
@@ -128,11 +152,6 @@ class BxBaseVoteLikes extends BxDolVoteLikes
 
         return $isAllowedVote || $bCount;
     }
-
-    protected function _getTmplContentDoVoteLabel()
-    {
-        return self::$_sTmplContentDoVoteLabelLikes;
-    }
 }
 
 /** @} */

+ 173 - 31
template/scripts/BxBaseVoteReactions.php

@@ -12,9 +12,8 @@
  */
 class BxBaseVoteReactions extends BxDolVoteReactions
 {
-    protected static $_sTmplContentDoVoteLabelReactions;
-    protected static $_sTmplContentCounterWrapper;
-    protected static $_sTmplContentCounterLabel;
+    protected $_sTmplNameBySummary;
+    protected $_sTmplContentCounterWrapper = '';
 
     public function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
     {
@@ -36,17 +35,17 @@ class BxBaseVoteReactions extends BxDolVoteReactions
             'show_do_vote_label' => false,
             'show_counter' => false,
             'show_counter_empty' => true,
-            'show_legend' => false
+            'show_counter_style' => self::$_sCounterStyleDivided, //--- Alloved styles are 'divided' and 'compound'
+            'show_legend' => false,
+            'show_script' => true
         );
 
-        if(empty(self::$_sTmplContentDoVoteLabelReactions))
-            self::$_sTmplContentDoVoteLabelReactions = $this->_oTemplate->getHtml('vote_do_vote_reactions_label.html');
+        $this->_sTmplNameBySummary = 'vote_by_summary_reactions.html';
+        $this->_sTmplNameByList = 'vote_by_list_reactions.html';
 
-        if(empty(self::$_sTmplContentCounterWrapper))
-            self::$_sTmplContentCounterWrapper = $this->_oTemplate->getHtml('vote_counter_wrapper_reactions.html');
-
-        if(empty(self::$_sTmplContentCounterLabel))
-            self::$_sTmplContentCounterLabel = $this->_oTemplate->getHtml('vote_counter_label_reactions.html');
+        $this->_sTmplContentDoActionLabel = $this->_oTemplate->getHtml('vote_do_vote_label_reactions.html');
+        $this->_sTmplContentCounterLabel = $this->_oTemplate->getHtml('vote_counter_label_reactions.html');
+        $this->_sTmplContentCounterWrapper = $this->_oTemplate->getHtml('vote_counter_wrapper_reactions.html');
     }
 
     public function getJsClick($iValue = 0)
@@ -67,13 +66,34 @@ class BxBaseVoteReactions extends BxDolVoteReactions
 
     public function getJsClickCounter($aParams = array())
     {
-        $sReaction = !empty($aParams['reaction']) ? $aParams['reaction'] : $this->_sDefault;
+        $sJsObject = $this->getJsObjectName();
+        $sJsMethod = 'toggleByPopup';
+
+        if(isset($aParams['show_counter_style']) && $aParams['show_counter_style'] == self::$_sCounterStyleCompound)
+            return $sJsObject . '.' . $sJsMethod . '(this)';
 
-        return $this->getJsObjectName() . '.toggleByPopup(this, \'' . $sReaction . '\')';
+        $sReaction = !empty($aParams['reaction']) ? $aParams['reaction'] : $this->_sDefault;
+        return $sJsObject . '.' . $sJsMethod . '(this, \'' . $sReaction . '\')';
     }
 
     public function getCounter($aParams = array())
     {
+        $sDefault = $this->_aElementDefaults['show_counter_style'];
+        $sCounterStyle = !empty($aParams['show_counter_style']) ? $aParams['show_counter_style'] : $sDefault;
+
+        $sMethodPrefix = '_getCounter';
+        $sMethod = $sMethodPrefix . bx_gen_method_name($sCounterStyle);
+        if(!method_exists($this, $sMethod))
+            $sMethod = $sMethodPrefix . bx_gen_method_name($sDefault);
+
+        return $this->$sMethod($aParams);
+    }
+
+    public function _getCounterDivided($aParams = array())
+    {
+        $bDynamicMode = isset($aParams['dynamic_mode']) && $aParams['dynamic_mode'] === true;
+        $bShowScript = !isset($aParams['show_script']) || $aParams['show_script'] == true;
+
         $aVote = $this->_getVote();
         $aReactions = $this->getReactions();
 
@@ -96,14 +116,79 @@ class BxBaseVoteReactions extends BxDolVoteReactions
                 'rate' => $aVote['rate_' . $sName],
             );
 
-            $sResult .= parent::getCounter($aParams);
+            $sResult .= parent::getCounter(array_merge($aParams, array('show_script' => false)));
+        }
+
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounterWrapper(), array(
+            'html_id' => $this->_aHtmlIds['counter'],
+            'style_prefix' => $this->_sStylePrefix,
+            'type' => $this->_sType,
+            'style' => self::$_sCounterStyleDivided,
+            'counter' => $sResult,
+            'script' => $bShowScript ? $this->getJsScript($bDynamicMode) : ''
+        ));
+    }
+
+    public function _getCounterCompound($aParams = array())
+    {
+        $bDynamicMode = isset($aParams['dynamic_mode']) && $aParams['dynamic_mode'] === true;
+        $bShowScript = !isset($aParams['show_script']) || $aParams['show_script'] == true;
+
+        $aVote = $this->_getVote();
+        $aReactions = $this->getReactions();
+
+        $sClass = isset($aParams['class_counter']) ? $aParams['class_counter'] : '';
+        if(isset($aParams['show_do_vote_as_button_small']) && $aParams['show_do_vote_as_button_small'] == true)
+            $sClass .= ' bx-btn-small-height';
+        else if(isset($aParams['show_do_vote_as_button']) && $aParams['show_do_vote_as_button'] == true)
+            $sClass .= ' bx-btn-height';
+
+        $aParams['id_counter'] = '';
+
+        $sResult = '';
+        $iResultC = $iResultS = 0;
+        foreach($aReactions as $sName) {
+            $iCount = (int)$aVote['count_' . $sName];
+
+            $aParams = array_merge($aParams, array(
+                'show_counter_active' => false,
+                'show_counter_label_icon' => true,
+                'show_counter_label_text' => false,
+                'class_counter' => ($iCount == 0 ? ' bx-vc-hidden' : '') . ' ' . $sName . ' ' . $sClass,
+                'reaction' => $sName,
+                'vote' => array(
+                    'count' => $iCount,
+                    'sum' => $aVote['sum_' . $sName],
+                    'rate' => $aVote['rate_' . $sName],
+                )
+            ));
+
+            $iResultC += $iCount;
+            $iResultS += (int)$aVote['sum_' . $sName];
+            $sResult .= trim(parent::getCounter(array_merge($aParams, array('show_script' => false))));
         }
 
+        $aParams = array_merge($aParams, array(
+            'show_counter_active' => true,
+            'show_counter_label_icon' => false,
+            'show_counter_label_text' => true,
+            'class_counter' => ' total-count ' . $sClass,
+            'reaction' => '',
+            'vote' => array(
+                'count' => $iResultC,
+                'sum' => $iResultS,
+                'rate' => $iResultC > 0 ? round($iResultS / $iResultC, 2) : 0,
+            )
+        ));
+        $sResult .= parent::getCounter(array_merge($aParams, array('show_script' => false)));
+
         return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounterWrapper(), array(
             'html_id' => $this->_aHtmlIds['counter'],
             'style_prefix' => $this->_sStylePrefix,
             'type' => $this->_sType,
-            'counter' => $sResult
+            'style' => self::$_sCounterStyleCompound,
+            'counter' => $sResult,
+            'script' => $bShowScript ? $this->getJsScript($bDynamicMode) : ''
         ));
     }
 
@@ -170,16 +255,18 @@ class BxBaseVoteReactions extends BxDolVoteReactions
     {
     	$bVoted = isset($aParams['is_voted']) && $aParams['is_voted'] === true;
 
-        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoVoteLabel(), array(
+        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoActionLabel(), array(
             'bx_if:show_icon' => array(
                 'condition' => isset($aParams['show_do_vote_icon']) && $aParams['show_do_vote_icon'] == true,
                 'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
                     'name' => $this->_getIconDoWithTrack($bVoted, $aParams['track'])
                 )
             ),
             'bx_if:show_text' => array(
                 'condition' => isset($aParams['show_do_vote_label']) && $aParams['show_do_vote_label'] == true,
                 'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
                     'text' => _t($this->_getTitleDoWithTrack($bVoted, $aParams['track']))
                 )
             )
@@ -202,26 +289,56 @@ class BxBaseVoteReactions extends BxDolVoteReactions
         return $oMenu->getCode();
     }
 
-    protected function _getLabelCounter($iCount, $aParams = array())
+    protected function _getCounterLabel($iCount, $aParams = array())
     {
         $sReaction = !empty($aParams['reaction']) ? $aParams['reaction'] : $this->_sDefault;
 
         return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounterLabel(), array(
-            'name' => $this->_aDataList[$sReaction]['icon'],
-            'text' => parent::_getLabelCounter($iCount)
+            'bx_if:show_icon' => array(
+                'condition' => !isset($aParams['show_counter_label_icon']) || $aParams['show_counter_label_icon'] === true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'name' => $this->_aDataList[$sReaction]['icon']
+                )
+            ),
+            'bx_if:show_text' => array(
+                'condition' => !isset($aParams['show_counter_label_text']) || $aParams['show_counter_label_text'] === true,
+                'content' => array(
+                    'style_prefix' => $this->_sStylePrefix,
+                    'text' => parent::_getCounterLabel($iCount)
+                )
+            )
         ));
     }
 
     protected function _getVotedBy($aParams = array())
     {
+        if(!isset($aParams['reaction']))
+            return $this->_getVotedBySummary($aParams);
+
+        $bSummary = $aParams['reaction'] == 'summary';
+
+        $aBrowseParams = array('type' => 'by', 'object_id' => $this->getId());
+        if(!$bSummary)
+            $aBrowseParams['reaction'] = $aParams['reaction'];
+
+        $aValues = $this->_oQuery->getPerformed($aBrowseParams);
+
         $aTmplUsers = array();
+        foreach($aValues as $mValue) {
+            $mValue = is_array($mValue) ? $mValue : array('author_id' => (int)$mValue, 'reaction' => '');
 
-        $aUserIds = $this->_oQuery->getPerformed(array('type' => 'by', 'object_id' => $this->getId(), 'reaction' => $aParams['reaction']));
-        foreach($aUserIds as $iUserId) {
-            list($sUserName, $sUserUrl, $sUserIcon, $sUserUnit) = $this->_getAuthorInfo($iUserId);
+            list($sUserName, $sUserUrl, $sUserIcon, $sUserUnit) = $this->_getAuthorInfo($mValue['author_id']);
             $aTmplUsers[] = array(
                 'style_prefix' => $this->_sStylePrefix,
-                'user_unit' => $sUserUnit
+                'user_unit' => $sUserUnit,
+                'bx_if:show_reaction' => array(
+                    'condition' => $bSummary,
+                    'content' => array(
+                        'style_prefix' => $this->_sStylePrefix,
+                        'icon' => $bSummary ? $this->_aDataList[$mValue['reaction']]['icon'] : ''
+                    )
+                )
             );
         }
 
@@ -230,23 +347,48 @@ class BxBaseVoteReactions extends BxDolVoteReactions
 
         return $this->_oTemplate->parseHtmlByName($this->_sTmplNameByList, array(
             'style_prefix' => $this->_sStylePrefix,
+            'class' => ' ' . $this->_sStylePrefix . '-bl-' . $aParams['reaction'],
             'bx_repeat:list' => $aTmplUsers
         ));
     }
 
-    protected function _getTmplContentDoVoteLabel()
+    protected function _getVotedBySummary($aParams = array())
     {
-        return self::$_sTmplContentDoVoteLabelReactions;
-    }
+        $sJsObject = $this->getJsObjectName();
 
-    protected function _getTmplContentCounterWrapper()
-    {
-        return self::$_sTmplContentCounterWrapper;
+        $sTxtSummary = _t('_vote_do_by_summary');
+        $aReactions = array_merge(array('summary'), $this->getReactions());
+
+        $aMenuItems = array();
+        $aTmplVarsLists = array();
+        foreach ($aReactions as $sReaction) {
+            $bSummary = $sReaction == 'summary';
+
+            $sName = $this->_sStylePrefix . '-' . $sReaction;
+            $sTitle = !$bSummary ? $this->_oTemplate->parseIcon($this->_aDataList[$sReaction]['icon']) : $sTxtSummary;
+            $sTitleAttr = !$bSummary ? _t('_vote_do_by_x_reaction', _t($this->_aDataList[$sReaction]['title'])) : $sTxtSummary;
+
+            $aMenuItems[] = array('id' => $sName, 'name' => $sName, 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeVotedBy(this, \'' . $sReaction . '\')', 'target' => '_self', 'title' => $sTitle, 'title_attr' => $sTitleAttr, 'active' => 1);
+
+            $aTmplVarsLists[] = array(
+                'content' => $this->_getVotedBy(array('reaction' => $sReaction))
+            );
+        }
+
+        $oMenu = new BxTemplMenuInteractive(array('template' => 'menu_interactive_vertical.html', 'menu_id'=> $this->_sStylePrefix . '-voted-by', 'menu_items' => $aMenuItems));
+        $oMenu->setSelected('', $this->_sStylePrefix . '-summary');
+
+        return $this->_oTemplate->parseHtmlByName($this->_sTmplNameBySummary, array(
+            'style_prefix' => $this->_sStylePrefix,
+            'title' => '',
+            'menu' => $oMenu->getCode(),
+            'bx_repeat:lists' => $aTmplVarsLists
+        ));
     }
 
-    protected function _getTmplContentCounterLabel()
+    protected function _getTmplContentCounterWrapper()
     {
-        return self::$_sTmplContentCounterLabel;
+        return $this->_sTmplContentCounterWrapper;
     }
 }
 

+ 2 - 1
template/scripts/BxBaseVoteStars.php

@@ -30,7 +30,8 @@ class BxBaseVoteStars extends BxDolVoteStars
             'show_do_vote_legend' => false,
             'show_counter' => true,
             'show_counter_empty' => false,
-            'show_legend' => false
+            'show_legend' => false,
+            'show_script' => true
         );
 
         $this->_sTmplNameDoVoteStars = 'vote_do_vote_stars.html';

+ 2 - 6
template/view_counter.html

@@ -1,6 +1,2 @@
-<bx_if:show_text>
-    <span <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</span>
-</bx_if:show_text>
-<bx_if:show_link>
-    <a <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</a>
-</bx_if:show_link>
+<bx_if:show_text><span <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</span></bx_if:show_text><bx_if:show_link><a <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</a></bx_if:show_link>
+__script__

+ 1 - 0
template/view_counter_label.html

@@ -0,0 +1 @@
+<bx_if:show_icon><span class="__style_prefix__-counter-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 1 - 1
template/view_do_view_label.html

@@ -1 +1 @@
-<bx_if:show_icon><i class="sys-icon __name__"></i></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>
+<bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 4 - 4
template/view_element_block.html

@@ -1,10 +1,10 @@
-<div id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_view_data_count="__count__">
-    <div class="__style_prefix__-do bx-clearfix">
+<div id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_view_data_count="__count__">
+    <div class="sys-action-do __style_prefix__-do bx-clearfix">
         <bx_if:show_do_view>
-                <div class="__style_prefix__-element-holder">__do_view__</div>
+            <div class="sys-action-element-holder __style_prefix__-element-holder">__do_view__</div>
         </bx_if:show_do_view>
         <bx_if:show_counter>
-                <div class="__style_prefix__-counter-holder bx-def-margin-sec-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
+            <div class="sys-action-counter-holder __style_prefix__-counter-holder bx-def-margin-sec-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
         </bx_if:show_counter>
     </div>
     __script__

+ 2 - 2
template/view_element_inline.html

@@ -1,3 +1,3 @@
-<span id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_view_data_count="__count__">
-    <span class="__style_prefix__-do"><bx_if:show_do_view><span class="__style_prefix__-element-holder">__do_view__</span></bx_if:show_do_view><bx_if:show_counter><span class="__style_prefix__-counter-holder bx-def-margin-thd-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter></span>__script__
+<span id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom" bx_view_data_count="__count__">
+    <span class="sys-action-do __style_prefix__-do"><bx_if:show_do_view><span class="sys-action-element-holder __style_prefix__-element-holder">__do_view__</span></bx_if:show_do_view><bx_if:show_counter><span class="sys-action-counter-holder __style_prefix__-counter-holder bx-def-margin-thd-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter></span>__script__
 </span>

+ 8 - 8
template/vote_by_list.html

@@ -1,9 +1,9 @@
-<div class="__style_prefix__-by-list">
-	<div class="__style_prefix__-by-list-cnt">
-		<div class="__style_prefix__-by-items">
-			<bx_repeat:list>
-				<div class="__style_prefix__-by-item bx-def-padding-sec bx-clearfix">__user_unit__</div>
-			</bx_repeat:list>
-		</div>
-	</div>
+<div class="__style_prefix__-by-list__class__">
+    <div class="__style_prefix__-by-list-cnt">
+        <div class="__style_prefix__-by-items">
+            <bx_repeat:list>
+                <div class="__style_prefix__-by-item bx-def-padding-sec bx-clearfix">__user_unit__</div>
+            </bx_repeat:list>
+        </div>
+    </div>
 </div>

+ 14 - 0
template/vote_by_list_reactions.html

@@ -0,0 +1,14 @@
+<div class="__style_prefix__-by-list__class__">
+    <div class="__style_prefix__-by-list-cnt">
+        <div class="__style_prefix__-by-items">
+            <bx_repeat:list>
+                <div class="__style_prefix__-by-item bx-def-padding-sec bx-clearfix">
+                    <div class="__style_prefix__-bi-user">__user_unit__</div>
+                    <bx_if:show_reaction>
+                        <div class="__style_prefix__-bi-icon"><i class="sys-icon __icon__"></i></div>
+                    </bx_if:show_reaction>
+                </div>
+            </bx_repeat:list>
+        </div>
+    </div>
+</div>

+ 11 - 0
template/vote_by_summary_reactions.html

@@ -0,0 +1,11 @@
+<div class="__style_prefix__-by-lists">
+    <div class="__style_prefix__-bls-header">
+        <div class="__style_prefix__-bls-title bx-def-padding-leftright bx-def-border-bottom bx-def-box-sizing">__title__</div>
+        <div class="__style_prefix__-bls-submenu">
+            <div class="__style_prefix__-bls-submenu-cnt">__menu__</div>
+        </div>
+    </div>
+    <div class="__style_prefix__-bls-content">
+        <bx_repeat:lists>__content__</bx_repeat:lists>
+    </div>
+</div>

+ 2 - 6
template/vote_counter.html

@@ -1,6 +1,2 @@
-<bx_if:show_text>
-    <span <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</span>
-</bx_if:show_text>
-<bx_if:show_link>
-    <a <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</a>
-</bx_if:show_link>
+<bx_if:show_text><span <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</span></bx_if:show_text><bx_if:show_link><a <bx_repeat:attrs>__key__="__value__"</bx_repeat:attrs>>__content__</a></bx_if:show_link>
+__script__

+ 1 - 0
template/vote_counter_label_likes.html

@@ -0,0 +1 @@
+<bx_if:show_icon><span class="__style_prefix__-counter-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 1 - 1
template/vote_counter_label_reactions.html

@@ -1 +1 @@
-<i class="sys-icon __name__"></i><span class="bx-def-margin-sec-left-auto">__text__</span>
+<bx_if:show_icon><span class="__style_prefix__-counter-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 1 - 1
template/vote_counter_wrapper_reactions.html

@@ -1 +1 @@
-<div id="__html_id__" class="__style_prefix__-counter-wrapper __style_prefix__-counter-wrapper-__type__">__counter__</div>
+<div id="__html_id__" class="__style_prefix__-counter-wrapper __style_prefix__-counter-wrapper-__type__ __style_prefix__-counter-wrapper-__type__-__style__">__counter____script__</div>

+ 1 - 0
template/vote_do_vote_label_likes.html

@@ -0,0 +1 @@
+<bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 1 - 0
template/vote_do_vote_label_reactions.html

@@ -0,0 +1 @@
+<bx_if:show_icon><span class="sys-action-do-icon __style_prefix__-do-icon"><i class="sys-icon __name__"></i></span></bx_if:show_icon><bx_if:show_text><span class="bx-def-margin-sec-left-auto">__text__</span></bx_if:show_text>

+ 4 - 4
template/vote_element_block.html

@@ -1,10 +1,10 @@
-<div id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom"<bx_if:show_vote_data> bx_vote_data_rate="__rate__" bx_vote_data_count="__count__"</bx_if:show_vote_data>>
-    <div class="__style_prefix__-do bx-clearfix">
+<div id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom"<bx_if:show_vote_data> bx_vote_data_rate="__rate__" bx_vote_data_count="__count__"</bx_if:show_vote_data>>
+    <div class="sys-action-do __style_prefix__-do bx-clearfix">
         <bx_if:show_do_vote>
-            <div class="__style_prefix__-element-holder">__do_vote__</div>
+            <div class="sys-action-element-holder __style_prefix__-element-holder">__do_vote__</div>
         </bx_if:show_do_vote>
         <bx_if:show_counter>
-            <div class="__style_prefix__-counter-holder bx-def-margin-sec-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
+            <div class="sys-action-counter-holder __style_prefix__-counter-holder bx-def-margin-sec-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
         </bx_if:show_counter>
     </div>
     <bx_if:show_legend>__legend__</bx_if:show_legend>

+ 2 - 2
template/vote_element_inline.html

@@ -1,3 +1,3 @@
-<span id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom"<bx_if:show_vote_data> bx_vote_data_rate="__rate__" bx_vote_data_count="__count__"</bx_if:show_vote_data>>
-    <span class="__style_prefix__-do"><bx_if:show_do_vote><span class="__style_prefix__-element-holder">__do_vote__</span></bx_if:show_do_vote><bx_if:show_counter><span class="__style_prefix__-counter-holder bx-def-margin-thd-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter></span>__script__
+<span id="__html_id__" class="sys-action __style_prefix__ __class__ bx-def-margin-right-auto bx-def-margin-thd-topbottom"<bx_if:show_vote_data> bx_vote_data_rate="__rate__" bx_vote_data_count="__count__"</bx_if:show_vote_data>>
+    <span class="sys-action-do __style_prefix__-do"><bx_if:show_do_vote><span class="sys-action-element-holder __style_prefix__-element-holder">__do_vote__</span></bx_if:show_do_vote><bx_if:show_counter><span class="sys-action-counter-holder __style_prefix__-counter-holder bx-def-margin-thd-left-auto bx-btn-border"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter></span>__script__
 </span>