|
@@ -297,6 +297,7 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
|
|
|
`RootStylePrefix` AS `root_style_prefix`,
|
|
`RootStylePrefix` AS `root_style_prefix`,
|
|
|
`BaseUrl` AS `base_url`,
|
|
`BaseUrl` AS `base_url`,
|
|
|
`ObjectVote` AS `object_vote`,
|
|
`ObjectVote` AS `object_vote`,
|
|
|
|
|
+ `ObjectReport` AS `object_report`,
|
|
|
`TriggerTable` AS `trigger_table`,
|
|
`TriggerTable` AS `trigger_table`,
|
|
|
`TriggerFieldId` AS `trigger_field_id`,
|
|
`TriggerFieldId` AS `trigger_field_id`,
|
|
|
`TriggerFieldAuthor` AS `trigger_field_author`,
|
|
`TriggerFieldAuthor` AS `trigger_field_author`,
|
|
@@ -443,6 +444,18 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
|
|
|
return $oVote;
|
|
return $oVote;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function getReportObject($iId)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(empty($this->_aSystem['object_report']))
|
|
|
|
|
+ $this->_aSystem['object_report'] = 'sys_cmts';
|
|
|
|
|
+
|
|
|
|
|
+ $oReport = BxDolReport::getObjectInstance($this->_aSystem['object_report'], $iId, true, $this->_oTemplate);
|
|
|
|
|
+ if(!$oReport || !$oReport->isEnabled())
|
|
|
|
|
+ return false;
|
|
|
|
|
+
|
|
|
|
|
+ return $oReport;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function getNotificationId()
|
|
public function getNotificationId()
|
|
|
{
|
|
{
|
|
|
return 'cmts-notification-' . $this->_sSystem . '-' . $this->_iId;
|
|
return 'cmts-notification-' . $this->_sSystem . '-' . $this->_iId;
|
|
@@ -703,6 +716,22 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
|
|
|
return $oVote->isAllowedVote($isPerformAction);
|
|
return $oVote->isAllowedVote($isPerformAction);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function isReportAllowed ($aCmt, $isPerformAction = false)
|
|
|
|
|
+ {
|
|
|
|
|
+ $oReport = $this->getReportObject($aCmt['cmt_id']);
|
|
|
|
|
+ if($oReport === false)
|
|
|
|
|
+ return false;
|
|
|
|
|
+
|
|
|
|
|
+ $iUserId = (int)$this->_getAuthorId();
|
|
|
|
|
+ if($iUserId == 0)
|
|
|
|
|
+ return false;
|
|
|
|
|
+
|
|
|
|
|
+ if(isAdmin())
|
|
|
|
|
+ return true;
|
|
|
|
|
+
|
|
|
|
|
+ return $oReport->isAllowedReport($isPerformAction);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function isPostReplyAllowed ($isPerformAction = false)
|
|
public function isPostReplyAllowed ($isPerformAction = false)
|
|
|
{
|
|
{
|
|
|
$mixedResult = BxDolService::call($this->_aSystem['module'], 'check_allowed_comments_post', array($this->getId(), $this->getSystemName()));
|
|
$mixedResult = BxDolService::call($this->_aSystem['module'], 'check_allowed_comments_post', array($this->getId(), $this->getSystemName()));
|