function getCommentsBlock($iParentId = 0, $iVParentId = 0, $bInDesignbox = true) { $mixedBlock = parent::getCommentsBlock($iParentId, $iVParentId, $bInDesignbox); if (is_array($mixedBlock) && isset($mixedBlock['title'])) { $mixedBlock['title'] = _t('_bx_cnv_page_block_title_entry_comments', $this->getCommentsCount()); } return $mixedBlock; }
protected function _entitySocialSharing($iId, $iIdForTimeline, $iIdThumb, $sTitle, $sObjectStorage, $sObjectTranscoder, $sObjectVote, $sUriViewEntry, $sCommentsObject = '', $bEnableSocialSharing = true) { $sUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=' . $sUriViewEntry . '&id=' . $iId); $sComments = ''; if ($sCommentsObject && ($oComments = BxTemplCmts::getObjectInstance($sCommentsObject, $iId))) { $iNum = $oComments->getCommentsCountAll(); $sComments = $this->_oTemplate->parseHtmlByName('comments-item.html', array('url' => $sUrl . '#' . $oComments->getListAnchor(), 'bx_if:comments' => array('condition' => $iNum, 'content' => array('num' => $iNum)))); } $aCustomParams = false; if ($iIdThumb && $bEnableSocialSharing) { if ($sObjectTranscoder) { $o = BxDolTranscoder::getObjectInstance($sObjectTranscoder); } else { $o = BxDolStorage::getObjectInstance($sObjectStorage); } if ($sImgUrl = $o->getFileUrlById($iIdThumb)) { $aCustomParams = array('img_url' => $sImgUrl, 'img_url_encoded' => rawurlencode($sImgUrl)); } } //TODO: Rebuild using menus engine when it will be ready for such elements like Vote, Share, etc. $sVotes = ''; $oVotes = BxDolVote::getObjectInstance($sObjectVote, $iId); if ($oVotes) { $sVotes = $oVotes->getElementBlock(array('show_do_vote_as_button' => true)); } $sShare = ''; if ($iIdForTimeline && BxDolRequest::serviceExists('bx_timeline', 'get_share_element_block')) { $sShare = BxDolService::call('bx_timeline', 'get_share_element_block', array(bx_get_logged_profile_id(), $this->_aModule['name'], 'added', $iIdForTimeline, array('show_do_share_as_button' => true))); } $sSocial = $bEnableSocialSharing ? BxTemplSocialSharing::getInstance()->getCode($iId, $this->_aModule['name'], BX_DOL_URL_ROOT . $sUrl, $sTitle, $aCustomParams) : ''; return $this->_oTemplate->parseHtmlByName('entry-share.html', array('comments' => $sComments, 'vote' => $sVotes, 'share' => $sShare, 'social' => $sSocial)); //TODO: Rebuild using menus engine when it will be ready for such elements like Vote, Share, etc. }
function __construct($sSystem, $iId, $iInit = 1) { parent::__construct($sSystem, $iId, $iInit); }
protected function _getFormObject($sAction, $iId) { $oForm = parent::_getFormObject($sAction, $iId); $sPrivacyObject = 'comments_view'; $sFieldName = BxDolPrivacy::getFieldName($sPrivacyObject); $aFieldDescriptor = BxDolPrivacy::getGroupChooser($sPrivacyObject); $aFieldDescriptor['caption'] = ''; $oForm->aInputs = bx_array_insert_after(array($sFieldName => $aFieldDescriptor), $oForm->aInputs, 'cmt_text'); return $oForm; }