BxBaseCmts.php 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  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 BxDolCmts
  11. */
  12. class BxBaseCmts extends BxDolCmts
  13. {
  14. protected static $_sTmplContentElementBlock;
  15. protected static $_sTmplContentElementInline;
  16. protected static $_sTmplContentDoCommentLabel;
  17. protected static $_sTmplContentCounter;
  18. protected $_sJsObjName;
  19. protected $_sStylePrefix;
  20. protected $_aHtmlIds;
  21. protected $_aElementDefaults;
  22. function __construct( $sSystem, $iId, $iInit = true, $oTemplate = false)
  23. {
  24. parent::__construct($sSystem, $iId, $iInit, $oTemplate);
  25. if (empty($sSystem))
  26. return;
  27. $this->_sJsObjName = 'oCmts' . bx_gen_method_name($sSystem, array('_' , '-')) . $iId;
  28. $this->_sStylePrefix = isset($this->_aSystem['root_style_prefix']) ? $this->_aSystem['root_style_prefix'] : 'cmt';
  29. $sHtmlId = str_replace(array('_' , ' '), array('-', '-'), $sSystem) . '-' . $iId;
  30. $this->_aHtmlIds = array(
  31. 'main' => 'bx-cmt-' . $sHtmlId,
  32. 'counter' => 'bx-cmt-counter-' . $sHtmlId
  33. );
  34. $this->_aElementDefaults = array(
  35. 'show_do_comment_as_button' => false,
  36. 'show_do_comment_as_button_small' => false,
  37. 'show_do_comment_image' => false,
  38. 'show_do_comment_icon' => true,
  39. 'show_do_comment_label' => false,
  40. 'show_counter' => true,
  41. 'show_counter_empty' => false
  42. );
  43. if(empty(self::$_sTmplContentElementBlock))
  44. self::$_sTmplContentElementBlock = $this->_oTemplate->getHtml('comment_element_block.html');
  45. if(empty(self::$_sTmplContentElementInline))
  46. self::$_sTmplContentElementInline = $this->_oTemplate->getHtml('comment_element_inline.html');
  47. if(empty(self::$_sTmplContentDoCommentLabel))
  48. self::$_sTmplContentDoCommentLabel = $this->_oTemplate->getHtml('comment_do_comment_label.html');
  49. if(empty(self::$_sTmplContentCounter))
  50. self::$_sTmplContentCounter = $this->_oTemplate->getHtml('comment_counter.html');
  51. BxDolTemplate::getInstance()->addJsTranslation('_sys_txt_cmt_loading');
  52. }
  53. /**
  54. * Add comments CSS/JS
  55. */
  56. public function addCssJs ()
  57. {
  58. $oForm = BxDolForm::getObjectInstance($this->_sFormObject, $this->_sFormDisplayPost);
  59. $oForm->addCssJs();
  60. }
  61. public function getJsObjectName()
  62. {
  63. return $this->_sJsObjName;
  64. }
  65. /**
  66. * Get initialization section of comments box
  67. *
  68. * @return string
  69. */
  70. public function getJsScript($aBp = array(), $aDp = array())
  71. {
  72. $bMinPostForm = isset($aDp['min_post_form']) ? $aDp['min_post_form'] : $this->_bMinPostForm;
  73. $aParams = array(
  74. 'sObjName' => $this->_sJsObjName,
  75. 'sRootUrl' => BX_DOL_URL_ROOT,
  76. 'sSystem' => $this->getSystemName(),
  77. 'iAuthorId' => $this->_getAuthorId(),
  78. 'iObjId' => $this->getId(),
  79. 'sBaseUrl' => $this->getBaseUrl(),
  80. 'sPostFormPosition' => $this->_aSystem['post_form_position'],
  81. 'sBrowseType' => $this->_sBrowseType,
  82. 'sDisplayType' => $this->_sDisplayType,
  83. 'iMinPostForm' => $bMinPostForm ? 1 : 0,
  84. );
  85. $this->addCssJs();
  86. return BxDolTemplate::getInstance()->_wrapInTagJsCode("var " . $this->_sJsObjName . " = new BxDolCmts(" . json_encode($aParams) . ");");
  87. }
  88. /**
  89. * get full comments block with initializations
  90. */
  91. function getCommentsBlock($aBp = array(), $aDp = array())
  92. {
  93. $this->_getParams($aBp, $aDp);
  94. //add live update
  95. $this->actionResumeLiveUpdate();
  96. $sServiceCall = BxDolService::getSerializedService('system', 'get_live_updates_comments', array($this->_sSystem, $this->_iId, $this->_getAuthorId(), '{count}'), 'TemplCmtsServices');
  97. BxDolLiveUpdates::getInstance()->add($this->_sSystem . '_live_updates_cmts_' . $this->_iId, 1, $sServiceCall);
  98. //add live update
  99. $sCaption = _t($this->_aT['block_comments_title'], $this->getCommentsCountAll());
  100. $sContent = BxDolTemplate::getInstance()->parseHtmlByName('comments_block.html', array(
  101. 'system' => $this->_sSystem,
  102. 'list_anchor' => $this->getListAnchor(),
  103. 'id' => $this->getId(),
  104. 'comments' => $this->getComments($aBp, $aDp),
  105. 'post_form_top' => $this->getFormBoxPost($aBp, array_merge($aDp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_TOP))),
  106. 'post_form_bottom' => $this->getFormBoxPost($aBp, array_merge($aDp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_BOTTOM))),
  107. 'view_image_popup' => $this->_getViewImagePopup(),
  108. 'script' => $this->getJsScript($aBp, $aDp)
  109. ));
  110. return $aDp['in_designbox'] ? DesignBoxContent($sCaption, $sContent, BX_DB_DEF, $this->_getControlsBox()) : array(
  111. 'title' => $sCaption,
  112. 'content' => $sContent,
  113. 'menu' => $this->_getControlsBox(),
  114. );
  115. }
  116. /**
  117. * get comments list for specified parent comment
  118. *
  119. * @param array $aBp - browse params array
  120. * @param array $aDp - display params array
  121. *
  122. */
  123. function getComments($aBp = array(), $aDp = array())
  124. {
  125. $this->_prepareParams($aBp, $aDp);
  126. $aCmts = $this->getCommentsArray($aBp['vparent_id'], $aBp['filter'], $aBp['order'], $aBp['start'], $aBp['per_view']);
  127. if(empty($aCmts) || !is_array($aCmts)) {
  128. if((int)$aBp['parent_id'] == 0 && !isLogged()) {
  129. $oPermalink = BxDolPermalinks::getInstance();
  130. return MsgBox(_t('_cmt_msg_login_required', $oPermalink->permalink('page.php?i=login'), $oPermalink->permalink('page.php?i=create-account')));
  131. }
  132. return isset($aDp['show_empty']) && $aDp['show_empty'] === true ? $this->_getEmpty() : '';
  133. }
  134. $sCmts = '';
  135. foreach($aCmts as $k => $aCmt)
  136. $sCmts .= $this->getComment($aCmt, $aBp, $aDp);
  137. $sCmts = $this->_getMoreLink($sCmts, $aBp, $aDp);
  138. return $sCmts;
  139. }
  140. /**
  141. * get comment view block with initializations
  142. */
  143. function getCommentBlock($iCmtId = 0, $aBp = array(), $aDp = array())
  144. {
  145. $mixedResult = $this->isViewAllowed();
  146. if($mixedResult !== CHECK_ACTION_RESULT_ALLOWED)
  147. return $mixedResult;
  148. $aBp = array_merge(array('type' => $this->_sBrowseType), $aBp);
  149. $aDp = array_merge(array('type' => BX_CMT_DISPLAY_THREADED), $aDp);
  150. $sComment = $this->getComment($iCmtId, $aBp, $aDp);
  151. if (!$sComment)
  152. return '';
  153. return BxDolTemplate::getInstance()->parseHtmlByName('comment_block.html', array(
  154. 'system' => $this->_sSystem,
  155. 'id' => $this->getId(),
  156. 'comment' => $sComment,
  157. 'view_image_popup' => $this->_getViewImagePopup(),
  158. 'script' => $this->getJsScript($aBp, $aDp)
  159. ));
  160. }
  161. /**
  162. * get one just posted comment
  163. *
  164. * @param int $iCmtId - comment id
  165. * @return string
  166. */
  167. function getComment($mixedCmt, $aBp = array(), $aDp = array())
  168. {
  169. $iUserId = $this->_getAuthorId();
  170. $aCmt = !is_array($mixedCmt) ? $this->getCommentRow((int)$mixedCmt) : $mixedCmt;
  171. if (!$aCmt)
  172. return '';
  173. list($sAuthorName, $sAuthorLink, $sAuthorIcon) = $this->_getAuthorInfo($aCmt['cmt_author_id']);
  174. $sClass = $sClassCnt = '';
  175. if(isset($aCmt['vote_rate']) && (float)$aCmt['vote_rate'] < $this->_aSystem['viewing_threshold']) {
  176. $this->_oTemplate->pareseHtmlByName('comment_hidden.html', array(
  177. 'js_object' => $this->_sJsObjName,
  178. 'id' => $aCmt['cmt_id'],
  179. 'title' => bx_process_output(_t('_hidden_comment', $sAuthorName)),
  180. 'bx_if:show_replies' => array(
  181. 'condition' => $aCmt['cmt_replies'] > 0,
  182. 'content' => array(
  183. 'replies' => _t('_Show N replies', $aCmt['cmt_replies'])
  184. )
  185. )
  186. ));
  187. $sClass = ' ' . $this->_sStylePrefix . '-hidden';
  188. }
  189. if($aCmt['cmt_author_id'] == $iUserId)
  190. $sClass .= ' ' . $this->_sStylePrefix . '-mine';
  191. if(!empty($aDp['blink']) && in_array($aCmt['cmt_id'], $aDp['blink']))
  192. $sClass .= ' ' . $this->_sStylePrefix . '-blink';
  193. if(!empty($aDp['class_comment']))
  194. $sClass .= ' ' . $aDp['class_comment'];
  195. if(!empty($aDp['class_comment_content']))
  196. $sClassCnt .= ' ' . $aDp['class_comment_content'];
  197. $sActions = $this->_getActionsBox($aCmt, $aDp);
  198. $aTmplReplyTo = array();
  199. if((int)$aCmt['cmt_parent_id'] != 0) {
  200. $aParent = $this->getCommentRow($aCmt['cmt_parent_id']);
  201. list($sParAuthorName, $sParAuthorLink, $sParAuthorIcon) = $this->_getAuthorInfo($aParent['cmt_author_id']);
  202. $aTmplReplyTo = array(
  203. 'style_prefix' => $this->_sStylePrefix,
  204. 'par_cmt_link' => $this->getItemUrl($aCmt['cmt_parent_id']),
  205. 'par_cmt_title' => bx_html_attribute(_t('_in_reply_to', $sParAuthorName)),
  206. 'par_cmt_author' => $sParAuthorName
  207. );
  208. }
  209. $sAttachments = $this->_getAttachments($aCmt);
  210. $sReplies = '';
  211. if((int)$aCmt['cmt_replies'] > 0 && !empty($aDp) && $aDp['type'] == BX_CMT_DISPLAY_THREADED) {
  212. $aDp['show_empty'] = false;
  213. $sReplies = $this->getComments(array('parent_id' => $aCmt['cmt_id'], 'vparent_id' => $aCmt['cmt_id'], 'type' => $aBp['type']), $aDp);
  214. }
  215. $aTmplVarsMeta = array();
  216. if(!empty($this->_sMenuObjMeta)) {
  217. $oMenuMeta = BxDolMenu::getObjectInstance($this->_sMenuObjMeta, $this->_oTemplate);
  218. if($oMenuMeta) {
  219. $oMenuMeta->setCmtsData($this, $aCmt['cmt_id']);
  220. $aTmplVarsMeta = array(
  221. 'style_prefix' => $this->_sStylePrefix,
  222. 'meta' => $oMenuMeta->getCode()
  223. );
  224. }
  225. }
  226. return $this->_oTemplate->parseHtmlByName('comment.html', array_merge(array(
  227. 'system' => $this->_sSystem,
  228. 'style_prefix' => $this->_sStylePrefix,
  229. 'js_object' => $this->_sJsObjName,
  230. 'id' => $aCmt['cmt_id'],
  231. 'anchor' => $this->getItemAnchor($aCmt['cmt_id']),
  232. 'class' => $sClass,
  233. 'class_cnt' => $sClassCnt,
  234. 'bx_if:show_reply_to' => array(
  235. 'condition' => !empty($aTmplReplyTo),
  236. 'content' => $aTmplReplyTo
  237. ),
  238. 'bx_if:meta' => array(
  239. 'condition' => !empty($aTmplVarsMeta),
  240. 'content' => $aTmplVarsMeta
  241. ),
  242. 'bx_if:show_attached' => array(
  243. 'condition' => !empty($sAttachments),
  244. 'content' => array(
  245. 'style_prefix' => $this->_sStylePrefix,
  246. 'attached' => $sAttachments
  247. )
  248. ),
  249. 'actions' => $sActions,
  250. 'replies' => $sReplies
  251. ), $this->_getTmplVarsAuthor($aCmt), $this->_getTmplVarsText($aCmt)));
  252. }
  253. function getCommentSearch($iCmtId, &$sAddon)
  254. {
  255. $aBp = array();
  256. $aDp = array(
  257. 'type' => BX_CMT_DISPLAY_FLAT,
  258. 'view_only' => true
  259. );
  260. if(empty($sAddon))
  261. $sAddon = $this->getJsScript($aBp, $aDp);
  262. return BxDolTemplate::getInstance()->parseHtmlByName('comment_search.html', array(
  263. 'comment' => $this->getComment($iCmtId, $aBp, $aDp),
  264. 'view_image_popup' => $this->_getViewImagePopup(),
  265. ));
  266. }
  267. /**
  268. * get one comment for "Live Search"
  269. *
  270. * @param int $iCmtId - comment id
  271. * @return string
  272. */
  273. function getCommentLiveSearch($mixedCmt, $aParams = array())
  274. {
  275. $aCmt = !is_array($mixedCmt) ? $this->getCommentRow((int)$mixedCmt) : $mixedCmt;
  276. list($sAuthorName, $sAuthorLink, $sAuthorIcon) = $this->_getAuthorInfo($aCmt['cmt_author_id']);
  277. $bAuthorIcon = !empty($sAuthorIcon);
  278. $sViewLink = $this->getViewUrl($aCmt['cmt_id']);
  279. if(empty($sViewLink))
  280. $sViewLink = '#';
  281. return BxDolTemplate::getInstance()->parseHtmlByName('comment_live_search.html', array(
  282. 'bx_if:show_icon' => array(
  283. 'condition' => $bAuthorIcon,
  284. 'content' => array(
  285. 'author_icon' => $sAuthorIcon,
  286. 'view_link' => $sViewLink
  287. )
  288. ),
  289. 'bx_if:show_icon_empty' => array(
  290. 'condition' => !$bAuthorIcon,
  291. 'content' => array()
  292. ),
  293. 'view_link' => $sViewLink,
  294. 'text' => BxTemplFunctions::getInstance()->getStringWithLimitedLength(strip_tags($aCmt['cmt_text']), $this->_sSnippetLenthLiveSearch),
  295. 'sample' => isset($aParams['txt_sample_single']) ? _t($aParams['txt_sample_single']) : ''
  296. ));
  297. }
  298. function getFormBoxPost($aBp = array(), $aDp = array())
  299. {
  300. if(!$this->isPostReplyAllowed())
  301. return '';
  302. return $this->_getFormBox(BX_CMT_ACTION_POST, $aBp, $aDp);
  303. }
  304. function getFormBoxEdit($aBp = array(), $aDp = array())
  305. {
  306. return $this->_getFormBox(BX_CMT_ACTION_EDIT, $aBp, $aDp);
  307. }
  308. function getFormPost($iCmtParentId = 0, $aDp = array())
  309. {
  310. return $this->_getFormPost($iCmtParentId, $aDp);
  311. }
  312. function getFormEdit($iCmtId, $aDp = array())
  313. {
  314. return $this->_getFormEdit($iCmtId, $aDp);
  315. }
  316. function getNotification($iCountOld = 0, $iCountNew = 0)
  317. {
  318. $iCount = (int)$iCountNew - (int)$iCountOld;
  319. if($iCount < 0)
  320. return '';
  321. $aComments = $this->_oQuery->getCommentsBy(array('type' => 'latest', 'object_id' => $this->_iId, 'author' => $this->_getAuthorId(), 'others' => 1, 'start' => '0', 'per_page' => $iCount));
  322. if(empty($aComments) || !is_array($aComments))
  323. return '';
  324. $sJsObject = $this->getJsObjectName();
  325. $oTemplate = BxDolTemplate::getInstance();
  326. $aComments = array_reverse($aComments);
  327. $iComments = count($aComments);
  328. $aTmplVarsNotifs = array();
  329. foreach($aComments as $iIndex => $aComment) {
  330. $iCommentId = $aComment['cmt_id'];
  331. $sShowOnClick = "javascript:" . $sJsObject . ".goTo(this, '" . $this->_sSystem . $iCommentId . "', '" . $iCommentId . "');";
  332. $sReplyOnClick = "javascript:" . $sJsObject . ".goToAndReply(this, '" . $this->_sSystem . $iCommentId . "', '" . $iCommentId . "');";
  333. $aTmplVarsNotifs[] = array(
  334. 'bx_if:show_as_hidden' => array(
  335. 'condition' => $iIndex < ($iComments - 1),
  336. 'content' => array(),
  337. ),
  338. 'item' => $oTemplate->parseHtmlByName('comments_notification.html', array_merge(array(
  339. 'style_prefix' => $this->_sStylePrefix,
  340. 'onclick_show' => $sShowOnClick,
  341. 'onclick_reply' => $sReplyOnClick,
  342. ), $this->_getTmplVarsAuthor($aComment), $this->_getTmplVarsText($aComment))),
  343. 'bx_if:show_previous' => array(
  344. 'condition' => $iIndex > 0,
  345. 'content' => array(
  346. 'onclick_previous' => $sJsObject . '.previousLiveUpdate(this)'
  347. )
  348. ),
  349. 'onclick_close' => $sJsObject . '.hideLiveUpdate(this)'
  350. );
  351. }
  352. return $oTemplate->parseHtmlByName('popup_chain.html', array(
  353. 'html_id' => $this->getNotificationId(),
  354. 'bx_repeat:items' => $aTmplVarsNotifs
  355. ));
  356. }
  357. public function getElementBlock($aParams = array())
  358. {
  359. $aParams['usage'] = BX_CMT_USAGE_BLOCK;
  360. return $this->getElement($aParams);
  361. }
  362. public function getElementInline($aParams = array())
  363. {
  364. $aParams['usage'] = BX_CMT_USAGE_INLINE;
  365. return $this->getElement($aParams);
  366. }
  367. public function getElement($aParams = array())
  368. {
  369. $aParams = array_merge($this->_aElementDefaults, $aParams);
  370. $bShowDoCommentAsButtonSmall = isset($aParams['show_do_comment_as_button_small']) && $aParams['show_do_comment_as_button_small'] == true;
  371. $bShowDoCommentAsButton = !$bShowDoCommentAsButtonSmall && isset($aParams['show_do_comment_as_button']) && $aParams['show_do_comment_as_button'] == true;
  372. $bShowCounterEmpty = isset($aParams['show_counter_empty']) && $aParams['show_counter_empty'] == true;
  373. $iObjectId = $this->getId();
  374. $iAuthorId = $this->_getAuthorId();
  375. $iAuthorIp = $this->_getAuthorIp();
  376. $iCount = $this->getCommentsCountAll();
  377. $bCount = (int)$iCount != 0;
  378. $isAllowedComment = $this->isPostReplyAllowed();
  379. //--- Do Comment
  380. $bTmplVarsDoComment = $this->_isShowDoComment($aParams, $isAllowedComment, $bCount);
  381. $aTmplVarsDoComment = array();
  382. if($bTmplVarsDoComment) {
  383. $sClass = '';
  384. if($bShowDoCommentAsButton)
  385. $sClass = 'bx-btn';
  386. else if ($bShowDoCommentAsButtonSmall)
  387. $sClass = 'bx-btn bx-btn-small';
  388. if(!$isAllowedComment)
  389. $sClass .= $bShowDoCommentAsButton || $bShowDoCommentAsButtonSmall ? ' bx-btn-disabled' : 'bx-cmts-disabled';
  390. $aTmplVarsDoComment = array(
  391. 'style_prefix' => $this->_sStylePrefix,
  392. 'do_comment' => $this->_oTemplate->parseLink($this->getListUrl(), $this->_getLabelDo($aParams), array(
  393. 'class' => $this->_sStylePrefix . '-do-comment ' . $this->_sStylePrefix . '-dc ' . $sClass,
  394. 'title' => _t($this->_getTitleDo())
  395. )),
  396. );
  397. }
  398. //--- Counter
  399. $bTmplVarsCounter = $this->_isShowCounter($aParams, $isAllowedComment, $bCount);
  400. $aTmplVarsCounter = array();
  401. if($bTmplVarsCounter)
  402. $aTmplVarsCounter = array(
  403. 'style_prefix' => $this->_sStylePrefix,
  404. 'bx_if:show_hidden' => array(
  405. 'condition' => !$bShowCounterEmpty && !$bCount,
  406. 'content' => array()
  407. ),
  408. 'counter' => $this->getCounter($aParams)
  409. );
  410. if(!$bTmplVarsDoComment && !$bTmplVarsCounter)
  411. return '';
  412. $sTmplName = $this->{'_getTmplElement' . bx_gen_method_name(!empty($aParams['usage']) ? $aParams['usage'] : BX_DOL_SCORE_USAGE_DEFAULT)}();
  413. return $this->_oTemplate->parseHtmlByContent($sTmplName, array(
  414. 'style_prefix' => $this->_sStylePrefix,
  415. 'html_id' => $this->_aHtmlIds['main'],
  416. 'class' => $this->_sStylePrefix . ($bShowDoCommentAsButton ? '-button' : '') . ($bShowDoCommentAsButtonSmall ? '-button-small' : ''),
  417. 'count' => $iCount,
  418. 'bx_if:show_do_comment' => array(
  419. 'condition' => $bTmplVarsDoComment,
  420. 'content' => $aTmplVarsDoComment
  421. ),
  422. 'bx_if:show_counter' => array(
  423. 'condition' => $bTmplVarsCounter,
  424. 'content' => $aTmplVarsCounter
  425. ),
  426. 'script' => ''
  427. ));
  428. }
  429. public function getCounter($aParams = array())
  430. {
  431. $bShowEmpty = isset($aParams['show_counter_empty']) && $aParams['show_counter_empty'] == true;
  432. $bShowDoCommentAsButtonSmall = isset($aParams['show_do_comment_as_button_small']) && $aParams['show_do_comment_as_button_small'] == true;
  433. $bShowDoCommentAsButton = !$bShowDoCommentAsButtonSmall && isset($aParams['show_do_comment_as_button']) && $aParams['show_do_comment_as_button'] == true;
  434. $iCount = (int)$this->getCommentsCountAll();
  435. $sClass = $this->_sStylePrefix . '-counter';
  436. if($bShowDoCommentAsButtonSmall)
  437. $sClass .= ' bx-btn-small-height';
  438. if($bShowDoCommentAsButton)
  439. $sClass .= ' bx-btn-height';
  440. return $this->_oTemplate->parseHtmlByContent($this->_getTmplCounter(), array(
  441. 'id' => $this->_aHtmlIds['counter'],
  442. 'class' => $sClass,
  443. 'content' => $iCount != 0 || $bShowEmpty ? $this->_getLabelCounter($iCount) : ''
  444. ));
  445. }
  446. protected function _getLabelDo($aParams = array())
  447. {
  448. return $this->_oTemplate->parseHtmlByContent($this->_getTmplLabelDo(), array(
  449. 'bx_if:show_image' => array(
  450. 'condition' => isset($aParams['show_do_comment_image']) && $aParams['show_do_comment_image'] == true,
  451. 'content' => array(
  452. 'src' => $this->_getImageDo()
  453. )
  454. ),
  455. 'bx_if:show_icon' => array(
  456. 'condition' => isset($aParams['show_do_comment_icon']) && $aParams['show_do_comment_icon'] == true,
  457. 'content' => array(
  458. 'name' => $this->_getIconDo()
  459. )
  460. ),
  461. 'bx_if:show_text' => array(
  462. 'condition' => isset($aParams['show_do_comment_label']) && $aParams['show_do_comment_label'] == true,
  463. 'content' => array(
  464. 'text' => _t($this->_getTitleDo())
  465. )
  466. )
  467. ));
  468. }
  469. protected function _getLabelCounter($iCount)
  470. {
  471. return (int)$iCount != 0 ? _t('_cmt_txt_counter', $iCount) : _t('_cmt_txt_counter_empty');
  472. }
  473. protected function _getTmplElementBlock()
  474. {
  475. return self::$_sTmplContentElementBlock;
  476. }
  477. protected function _getTmplElementInline()
  478. {
  479. return self::$_sTmplContentElementInline;
  480. }
  481. protected function _getTmplLabelDo()
  482. {
  483. return self::$_sTmplContentDoCommentLabel;
  484. }
  485. protected function _getTmplCounter()
  486. {
  487. return self::$_sTmplContentCounter;
  488. }
  489. /**
  490. * private functions
  491. */
  492. protected function _getControlsBox()
  493. {
  494. $sDisplay = '';
  495. $bDisplay = (int)$this->_aSystem['is_display_switch'] == 1;
  496. if($bDisplay) {
  497. $aDisplayLinks = array(
  498. array('id' => $this->_sSystem . '-flat', 'name' => $this->_sSystem . '-flat', 'class' => '', 'title' => '_cmt_display_flat', 'target' => '_self', 'onclick' => 'javascript:' . $this->_sJsObjName . '.cmtChangeDisplay(this, \'flat\');'),
  499. array('id' => $this->_sSystem . '-threaded', 'name' => $this->_sSystem . '-threaded', 'class' => '', 'title' => '_cmt_display_threaded', 'target' => '_self', 'onclick' => 'javascript:' . $this->_sJsObjName . '.cmtChangeDisplay(this, \'threaded\');')
  500. );
  501. $oMenu = new BxTemplMenuInteractive(array('template' => 'menu_interactive_vertical.html', 'menu_id'=> $this->_sSystem . '-display', 'menu_items' => $aDisplayLinks));
  502. $oMenu->setSelected('', $this->_sSystem . '-' . $this->_sDisplayType);
  503. $sDisplay = $oMenu->getCode();
  504. }
  505. $sBrowseType = '';
  506. $bBrowseType = (int)$this->_aSystem['is_browse_switch'] == 1;
  507. if($bBrowseType) {
  508. $aBrowseLinks = array(
  509. array('id' => $this->_sSystem . '-tail', 'name' => $this->_sSystem . '-tail', 'class' => '', 'title' => '_cmt_browse_tail', 'target' => '_self', 'onclick' => 'javascript:' . $this->_sJsObjName . '.cmtChangeBrowse(this, \'tail\');'),
  510. array('id' => $this->_sSystem . '-head', 'name' => $this->_sSystem . '-head', 'class' => '', 'title' => '_cmt_browse_head', 'target' => '_self', 'onclick' => 'javascript:' . $this->_sJsObjName . '.cmtChangeBrowse(this, \'head\');'),
  511. array('id' => $this->_sSystem . '-popular', 'name' => $this->_sSystem . '-popular', 'class' => '', 'title' => '_cmt_browse_popular', 'target' => '_self', 'onclick' => 'javascript:' . $this->_sJsObjName . '.cmtChangeBrowse(this, \'popular\');'),
  512. );
  513. $oMenu = new BxTemplMenuInteractive(array('template' => 'menu_interactive_vertical.html', 'menu_id'=> $this->_sSystem . '-browse', 'menu_items' => $aBrowseLinks));
  514. $oMenu->setSelected('', $this->_sSystem . '-' . $this->_sBrowseType);
  515. $sBrowseType = $oMenu->getCode();
  516. }
  517. $sBrowseFilter = '';
  518. $bBrowseFilter = (int)$this->_aSystem['is_browse_filter'] == 1;
  519. if($bBrowseFilter) {
  520. $aFilterLinks = array(
  521. array('id' => $this->_sSystem . '-all', 'name' => $this->_sSystem . '-all', 'class' => '', 'title' => '_cmt_browse_all', 'target' => '_self', 'onclick' => 'javascript:' . $this->_sJsObjName . '.cmtChangeFilter(this, \'all\');'),
  522. array('id' => $this->_sSystem . '-friends', 'name' => $this->_sSystem . '-friends', 'class' => '', 'title' => '_cmt_browse_friends', 'target' => '_self', 'onclick' => 'javascript:' . $this->_sJsObjName . '.cmtChangeFilter(this, \'friends\');'),
  523. array('id' => $this->_sSystem . '-subscriptions', 'name' => $this->_sSystem . '-subscriptions', 'class' => '', 'title' => '_cmt_browse_subscriptions', 'target' => '_self', 'onclick' => 'javascript:' . $this->_sJsObjName . '.cmtChangeFilter(this, \'subscriptions\');')
  524. );
  525. $oMenu = new BxTemplMenuInteractive(array('template' => 'menu_interactive_vertical.html', 'menu_id'=> $this->_sSystem . '-filter', 'menu_items' => $aFilterLinks));
  526. $oMenu->setSelected('', $this->_sSystem . '-' . $this->_sBrowseFilter);
  527. $sBrowseFilter = $oMenu->getCode();
  528. }
  529. return $this->_oTemplate->parseHtmlByName('comments_controls.html', array(
  530. 'display_switcher' => $bDisplay ? $sDisplay : '',
  531. 'bx_if:is_divider_1' => array(
  532. 'condition' => $bDisplay && $bBrowseType,
  533. 'content' => array(
  534. 'style_prefix' => $this->_sStylePrefix,
  535. )
  536. ),
  537. 'browse_switcher' => $bBrowseType ? $sBrowseType : '',
  538. 'bx_if:is_divider_2' => array(
  539. 'condition' => $bBrowseType && $bBrowseFilter,
  540. 'content' => array(
  541. 'style_prefix' => $this->_sStylePrefix,
  542. )
  543. ),
  544. 'filter_switcher' => $bBrowseFilter ? $sBrowseFilter : '',
  545. ));
  546. }
  547. protected function _getActionsBox(&$aCmt, $aDp = array())
  548. {
  549. $bViewOnly = isset($aDp['view_only']) && $aDp['view_only'] === true;
  550. $bDynamicMode = isset($aDp['dynamic_mode']) && $aDp['dynamic_mode'] === true;
  551. $sMenuActions = '';
  552. if(!$bViewOnly) {
  553. $oMenuActions = BxDolMenu::getObjectInstance($this->_sMenuObjActions);
  554. $oMenuActions->setCmtsData($this, $aCmt['cmt_id']);
  555. $oMenuActions->setDynamicMode($bDynamicMode);
  556. $sMenuActions = $oMenuActions->getCode();
  557. }
  558. return $this->_oTemplate->parseHtmlByName('comment_actions.html', array(
  559. 'id' => $aCmt['cmt_id'],
  560. 'js_object' => $this->_sJsObjName,
  561. 'style_prefix' => $this->_sStylePrefix,
  562. 'menu_actions' => $sMenuActions,
  563. ));
  564. }
  565. protected function _getFormBox($sType, $aBp, $aDp)
  566. {
  567. $iCmtParentId = isset($aBp['parent_id']) ? (int)$aBp['parent_id'] : 0;
  568. $sPosition = isset($aDp['position']) ? $aDp['position'] : '';
  569. $bFormMin = $iCmtParentId == 0 && isset($aDp['min_post_form']) ? $aDp['min_post_form'] : false;
  570. $sPositionSystem = $this->_aSystem['post_form_position'];
  571. if(!empty($sPosition) && $sPositionSystem != $sPosition)
  572. return '';
  573. $sClass = '';
  574. if(!empty($sPosition))
  575. $sClass .= ' ' . $this->_sStylePrefix . '-reply-' . $sPosition;
  576. if($bFormMin)
  577. $sClass .= ' ' . $this->_sStylePrefix . '-reply-min';
  578. $aTmplVarsFormMin = array();
  579. if($bFormMin) {
  580. list($sAuthorName, $sAuthorLink, $sAuthorIcon, $sAuthorUnit) = $this->_getAuthorInfo($this->_getAuthorId());
  581. $aTmplVarsFormMin = array(
  582. 'js_object' => $this->_sJsObjName,
  583. 'style_prefix' => $this->_sStylePrefix,
  584. 'author_unit' => $sAuthorUnit,
  585. 'placeholder' => _t('_cmt_txt_min_form_placeholder', $sAuthorName)
  586. );
  587. }
  588. $sMethod = '_getForm' . ucfirst($sType);
  589. $aForm = $this->$sMethod($iCmtParentId, $aDp);
  590. return BxDolTemplate::getInstance()->parseHtmlByName('comment_reply_box.html', array(
  591. 'js_object' => $this->_sJsObjName,
  592. 'style_prefix' => $this->_sStylePrefix,
  593. 'class' => $sClass,
  594. 'bx_if:show_form_min' => array(
  595. 'condition' => $bFormMin,
  596. 'content' => $aTmplVarsFormMin
  597. ),
  598. 'form' => $aForm['form'],
  599. 'form_id' => $aForm['form_id'],
  600. ));
  601. }
  602. protected function _getFormPost($iCmtParentId = 0, $aDp = array())
  603. {
  604. $bDynamic = isset($aDp['dynamic_mode']) && (bool)$aDp['dynamic_mode'];
  605. $oForm = $this->_getForm(BX_CMT_ACTION_POST, $iCmtParentId);
  606. $oForm->aInputs['cmt_parent_id']['value'] = $iCmtParentId;
  607. $oForm->initChecker();
  608. if($oForm->isSubmittedAndValid()) {
  609. $iCmtAuthorId = $this->_getAuthorId();
  610. $iCmtParentId = $oForm->getCleanValue('cmt_parent_id');
  611. $sCmtText = $oForm->getCleanValue('cmt_text');
  612. $iLevel = 0;
  613. $iCmtVisualParentId = 0;
  614. if((int)$iCmtParentId > 0) {
  615. $aParent = $this->getCommentRow($iCmtParentId);
  616. $iLevel = (int)$aParent['cmt_level'] + 1;
  617. $iCmtVisualParentId = $iLevel > $this->getMaxLevel() ? $aParent['cmt_vparent_id'] : $iCmtParentId;
  618. }
  619. $iCmtId = (int)$oForm->insert(array('cmt_vparent_id' => $iCmtVisualParentId, 'cmt_object_id' => $this->_iId, 'cmt_author_id' => $iCmtAuthorId, 'cmt_level' => $iLevel, 'cmt_time' => time()));
  620. if($iCmtId != 0) {
  621. if($this->isAttachImageEnabled()) {
  622. $aImages = $oForm->getCleanValue('cmt_image');
  623. if(!empty($aImages) && is_array($aImages)) {
  624. $oStorage = BxDolStorage::getObjectInstance($this->getStorageObjectName());
  625. foreach($aImages as $iImageId)
  626. if($this->_oQuery->saveImages($this->_aSystem['system_id'], $iCmtId, $iImageId))
  627. $oStorage->afterUploadCleanup($iImageId, $iCmtAuthorId);
  628. }
  629. }
  630. if($iCmtParentId) {
  631. $this->_oQuery->updateRepliesCount($iCmtParentId, 1);
  632. if(!BxDolModuleQuery::getInstance()->isEnabledByName('bx_notifications'))
  633. $this->_sendNotificationEmail($iCmtId, $iCmtParentId);
  634. }
  635. $this->_triggerComment();
  636. $this->isPostReplyAllowed(true);
  637. if ($this->_sMetatagsObj) {
  638. $oMetatags = BxDolMetatags::getObjectInstance($this->_sMetatagsObj);
  639. $oMetatags->metaAdd($this->_oQuery->getUniqId($this->_aSystem['system_id'], $iCmtId), $sCmtText);
  640. }
  641. $this->onPostAfter($iCmtId);
  642. return array('id' => $iCmtId, 'parent_id' => $iCmtParentId);
  643. }
  644. return array('msg' => _t('_cmt_err_cannot_perform_action'));
  645. }
  646. return array('form' => $oForm->getCode($bDynamic), 'form_id' => $oForm->id);
  647. }
  648. protected function _getFormEdit($iCmtId, $aDp = array())
  649. {
  650. $bDynamic = isset($aDp['dynamic_mode']) && (bool)$aDp['dynamic_mode'];
  651. $aCmt = $this->_oQuery->getCommentSimple ((int)$this->getId(), $iCmtId);
  652. if(!$aCmt)
  653. return array('msg' => _t('_No such comment'));
  654. $iCmtAuthorId = $this->_getAuthorId();
  655. if(!$this->isEditAllowed($aCmt))
  656. return array('msg' => $aCmt['cmt_author_id'] == $iCmtAuthorId ? strip_tags($this->msgErrEditAllowed()) : _t('_Access denied'));
  657. $oForm = $this->_getForm(BX_CMT_ACTION_EDIT, $aCmt['cmt_id']);
  658. $oForm->initChecker($aCmt);
  659. if($oForm->isSubmittedAndValid()) {
  660. $sCmtText = $oForm->getCleanValue('cmt_text');
  661. if($oForm->update($iCmtId) !== false) {
  662. $this->isEditAllowed($aCmt, true);
  663. if ($this->_sMetatagsObj) {
  664. $oMetatags = BxDolMetatags::getObjectInstance($this->_sMetatagsObj);
  665. $oMetatags->metaAdd($this->_oQuery->getUniqId($this->_aSystem['system_id'], $iCmtId), $sCmtText);
  666. }
  667. $this->onEditAfter($iCmtId);
  668. return array('id' => $iCmtId, 'text' => $this->_prepareTextForOutput($sCmtText, $iCmtId));
  669. }
  670. return array('msg' => _t('_cmt_err_cannot_perform_action'));
  671. }
  672. return array('form' => $oForm->getCode($bDynamic), 'form_id' => $oForm->id);
  673. }
  674. protected function _getForm($sAction, $iId)
  675. {
  676. $oForm = $this->_getFormObject($sAction);
  677. $oForm->setId(sprintf($oForm->getAttributeMask('id'), $sAction, $this->_sSystem, $iId));
  678. $oForm->setName(sprintf($oForm->getAttributeMask('name'), $sAction, $this->_sSystem, $iId));
  679. $oForm->aParams['db']['table'] = $this->_aSystem['table'];
  680. $oForm->aInputs['sys']['value'] = $this->_sSystem;
  681. $oForm->aInputs['id']['value'] = $this->_iId;
  682. $oForm->aInputs['action']['value'] = 'Submit' . ucfirst($sAction) . 'Form';
  683. if(!$this->isAttachImageEnabled())
  684. unset($oForm->aInputs['cmt_image']);
  685. if(isset($oForm->aInputs['cmt_text'])) {
  686. $oForm->aInputs['cmt_text']['html'] = $this->_aSystem['html'];
  687. $oForm->aInputs['cmt_text']['db']['pass'] = $this->isHtml() ? 'XssHtml' : 'XssMultiline';
  688. $iCmtTextMin = (int)$this->_aSystem['chars_post_min'];
  689. $iCmtTextMax = (int)$this->_aSystem['chars_post_max'];
  690. $oForm->aInputs['cmt_text']['checker']['params'] = array($iCmtTextMin, $iCmtTextMax);
  691. $oForm->aInputs['cmt_text']['checker']['error'] = _t('_Please enter n1-n2 characters', $iCmtTextMin, $iCmtTextMax);
  692. }
  693. return $oForm;
  694. }
  695. protected function _getMoreLink($sCmts, $aBp = array(), $aDp = array())
  696. {
  697. $iStart = $iPerView = 0;
  698. switch($aBp['type']) {
  699. case BX_CMT_BROWSE_HEAD:
  700. case BX_CMT_BROWSE_POPULAR:
  701. case BX_CMT_BROWSE_CONNECTION:
  702. $iPerView = $aBp['per_view'];
  703. $iStart = $aBp['start'] + $iPerView;
  704. if($iStart >= $aBp['count'])
  705. return $sCmts;
  706. break;
  707. case BX_CMT_BROWSE_TAIL:
  708. $iPerView = $aBp['per_view'];
  709. $iStart = $aBp['start'] - $iPerView;
  710. if($iStart < 0) {
  711. $iPerView += $iStart;
  712. $iStart = 0;
  713. }
  714. if($iStart == 0 && $iPerView == 0)
  715. return $sCmts;
  716. break;
  717. }
  718. $bRoot = (int)$aBp['vparent_id'] <= 0;
  719. $sMore = BxDolTemplate::getInstance()->parseHtmlByName('comment_more.html', array(
  720. 'js_object' => $this->_sJsObjName,
  721. 'style_prefix' => $this->_sStylePrefix,
  722. 'bx_if:is_root' => array(
  723. 'condition' => $bRoot,
  724. 'content' => array()
  725. ),
  726. 'parent_id' => $aBp['vparent_id'],
  727. 'start' => $iStart,
  728. 'per_view' => $iPerView,
  729. 'title' => _t('_cmt_load_more_' . ($aBp['vparent_id'] == 0 ? 'comments' : 'replies') . '_' . $aBp['type'])
  730. ));
  731. switch($aBp['type']) {
  732. case BX_CMT_BROWSE_HEAD:
  733. case BX_CMT_BROWSE_POPULAR:
  734. case BX_CMT_BROWSE_CONNECTION:
  735. $sCmts .= $sMore;
  736. break;
  737. case BX_CMT_BROWSE_TAIL:
  738. $sCmts = $sMore . $sCmts;
  739. break;
  740. }
  741. return $sCmts;
  742. }
  743. protected function _getEmpty()
  744. {
  745. return BxDolTemplate::getInstance()->parseHtmlByName('comment_empty.html', array(
  746. 'style_prefix' => $this->_sStylePrefix,
  747. 'content' => MsgBox(_t('_Empty'))
  748. ));
  749. }
  750. protected function _getViewImagePopup()
  751. {
  752. $sViewImagePopupId = 'cmts-box-' . $this->_sSystem . '-' . $this->getId() . '-view-image-popup' ;
  753. $sViewImagePopupContent = BxDolTemplate::getInstance()->parseHtmlByName('popup_image.html', array(
  754. 'image_url' => ''
  755. ));
  756. return BxTemplFunctions::getInstance()->transBox($sViewImagePopupId, $sViewImagePopupContent, true);
  757. }
  758. protected function _getAttachments($aCmt)
  759. {
  760. $aTmplImages = array();
  761. if(!$this->isAttachImageEnabled())
  762. return '';
  763. $aFiles = $this->_oQuery->getFiles($this->_aSystem['system_id'], $aCmt['cmt_id']);
  764. if(!empty($aFiles) && is_array($aFiles)) {
  765. $oStorage = BxDolStorage::getObjectInstance($this->getStorageObjectName());
  766. $oTranscoder = BxDolTranscoderImage::getObjectInstance($this->getTranscoderPreviewName());
  767. foreach($aFiles as $aFile) {
  768. $bImage = $oTranscoder && $oTranscoder->isMimeTypeSupported($aFile['mime_type']);
  769. $sPreview = '';
  770. if($oTranscoder && $bImage)
  771. $sPreview = $oTranscoder->getFileUrl($aFile['image_id']);
  772. if(!$sPreview)
  773. $sPreview = $this->_oTemplate->getIconUrl($oStorage->getIconNameByFileName($aFile['file_name']));
  774. $aTmplVarsFile = array(
  775. 'js_object' => $this->_sJsObjName,
  776. 'preview' => $sPreview,
  777. 'file' => $oStorage->getFileUrlById($aFile['image_id']),
  778. 'file_name' => $aFile['file_name'],
  779. 'file_icon' => $oStorage->getFontIconNameByFileName($aFile['file_name']),
  780. 'file_size' => _t_format_size($aFile['size']),
  781. );
  782. $aTmplImages[] = array(
  783. 'style_prefix' => $this->_sStylePrefix,
  784. 'bx_if:show_image' => array(
  785. 'condition' => $bImage,
  786. 'content' => $aTmplVarsFile
  787. ),
  788. 'bx_if:show_file' => array(
  789. 'condition' => !$bImage,
  790. 'content' => $aTmplVarsFile
  791. ),
  792. );
  793. }
  794. }
  795. return $this->_oTemplate->parseHtmlByName('comment_attachments.html', array(
  796. 'bx_repeat:attached' => $aTmplImages
  797. ));
  798. }
  799. protected function _getTmplVarsAuthor($aCmt)
  800. {
  801. list($sAuthorName, $sAuthorLink, $sAuthorIcon, $sAuthorUnit) = $this->_getAuthorInfo($aCmt['cmt_author_id']);
  802. $bAuthorIcon = !empty($sAuthorIcon);
  803. return array(
  804. 'author_unit' => $sAuthorUnit,
  805. 'bx_if:show_icon' => array(
  806. 'condition' => $bAuthorIcon,
  807. 'content' => array(
  808. 'author_icon' => $sAuthorIcon
  809. )
  810. ),
  811. 'bx_if:show_icon_empty' => array(
  812. 'condition' => !$bAuthorIcon,
  813. 'content' => array()
  814. ),
  815. 'bx_if:show_author_link' => array(
  816. 'condition' => !empty($sAuthorLink),
  817. 'content' => array(
  818. 'author_link' => $sAuthorLink,
  819. 'author_title' => bx_html_attribute($sAuthorName),
  820. 'author_name' => $sAuthorName
  821. )
  822. ),
  823. 'bx_if:show_author_text' => array(
  824. 'condition' => empty($sAuthorLink),
  825. 'content' => array(
  826. 'author_name' => $sAuthorName
  827. )
  828. ),
  829. );
  830. }
  831. protected function _getTmplVarsText($aCmt)
  832. {
  833. $sText = $aCmt['cmt_text'];
  834. $sTextMore = '';
  835. if(!$this->isHtml()) {
  836. $iMaxLength = (int)$this->_aSystem['chars_display_max'];
  837. if(strlen($sText) > $iMaxLength) {
  838. $iLength = strpos($sText, ' ', $iMaxLength);
  839. $sTextMore = trim(substr($sText, $iLength));
  840. $sText = trim(substr($sText, 0, $iLength));
  841. }
  842. }
  843. $sText = $this->_prepareTextForOutput($sText, $aCmt['cmt_id']);
  844. $sTextMore = $this->_prepareTextForOutput($sTextMore, $aCmt['cmt_id']);
  845. return array(
  846. 'text' => $sText,
  847. 'bx_if:show_more' => array(
  848. 'condition' => !empty($sTextMore),
  849. 'content' => array(
  850. 'style_prefix' => $this->_sStylePrefix,
  851. 'js_object' => $this->_sJsObjName,
  852. 'text_more' => $sTextMore
  853. )
  854. ),
  855. );
  856. }
  857. }
  858. /** @} */