Skip to content

Commit

Permalink
#4148 - Build-in API support
Browse files Browse the repository at this point in the history
  • Loading branch information
romanlesnikov committed Jan 23, 2023
1 parent 78e5536 commit 43f63fe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/base/general/classes/BxBaseModGeneralModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -3463,7 +3463,7 @@ protected function _entityComments ($sObject, $iId = 0)
$aForm['id'] = 2;
}
else
$aData = ['id' => 2, 'type' => 'form', 'data' => $aForm->getCodeAPI(), 'request' => ['url' => '/api.php?r=' . $this->_aModule['name'] . '/entity_comments', 'immutable' => true]];
$aForm = ['id' => 2, 'type' => 'form', 'data' => $aForm->getCodeAPI(), 'request' => ['url' => '/api.php?r=' . $this->_aModule['name'] . '/entity_comments', 'immutable' => true]];


return [
Expand Down
3 changes: 3 additions & 0 deletions modules/boonex/timeline/classes/BxTimelineTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ public function getViewsBlock($aParams)

$sTitle = _t('_bx_timeline_page_block_title_views_' . $aParams['view']);

if (bx_is_api())
return $this->getViewBlock($aParams);

return [
'content' => $this->parseHtmlByName('block_views.html', [
'style_prefix' => $sStylePrefix,
Expand Down
15 changes: 14 additions & 1 deletion template/scripts/BxBaseFormView.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,18 @@ function getCodeAPI()
{
$this->aFormAttrs = $this->_replaceMarkers($this->aFormAttrs);


$this->sCode = false;
bx_alert('system', 'form_output', 0, 0, array(
'dynamic' => $this->_bDynamicMode,
'object' => &$this,
'code' => &$this->sCode,
'include' => &$sInclude
));

if($this->sCode === false)
$this->genForm();

// TODO: process inputs to translate titles, alerts, etc

return ['inputs' => $this->aInputs, 'attrs' => $this->aFormAttrs, 'params' => $this->aParams];
Expand Down Expand Up @@ -496,7 +508,8 @@ function genRows()
$sContHeader = '';
$sContFields = '';
$sFuncGenRow = isset($this->aParams['view_mode']) && $this->aParams['view_mode'] ? 'genViewRow' : 'genRow';
foreach ($this->aInputs as $aInput) {
foreach ($this->aInputs as &$aInput) {

if (!isset($aInput['visible_for_levels']) || self::isVisible($aInput)) {
if ('block_header' == $aInput['type'] && !$this->_bShowEmptySections) {
// don't show section with no fields or with empty fields
Expand Down

0 comments on commit 43f63fe

Please sign in to comment.