Skip to content

Commit

Permalink
#4148 - Build-in API support (ads + small changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
romanlesnikov committed Nov 7, 2023
1 parent 684555c commit 49fc235
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/base/profile/classes/BxBaseModProfileModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -2101,8 +2101,8 @@ public function decodeDataAPI($aData, $aParams = [])

if(getParam('sys_api_conn_in_prof_units') == 'on' && ($oProfile = BxDolProfile::getInstanceByContentAndType($aData[$CNF['FIELD_ID']], $sModule)) !== false) {
$iProfileId = $oProfile->id();

if(($oConnection = BxDolConnection::getObjectInstance('sys_profiles_friends')) !== false) {
$aResult['title'] = $oProfile->getDisplayName();
if(($oConnection = BxDolConnection::getObjectInstance('sys_profiles_friends')) !== false && isset($CNF['URI_VIEW_FRIENDS'])) {
$aResult['friends_count'] = $oConnection->getConnectedContentCount($iProfileId, true);
$aResult['friends_list'] = $oConnection->getConnectedListAPI($iProfileId, true, BX_CONNECTIONS_CONTENT_TYPE_CONTENT);
if(isLogged()) {
Expand Down
8 changes: 5 additions & 3 deletions modules/boonex/ads/classes/BxAdsFormsEntryHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ public function viewDataEntry ($iContentId)
$oForm->initChecker($aContentInfo);

if(!empty($CNF['FIELD_TEXT']) && !$oForm->isInputVisible($CNF['FIELD_TEXT']))
return '';

return $this->_oModule->_oTemplate->entryText($aContentInfo);
$s = '';
else
$s = $this->_oModule->_oTemplate->entryText($aContentInfo);

return bx_is_api() ? [bx_api_get_block('entity_text', $s)] : $s;
}

public function onDataAddAfter($iAccountId, $iContentId)
Expand Down
4 changes: 4 additions & 0 deletions modules/boonex/ads/classes/BxAdsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ public function serviceEntityCreate ($sParams = false)

$sParams['display'] = $sDisplay;
}

if (is_int($sParams)){
$_GET['category'] = $sParams;
}

return parent::serviceEntityCreate($sParams);
}
Expand Down

0 comments on commit 49fc235

Please sign in to comment.