19 parent::__construct($sSystem,
$iId, $iInit);
22 $this->iAutoHideRootPostForm = 1;
33 $mixedResult = parent::actionCmtPost();
34 if(
empty($mixedResult))
37 $aEvent = $this->_oModule->_oDb->getEvents(array(
'browse' =>
'id',
'object_id' => (
int)$this->
getId()));
38 if(isset($aEvent[
'owner_id']) && (
int)$aEvent[
'owner_id'] > 0) {
41 $oAlert =
new ChWsbAlerts(
'ch_' . $this->_oModule->_oConfig->getUri(),
'update', $aEvent[
'owner_id']);
54 $iObjectId = $this->
getId();
55 return $this->_oModule->_oTemplate->parseHtmlByTemplateName(
'comments', array(
57 'cmt_system' => $this->_sSystem,
58 'cmt_object' => $iObjectId,
59 'ch_if:show_replies' => array(
72 return $this->_oModule->_oTemplate->parseHtmlByTemplateName(
'comments', array(
74 'cmt_system' => $this->_sSystem,
75 'cmt_object' => $this->
getId(),
76 'ch_if:show_replies' => array(
77 'condition' => $iCommentId != 0,
88 $aEvent = $this->_oModule->_oDb->getEvents(array(
'browse' =>
'id',
'object_id' => $iEventId));
91 $iObjectId = $this->
getId();
94 'cmt_replies' => $this->_oQuery->getObjectCommentsCount($iObjectId, $iCmtId),
103 'js_object' => $this->_sJsObjName,
104 'id' => $aParams[
'cmt_id']
110 $sReplies =
_t(
'_wall_n_comments_long', $aParams[
'cmt_replies']);
112 'js_object' => $this->_sJsObjName,
113 'id' => $aParams[
'cmt_id'],
120 $oVote = $this->_oModule->_getObjectVoting($aEvent);
123 $bVote = $oVote->isEnabled() && $oVote->isVotingAllowed();
126 'content' => $oVote->getVotingTimeline()
131 $bVotes = $oVote->isEnabled();
133 $sVotes = $oVote->getHtmlId();
135 'content' => $oVote->getVotingTimelineCounter()
140 $sRepost = $sReposts =
'';
141 $bRepost = $this->_oModule->_isRepostAllowed($aEvent);
143 $iOwnerId = $this->_oModule->_getAuthorId();
144 $iObjectId = $this->_oModule->_oConfig->isSystem($aEvent[
'type'], $aEvent[
'action']) ? $aEvent[
'object_id'] : $aEvent[
'id'];
146 $sRepost = $this->_oModule->serviceGetRepostElementBlock($iOwnerId, $aEvent[
'type'], $aEvent[
'action'], $iObjectId, array(
147 'show_do_repost_as_button_small' =>
true,
148 'show_do_repost_icon' =>
true,
149 'show_do_repost_label' =>
false,
150 'show_counter' =>
false
153 $sReposts = $this->_oModule->serviceGetRepostCounter($aEvent[
'type'], $aEvent[
'action'], $iObjectId, array(
154 'text_counter' =>
'_wall_n_reposts_long',
155 'text_counter_empty' =>
'_wall_no_reposts_long',
159 return $this->_oModule->_oTemplate->parseHtmlByTemplateName(
'actions', array(
160 'html_id_voting' => $sVotes,
161 'date' => $aEvent[
'ago'],
162 'ch_if:show_delete' => array(
163 'condition' => $this->_oModule->_isCommentDeleteAllowed($aEvent),
165 'js_view_object' => $this->_oModule->_oConfig->getJsObject(
'view'),
166 'id' => $aEvent[
'id']
169 'ch_if:show_reply' => array(
170 'condition' => $bReply,
173 'ch_if:show_replies' => array(
174 'condition' => $bReplies,
175 'content' => $aReplies
177 'ch_if:show_vote' => array(
178 'condition' => $bVote,
181 'ch_if:show_votes' => array(
182 'condition' => $bVotes,
185 'ch_if:show_repost' => array(
186 'condition' => $bRepost,
188 'content' => $sRepost
191 'ch_if:show_reposts' => array(
192 'condition' => $bRepost,
194 'content' => $sReposts