BxBaseVoteReactions.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaBaseView UNA Base Representation Classes
  7. * @{
  8. */
  9. /**
  10. * @see BxDolVote, BxDolVoteLikes
  11. */
  12. class BxBaseVoteReactions extends BxDolVoteReactions
  13. {
  14. protected $_sTmplNameBySummary;
  15. protected $_sTmplContentCounterWrapper = '';
  16. public function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
  17. {
  18. parent::__construct($sSystem, $iId, $iInit, $oTemplate);
  19. $this->_sJsClsName .= 'Reactions';
  20. $sHtmlId = str_replace(array('_' , ' '), array('-', '-'), $sSystem) . '-' . $iId;
  21. $this->_aHtmlIds = array_merge($this->_aHtmlIds, array(
  22. 'main' => 'bx-vr-' . $sHtmlId,
  23. 'do_menu' => 'bx-vr-do-menu-' . $sHtmlId,
  24. 'do_popup' => 'bx-vr-do-popup-' . $sHtmlId
  25. ));
  26. $this->_aElementDefaults = array(
  27. 'show_do_vote_as_button' => false,
  28. 'show_do_vote_as_button_small' => false,
  29. 'show_do_vote_icon' => true,
  30. 'show_do_vote_label' => false,
  31. 'show_counter' => false,
  32. 'show_counter_only' => true,
  33. 'show_counter_empty' => true,
  34. 'show_counter_style' => self::$_sCounterStyleDivided, //--- Alloved styles are 'simple', 'divided' and 'compound'
  35. 'show_legend' => false,
  36. 'show_script' => true
  37. );
  38. $this->_sTmplNameBySummary = 'vote_by_summary_reactions.html';
  39. $this->_sTmplNameByList = 'vote_by_list_reactions.html';
  40. $this->_sTmplContentDoActionLabel = $this->_oTemplate->getHtml('vote_do_vote_label_reactions.html');
  41. $this->_sTmplContentCounterLabel = $this->_oTemplate->getHtml('vote_counter_label_reactions.html');
  42. $this->_sTmplContentCounterWrapper = $this->_oTemplate->getHtml('vote_counter_wrapper_reactions.html');
  43. }
  44. public function getJsClick($iValue = 0)
  45. {
  46. if(empty($iValue))
  47. $iValue = $this->getValue();
  48. $sResult = '';
  49. if($this->_bQuickMode)
  50. $sResult = $this->getJsClickDo($this->_aDataList[$this->_sDefault]['name'], $iValue);
  51. else
  52. $sResult = $this->getJsObjectName() . '.toggleDoPopup(this, ' . $iValue . ')';
  53. return $sResult;
  54. }
  55. public function getJsClickDo($sReaction, $iValue = 0)
  56. {
  57. if(empty($iValue))
  58. $iValue = $this->getValue();
  59. return $this->getJsObjectName() . '.vote(this, ' . $iValue . ', \'' . $sReaction . '\')';
  60. }
  61. public function getJsClickCounter($aParams = array())
  62. {
  63. $sJsObject = $this->getJsObjectName();
  64. $sJsMethod = 'toggleByPopup';
  65. if(isset($aParams['show_counter_style']) && in_array($aParams['show_counter_style'], array(self::$_sCounterStyleCompound, self::$_sCounterStyleSimple)))
  66. return $sJsObject . '.' . $sJsMethod . '(this)';
  67. $sReaction = !empty($aParams['reaction']) ? $aParams['reaction'] : $this->_sDefault;
  68. return $sJsObject . '.' . $sJsMethod . '(this, \'' . $sReaction . '\')';
  69. }
  70. public function getCounter($aParams = [])
  71. {
  72. $aParams = array_merge($this->_aElementDefaults, $aParams);
  73. $sDefault = $aParams['show_counter_style'];
  74. $sCounterStyle = !empty($aParams['show_counter_style']) ? $aParams['show_counter_style'] : $sDefault;
  75. $sMethodPrefix = '_getCounter';
  76. $sMethod = $sMethodPrefix . bx_gen_method_name($sCounterStyle);
  77. if(!method_exists($this, $sMethod))
  78. $sMethod = $sMethodPrefix . bx_gen_method_name($sDefault);
  79. return $this->$sMethod($aParams);
  80. }
  81. public function _getCounterSimple($aParams = array())
  82. {
  83. $bDynamicMode = isset($aParams['dynamic_mode']) && (bool)$aParams['dynamic_mode'] === true;
  84. $bShowCounterEmpty = isset($aParams['show_counter_empty']) && (bool)$aParams['show_counter_empty'] === true;
  85. $bShowScript = !isset($aParams['show_script']) || (bool)$aParams['show_script'] === true;
  86. $bVote = $this->_isVote();
  87. $aVote = $this->_getVote();
  88. $aReactions = $this->getReactions();
  89. $sClass = isset($aParams['class_counter']) ? $aParams['class_counter'] : '';
  90. if(isset($aParams['show_do_vote_as_button_small']) && (bool)$aParams['show_do_vote_as_button_small'] === true)
  91. $sClass .= ' bx-btn-small-height';
  92. else if(isset($aParams['show_do_vote_as_button']) && (bool)$aParams['show_do_vote_as_button'] === true)
  93. $sClass .= ' bx-btn-height';
  94. $aParams['id_counter'] = '';
  95. $iResultC = $iResultS = 0;
  96. foreach($aReactions as $sName) {
  97. $iResultC += (int)$aVote['count_' . $sName];
  98. $iResultS += (int)$aVote['sum_' . $sName];
  99. }
  100. $aParams = array_merge($aParams, array(
  101. 'show_counter_active' => false,
  102. 'show_counter_label_icon' => false,
  103. 'show_counter_label_text' => true,
  104. 'class_counter' => ' total-count ' . $sClass,
  105. 'reaction' => '',
  106. 'vote' => array(
  107. 'count' => $iResultC,
  108. 'sum' => $iResultS,
  109. 'rate' => $iResultC > 0 ? round($iResultS / $iResultC, 2) : 0,
  110. )
  111. ));
  112. return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounterWrapper(), array(
  113. 'html_id' => $this->_aHtmlIds['counter'],
  114. 'style_prefix' => $this->_sStylePrefix,
  115. 'class' => $this->_aHtmlIds['counter'] . (!$bVote && !$bShowCounterEmpty ? ' bx-vc-hidden' : ''),
  116. 'type' => $this->_sType,
  117. 'style' => self::$_sCounterStyleSimple,
  118. 'bx_if:show_link' => array(
  119. 'condition' => true,
  120. 'content' => array(
  121. 'href' => 'javascript:void(0)',
  122. 'onclick' => 'javascript:' . $this->getJsClickCounter($aParams),
  123. 'title' => bx_html_attribute($this->_getTitleDoBy($aParams)),
  124. 'counter' => parent::getCounter(array_merge($aParams, array('show_script' => false))),
  125. )
  126. ),
  127. 'bx_if:show_text' => array(
  128. 'condition' => false,
  129. 'content' => array()
  130. ),
  131. 'script' => $bShowScript ? $this->getJsScript($aParams) : ''
  132. ));
  133. }
  134. public function _getCounterDivided($aParams = array())
  135. {
  136. $bDynamicMode = isset($aParams['dynamic_mode']) && (bool)$aParams['dynamic_mode'] === true;
  137. $bShowCounterEmpty = isset($aParams['show_counter_empty']) && (bool)$aParams['show_counter_empty'] === true;
  138. $bShowScript = !isset($aParams['show_script']) || (bool)$aParams['show_script'] === true;
  139. $bVote = $this->_isVote();
  140. $aVote = $this->_getVote();
  141. $aReactions = $this->getReactions();
  142. $sClass = isset($aParams['class_counter']) ? $aParams['class_counter'] : '';
  143. if(isset($aParams['show_do_vote_as_button_small']) && (bool)$aParams['show_do_vote_as_button_small'] === true)
  144. $sClass .= ' bx-btn-small-height';
  145. else if(isset($aParams['show_do_vote_as_button']) && (bool)$aParams['show_do_vote_as_button'] === true)
  146. $sClass .= ' bx-btn-height';
  147. $sClass .= ' bx-def-margin-sec-right';
  148. $aParams['id_counter'] = '';
  149. $sResult = '';
  150. foreach($aReactions as $sName) {
  151. $iCount = (int)$aVote['count_' . $sName];
  152. $aParams['class_counter'] = ($iCount == 0 && (!$bShowCounterEmpty || $sName != $this->_sDefault || $bVote) ? ' bx-vc-hidden' : '') . ' ' . $sName . ' ' . $sClass;
  153. $aParams['reaction'] = $sName;
  154. $aParams['vote'] = array(
  155. 'count' => $iCount,
  156. 'sum' => $aVote['sum_' . $sName],
  157. 'rate' => $aVote['rate_' . $sName],
  158. );
  159. $sResult .= parent::getCounter(array_merge($aParams, array('show_script' => false)));
  160. }
  161. return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounterWrapper(), array(
  162. 'html_id' => $this->_aHtmlIds['counter'],
  163. 'style_prefix' => $this->_sStylePrefix,
  164. 'class' => $this->_aHtmlIds['counter'] . (!$bVote && !$bShowCounterEmpty ? ' bx-vc-hidden' : ''),
  165. 'type' => $this->_sType,
  166. 'style' => self::$_sCounterStyleDivided,
  167. 'bx_if:show_link' => array(
  168. 'condition' => false,
  169. 'content' => array()
  170. ),
  171. 'bx_if:show_text' => array(
  172. 'condition' => true,
  173. 'content' => array(
  174. 'counter' => $sResult,
  175. )
  176. ),
  177. 'script' => $bShowScript ? $this->getJsScript($aParams) : ''
  178. ));
  179. }
  180. public function _getCounterCompound($aParams = array())
  181. {
  182. $bDynamicMode = isset($aParams['dynamic_mode']) && (bool)$aParams['dynamic_mode'] === true;
  183. $bShowCounterEmpty = isset($aParams['show_counter_empty']) && (bool)$aParams['show_counter_empty'] === true;
  184. $bShowScript = !isset($aParams['show_script']) || (bool)$aParams['show_script'] === true;
  185. $bVote = $this->_isVote();
  186. $aVote = $this->_getVote();
  187. $aReactions = $this->getReactions();
  188. $sClass = isset($aParams['class_counter']) ? $aParams['class_counter'] : '';
  189. if(isset($aParams['show_do_vote_as_button_small']) && (bool)$aParams['show_do_vote_as_button_small'] === true)
  190. $sClass .= ' bx-btn-small-height';
  191. else if(isset($aParams['show_do_vote_as_button']) && (bool)$aParams['show_do_vote_as_button'] === true)
  192. $sClass .= ' bx-btn-height';
  193. $aParams['id_counter'] = '';
  194. $sResult = '';
  195. $iResultC = $iResultS = 0;
  196. foreach($aReactions as $sName) {
  197. $iCount = (int)$aVote['count_' . $sName];
  198. $aParams = array_merge($aParams, array(
  199. 'show_counter_active' => false,
  200. 'show_counter_label_icon' => true,
  201. 'show_counter_label_text' => false,
  202. 'class_counter' => ($iCount == 0 && (!$bShowCounterEmpty || $sName != $this->_sDefault || $bVote) ? ' bx-vc-hidden' : '') . ' ' . $sName . ' ' . $sClass,
  203. 'reaction' => $sName,
  204. 'vote' => array(
  205. 'count' => $iCount,
  206. 'sum' => $aVote['sum_' . $sName],
  207. 'rate' => $aVote['rate_' . $sName],
  208. )
  209. ));
  210. $iResultC += $iCount;
  211. $iResultS += (int)$aVote['sum_' . $sName];
  212. $sResult .= trim(parent::getCounter(array_merge($aParams, [
  213. 'show_script' => false
  214. ])));
  215. }
  216. $aParams = array_merge($aParams, array(
  217. 'show_counter_active' => false,
  218. 'show_counter_label_icon' => false,
  219. 'show_counter_label_text' => true,
  220. 'class_counter' => ' total-count ' . $sClass,
  221. 'reaction' => '',
  222. 'vote' => array(
  223. 'count' => $iResultC,
  224. 'sum' => $iResultS,
  225. 'rate' => $iResultC > 0 ? round($iResultS / $iResultC, 2) : 0,
  226. )
  227. ));
  228. $sResult .= parent::getCounter(array_merge($aParams, array('show_script' => false)));
  229. $sClassWrapper = 'sys-action-counter';
  230. if(isset($aParams['show_counter_only']) && (bool)$aParams['show_counter_only'] === true)
  231. $sClassWrapper .= ' sys-ac-only';
  232. $sClassWrapper .= ' ' . $this->_aHtmlIds['counter'] . (!$bVote && !$bShowCounterEmpty ? ' bx-vc-hidden' : '');
  233. return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounterWrapper(), array(
  234. 'html_id' => $this->_aHtmlIds['counter'],
  235. 'style_prefix' => $this->_sStylePrefix,
  236. 'class' => $sClassWrapper,
  237. 'type' => $this->_sType,
  238. 'style' => self::$_sCounterStyleCompound,
  239. 'bx_if:show_link' => array(
  240. 'condition' => true,
  241. 'content' => array(
  242. 'href' => 'javascript:void(0)',
  243. 'onclick' => 'javascript:' . $this->getJsClickCounter($aParams),
  244. 'title' => bx_html_attribute($this->_getTitleDoBy($aParams)),
  245. 'counter' => $sResult,
  246. )
  247. ),
  248. 'bx_if:show_text' => array(
  249. 'condition' => false,
  250. 'content' => array()
  251. ),
  252. 'script' => $bShowScript ? $this->getJsScript($aParams) : ''
  253. ));
  254. }
  255. public function getElement($aParams = array())
  256. {
  257. $sClass = $this->_sStylePrefix . '-' . $this->_sType;
  258. if(isset($aParams['show_do_vote_as_button_small']) && (bool)$aParams['show_do_vote_as_button_small'] === true)
  259. $sClass .= '-button-small';
  260. else if(isset($aParams['show_do_vote_as_button']) && (bool)$aParams['show_do_vote_as_button'] === true)
  261. $sClass .= '-button';
  262. $aParams['class_element'] = isset($aParams['class_element']) ? $aParams['class_element'] : '';
  263. $aParams['class_element'] .= ' ' . $sClass;
  264. return parent::getElement($aParams);
  265. }
  266. /**
  267. * Internal methods.
  268. */
  269. protected function _prepareParamsData($aParams)
  270. {
  271. return parent::_prepareParamsData(array_merge([
  272. 'bQuickMode' => $this->_bQuickMode
  273. ], $aParams));
  274. }
  275. protected function _isShowDoVote($aParams, $isAllowedVote, $bCount)
  276. {
  277. $bResult = parent::_isShowDoVote($aParams, $isAllowedVote, $bCount);
  278. if(!$bResult)
  279. return $bResult;
  280. return $isAllowedVote || $bCount;
  281. }
  282. protected function _getDoVote($aParams = array(), $isAllowedVote = true)
  283. {
  284. $bUndo = $this->isUndo();
  285. $bVoted = isset($aParams['is_voted']) && (bool)$aParams['is_voted'] === true;
  286. $bShowDoVoteAsButtonSmall = isset($aParams['show_do_vote_as_button_small']) && (bool)$aParams['show_do_vote_as_button_small'] === true;
  287. $bShowDoVoteAsButton = !$bShowDoVoteAsButtonSmall && isset($aParams['show_do_vote_as_button']) && (bool)$aParams['show_do_vote_as_button'] === true;
  288. $bDisabled = !$isAllowedVote || ($bVoted && !$bUndo);
  289. $sClass = '';
  290. if($bShowDoVoteAsButton)
  291. $sClass = ' bx-btn';
  292. else if ($bShowDoVoteAsButtonSmall)
  293. $sClass = ' bx-btn bx-btn-small';
  294. $iValue = 0;
  295. $sReaction = '';
  296. $sJsClick = '';
  297. if(!$bDisabled) {
  298. if($bVoted && $bUndo) {
  299. $sClass = ' ' . $this->_sStylePrefix . '-voted' . $sClass;
  300. $iValue = $aParams['track']['value'];
  301. $sReaction = $aParams['track']['reaction'];
  302. $sJsClick = $this->getJsClickDo($sReaction, $iValue);
  303. }
  304. else {
  305. $iValue = $this->getValue();
  306. $sReaction = $this->_aDataList[$this->_sDefault]['name'];
  307. $sJsClick = $this->getJsClick($iValue);
  308. }
  309. }
  310. else
  311. $sClass .= $bShowDoVoteAsButton || $bShowDoVoteAsButtonSmall ? ' bx-btn-disabled' : ' ' . $this->_sStylePrefix . '-disabled';
  312. return $this->_oTemplate->parseLink('javascript:void(0)', $this->_getDoVoteLabel($aParams), array(
  313. 'class' => $this->_sStylePrefix . '-do-vote' . $sClass,
  314. 'title' => _t($this->_getTitleDoWithTrack($bVoted, $aParams['track'])),
  315. 'onclick' => $sJsClick,
  316. 'bx-vote-reaction' => $sReaction,
  317. 'bx-vote-value' => $iValue,
  318. ));
  319. }
  320. protected function _getDoVoteLabel($aParams = array())
  321. {
  322. $bVoted = isset($aParams['is_voted']) && (bool)$aParams['is_voted'] === true;
  323. return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentDoActionLabel(), array(
  324. 'style_prefix' => $this->_sStylePrefix,
  325. 'bx_if:show_icon' => array(
  326. 'condition' => isset($aParams['show_do_vote_icon']) && (bool)$aParams['show_do_vote_icon'] === true,
  327. 'content' => array(
  328. 'style_prefix' => $this->_sStylePrefix,
  329. 'name' => $this->_getIconDoWithTrack($bVoted, $aParams['track']),
  330. 'emoji' => $this->_getEmojiDoWithTrack($bVoted, $aParams['track'])
  331. )
  332. ),
  333. 'bx_if:show_text' => array(
  334. 'condition' => isset($aParams['show_do_vote_label']) && (bool)$aParams['show_do_vote_label'] === true,
  335. 'content' => array(
  336. 'style_prefix' => $this->_sStylePrefix,
  337. 'text' => _t($this->_getTitleDoWithTrack($bVoted, $aParams['track']))
  338. )
  339. )
  340. ));
  341. }
  342. public function _getDoVotePopup($iValue = 0)
  343. {
  344. if(empty($iValue))
  345. $iValue = $this->getValue();
  346. $oMenu = BxTemplMenu::getObjectInstance($this->_sMenuDoVote);
  347. if(!$oMenu)
  348. return '';
  349. $oMenu->setParams(array(
  350. 'object' => &$this,
  351. 'value' => $iValue,
  352. ));
  353. return $oMenu->getCode();
  354. }
  355. protected function _getCounterLabel($iCount, $aParams = array())
  356. {
  357. $sReaction = !empty($aParams['reaction']) ? $aParams['reaction'] : $this->_sDefault;
  358. return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentCounterLabel(), array(
  359. 'style_prefix' => $this->_sStylePrefix,
  360. 'bx_if:show_icon' => array(
  361. 'condition' => !isset($aParams['show_counter_label_icon']) || (bool)$aParams['show_counter_label_icon'] === true,
  362. 'content' => array(
  363. 'style_prefix' => $this->_sStylePrefix,
  364. 'name' => $this->getIcon($sReaction),
  365. 'emoji' => $this->getEmoji($sReaction),
  366. 'title_attr' => bx_html_attribute(_t($this->_aDataList[$sReaction]['title'])),
  367. )
  368. ),
  369. 'bx_if:show_text' => array(
  370. 'condition' => !isset($aParams['show_counter_label_text']) || (bool)$aParams['show_counter_label_text'] === true,
  371. 'content' => array(
  372. 'style_prefix' => $this->_sStylePrefix,
  373. 'text' => parent::_getCounterLabel($iCount)
  374. )
  375. )
  376. ));
  377. }
  378. protected function _getVotedBy($aParams = array())
  379. {
  380. if(!isset($aParams['reaction']))
  381. return $this->_getVotedBySummary($aParams);
  382. $bSummary = $aParams['reaction'] == 'summary';
  383. $aBrowseParams = array('type' => 'by', 'object_id' => $this->getId());
  384. if(!$bSummary)
  385. $aBrowseParams['reaction'] = $aParams['reaction'];
  386. $aValues = $this->_oQuery->getPerformed($aBrowseParams);
  387. $aTmplUsers = array();
  388. foreach($aValues as $mValue) {
  389. $mValue = is_array($mValue) ? $mValue : array('author_id' => (int)$mValue, 'reaction' => '');
  390. list($sUserName, $sUserUrl, $sUserIcon, $sUserUnit) = $this->_getAuthorInfo($mValue['author_id']);
  391. $aTmplUsers[] = array(
  392. 'style_prefix' => $this->_sStylePrefix,
  393. 'user_unit' => $sUserUnit,
  394. 'bx_if:show_reaction' => array(
  395. 'condition' => $bSummary,
  396. 'content' => array(
  397. 'style_prefix' => $this->_sStylePrefix,
  398. 'icon' => $bSummary ? $this->getIcon($mValue['reaction']) : '',
  399. 'emoji' => $bSummary ? $this->getEmoji($mValue['reaction']) : ''
  400. )
  401. )
  402. );
  403. }
  404. if(empty($aTmplUsers))
  405. $aTmplUsers = MsgBox(_t('_Empty'));
  406. return $this->_oTemplate->parseHtmlByName($this->_sTmplNameByList, array(
  407. 'style_prefix' => $this->_sStylePrefix,
  408. 'class' => ' ' . $this->_sStylePrefix . '-bl-' . $aParams['reaction'],
  409. 'bx_repeat:list' => $aTmplUsers
  410. ));
  411. }
  412. protected function _getVotedBySummary($aParams = array())
  413. {
  414. $sJsObject = $this->getJsObjectName();
  415. $sTxtSummary = _t('_vote_do_by_summary');
  416. $aReactions = array_merge(array('summary'), $this->getReactions());
  417. $aMenuItems = array();
  418. $aTmplVarsLists = array();
  419. foreach ($aReactions as $sReaction) {
  420. if($sReaction == $this->_sDefault)
  421. continue;
  422. $bSummary = $sReaction == 'summary';
  423. $sName = $this->_sStylePrefix . '-' . $sReaction;
  424. $sEmoji = $this->getEmoji($sReaction);
  425. $sTitle = !$bSummary ? $this->_oTemplate->parseIcon($sEmoji ? $sEmoji : $this->getIcon($sReaction)) : $sTxtSummary;
  426. $sTitleAttr = !$bSummary ? _t('_vote_do_by_x_reaction', _t($this->_aDataList[$sReaction]['title'])) : $sTxtSummary;
  427. $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);
  428. $aTmplVarsLists[] = array(
  429. 'content' => $this->_getVotedBy(array('reaction' => $sReaction))
  430. );
  431. }
  432. $oMenu = new BxTemplMenuInteractive(array('template' => 'menu_interactive_vertical.html', 'menu_id'=> $this->_sStylePrefix . '-voted-by', 'menu_items' => $aMenuItems));
  433. $oMenu->setSelected('', $this->_sStylePrefix . '-summary');
  434. return $this->_oTemplate->parseHtmlByName($this->_sTmplNameBySummary, array(
  435. 'style_prefix' => $this->_sStylePrefix,
  436. 'title' => '',
  437. 'menu' => $oMenu->getCode(),
  438. 'bx_repeat:lists' => $aTmplVarsLists
  439. ));
  440. }
  441. protected function _getTmplContentCounterWrapper()
  442. {
  443. return $this->_sTmplContentCounterWrapper;
  444. }
  445. }
  446. /** @} */