|
|
@@ -3556,10 +3556,17 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
|
|
|
$oForm->aInputs['text']['error'] = _t('_bx_timeline_txt_err_empty_post');
|
|
|
$oForm->setValid(false);
|
|
|
|
|
|
+ if (bx_is_api()){
|
|
|
+ $mixedResult['form_object'] = $oForm;
|
|
|
+ return $mixedResult;
|
|
|
+ }
|
|
|
+
|
|
|
return $this->_prepareResponse([
|
|
|
'form' => $oForm->getCode($bDynamicMode),
|
|
|
'form_id' => $oForm->id
|
|
|
], $bAjaxMode);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
$sTitle = $bText ? $this->_oConfig->getTitle($sText) : $this->_oConfig->getTitleDefault($bLinkIds, $bPhotoIds, $bVideoIds, $bFileIds);
|
|
|
@@ -3612,6 +3619,12 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
|
|
|
|
|
|
$this->onPost($iId);
|
|
|
|
|
|
+
|
|
|
+ if (bx_is_api()){
|
|
|
+ $mixedResult['form_object'] = $oForm;
|
|
|
+ return $mixedResult;
|
|
|
+ }
|
|
|
+
|
|
|
return $this->_prepareResponse(['id' => $iId], $bAjaxMode, [
|
|
|
'redirect' => $this->_oConfig->getItemViewUrl(['id' => $iId])
|
|
|
]);
|
|
|
@@ -3625,7 +3638,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
|
|
|
'form_id' => $oForm->id
|
|
|
], $bAjaxMode && $oForm->isSubmitted());
|
|
|
|
|
|
- if(is_array($mixedResult))
|
|
|
+ if(is_array($mixedResult) || bx_is_api())
|
|
|
$mixedResult['form_object'] = $oForm;
|
|
|
|
|
|
return $mixedResult;
|
|
|
@@ -5013,6 +5026,9 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
|
|
|
|
|
|
if($this->isAllowedPost() !== true)
|
|
|
return array();
|
|
|
+
|
|
|
+ if (bx_is_api())
|
|
|
+ return $this->_oTemplate->getPostBlock($this->_iOwnerId, $aParams);
|
|
|
|
|
|
return array(
|
|
|
'content' => $this->_oTemplate->getPostBlock($this->_iOwnerId, $aParams)
|