Skip to content

Commit

Permalink
Ticket #4558 - Build-in API support: Different.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Dec 15, 2023
1 parent 679a761 commit ed67598
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/boonex/timeline/classes/BxTimelineModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -3772,7 +3772,7 @@ public function getFormEdit($iId, $aParams = [], $aBrowseParams = [])
return [];

if(($mixedCheck = $this->isAllowedEdit($aEvent)) !== true)
return bx_is_api() ? bx_api_get_msg($mixedCheck !== false ? $mixedCheck : _t('_sys_txt_access_denied')) : ['message' => $mixedCheck !== false ? $mixedCheck : _t('_sys_txt_access_denied')];
return $this->_bIsApi ? bx_api_get_msg($mixedCheck !== false ? $mixedCheck : _t('_sys_txt_access_denied')) : ['message' => $mixedCheck !== false ? $mixedCheck : _t('_sys_txt_access_denied')];

$aContent = unserialize($aEvent['content']);
if(is_array($aContent) && !empty($aContent['text']))
Expand Down Expand Up @@ -3877,14 +3877,14 @@ public function getFormEdit($iId, $aParams = [], $aBrowseParams = [])
$oForm->aInputs['text']['error'] = _t('_bx_timeline_txt_err_empty_post');
$oForm->setValid(false);

return bx_is_api ? ['form' => $oForm->getCodeAPI()] : $this->_prepareResponse([
return $this->_bIsApi ? ['form' => $oForm->getCodeAPI()] : $this->_prepareResponse([
'form' => $sCodeAdd . $oForm->getCode($bDynamicMode),
'form_id' => $oForm->id
], $bAjaxMode);
}

if($oForm->update($iId, $aValsToAdd) === false)
return bx_is_api() ? bx_api_get_msg(_t('_bx_timeline_txt_err_cannot_perform_action')) : ['message' => _t('_bx_timeline_txt_err_cannot_perform_action')];
return $this->_bIsApi ? bx_api_get_msg(_t('_bx_timeline_txt_err_cannot_perform_action')) : ['message' => _t('_bx_timeline_txt_err_cannot_perform_action')];

$this->isAllowedEdit($aEvent, true);

Expand All @@ -3903,10 +3903,10 @@ public function getFormEdit($iId, $aParams = [], $aBrowseParams = [])

$this->getCacheItemObject()->removeAllByPrefix($this->_oConfig->getPrefix('cache_item') . $iId);

return bx_is_api() ? [ 'id' => $iId ] : [ 'id' => $iId ];
return $this->_bIsApi ? [ 'id' => $iId ] : [ 'id' => $iId ];
}

return bx_is_api() ? ['form' => $oForm->getCodeAPI()] : [
return $this->_bIsApi ? ['form' => $oForm->getCodeAPI()] : [
'id' => $iId,
'form' => $sCodeAdd . $oForm->getCode($bDynamicMode),
'form_id' => $oForm->id,
Expand Down

0 comments on commit ed67598

Please sign in to comment.