|
|
@@ -1135,21 +1135,23 @@ class BxBaseCmts extends BxDolCmts
|
|
|
protected function _getFormPost($iCmtParentId = 0, $aDp = [])
|
|
|
{
|
|
|
$bCmtParentId = !empty($iCmtParentId);
|
|
|
- if(!$bCmtParentId && !$this->isPostAllowed()) {
|
|
|
- $sMsg = '';
|
|
|
- if(!isLogged()) {
|
|
|
- $oPermalink = BxDolPermalinks::getInstance();
|
|
|
- $sMsg = _t('_cmt_msg_login_required', $oPermalink->permalink('page.php?i=login'), $oPermalink->permalink('page.php?i=create-account'));
|
|
|
+ if (!bx_is_api()){
|
|
|
+ if(!$bCmtParentId && !$this->isPostAllowed()) {
|
|
|
+ $sMsg = '';
|
|
|
+ if(!isLogged()) {
|
|
|
+ $oPermalink = BxDolPermalinks::getInstance();
|
|
|
+ $sMsg = _t('_cmt_msg_login_required', $oPermalink->permalink('page.php?i=login'), $oPermalink->permalink('page.php?i=create-account'));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ $sMsg = $this->msgErrPostAllowed();
|
|
|
+
|
|
|
+ return ['msg' => $sMsg];
|
|
|
}
|
|
|
- else
|
|
|
- $sMsg = $this->msgErrPostAllowed();
|
|
|
|
|
|
- return ['msg' => $sMsg];
|
|
|
+ if($bCmtParentId && !$this->isReplyAllowed($iCmtParentId))
|
|
|
+ return ['msg' => $this->msgErrReplyAllowed()];
|
|
|
}
|
|
|
|
|
|
- if($bCmtParentId && !$this->isReplyAllowed($iCmtParentId))
|
|
|
- return ['msg' => $this->msgErrReplyAllowed()];
|
|
|
-
|
|
|
$bDynamic = isset($aDp['dynamic_mode']) && (bool)$aDp['dynamic_mode'];
|
|
|
$bQuote = isset($aDp['quote']) && (bool)$aDp['quote'];
|
|
|
|
|
|
@@ -1234,7 +1236,7 @@ class BxBaseCmts extends BxDolCmts
|
|
|
return ['msg' => _t('_cmt_err_cannot_perform_action')];
|
|
|
}
|
|
|
|
|
|
- return ['form' => $oForm->getCode($bDynamic), 'form_id' => $oForm->id];
|
|
|
+ return ['form' => $oForm->getCode($bDynamic), 'form_id' => $oForm->id, 'frm' => $oForm];
|
|
|
}
|
|
|
|
|
|
protected function _getFormEdit($iCmtId, $aDp = [])
|