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 43f63fe commit 90b525b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion modules/boonex/timeline/classes/BxTimelineTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function getViewsBlock($aParams)
$sTitle = _t('_bx_timeline_page_block_title_views_' . $aParams['view']);

if (bx_is_api())
return $this->getViewBlock($aParams);
return [['id' => 1, 'type' => 'browse', 'data' => ['unit' => 'feed', 'data' => $this->getViewBlock($aParams)]]];

return [
'content' => $this->parseHtmlByName('block_views.html', [
Expand Down
22 changes: 12 additions & 10 deletions template/scripts/BxBasePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,17 +419,19 @@ public function getPageBlocks ()
$aCells = $this->_oQuery->getPageBlocks();
foreach ($aCells as $sKey => $aCell) {
foreach ($aCell as $i => $aBlock) {
if (!$this->_isVisibleBlock($aBlock))
if (!$this->_isVisibleBlock($aBlock)){
unset($aCells[$sKey][$i]);

$this->processPageBlock($aCells[$sKey][$i], true);
$aBlock = $aCells[$sKey][$i];

$sFunc = '_getBlock' . ucfirst($aBlock['type']);
$aCells[$sKey][$i]['content'] = method_exists($this, $sFunc) ? $this->$sFunc($aBlock) : $aBlock['content'];
$aCells[$sKey][$i]['title'] = $this->getBlockTitle($aBlock);
foreach ($aFieldsUnset as $s)
unset($aCells[$sKey][$i][$s]);
}
else{
$this->processPageBlock($aCells[$sKey][$i], true);
$aBlock = $aCells[$sKey][$i];

$sFunc = '_getBlock' . ucfirst($aBlock['type']);
$aCells[$sKey][$i]['content'] = method_exists($this, $sFunc) ? $this->$sFunc($aBlock) : $aBlock['content'];
$aCells[$sKey][$i]['title'] = $this->getBlockTitle($aBlock);
foreach ($aFieldsUnset as $s)
unset($aCells[$sKey][$i][$s]);
}
}
}
return $aCells;
Expand Down
3 changes: 3 additions & 0 deletions template/scripts/BxBaseServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,9 @@ public function serviceGetParticipatingProfiles($iProfileId, $aConnectionObject
*/
public function serviceGetCreatePostForm($mixedContextId = false, $sDefault = '', $aCustom = array())
{
if (bx_is_api())
return ;

if(!isLogged() || ($mixedContextId !== false && !is_numeric($mixedContextId)))
return '';

Expand Down

0 comments on commit 90b525b

Please sign in to comment.