Skip to content

Commit

Permalink
Ticket #4148 - Build-in API support: Ads.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Nov 7, 2023
1 parent 59854e9 commit fc62cfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/boonex/ads/classes/BxAdsFormEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct($aInfo, $oTemplate = false)

$CNF = &$this->_oModule->_oConfig->CNF;

$this->_initCategoryFields();
$this->_initCategoryFields((int)BxDolSession::getInstance()->getValue($this->aParams['display'] . '_category'));

if(isset($this->aInputs[$CNF['FIELD_TITLE']], $this->aInputs[$CNF['FIELD_NAME']])) {
$sJsObject = $this->_oModule->_oConfig->getJsObject('form');
Expand Down
11 changes: 6 additions & 5 deletions modules/boonex/ads/classes/BxAdsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,17 @@ public function serviceMarkAs($sAction, $iContentId, $iProfileSrc = 0, $iProfile

public function serviceEntityCreate ($sParams = false)
{
if(($sDisplay = $this->getCategoryDisplay('add')) !== false) {
$iCategory = is_numeric($sParams) ? (int)$sParams : 0;

if(($sDisplay = $this->getCategoryDisplay('add', $iCategory)) !== false) {
if(empty($sParams) || !is_array($sParams))
$sParams = array();

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

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

if($iCategory)
BxDolSession::getInstance()->setValue($sDisplay . '_category', $iCategory);

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

0 comments on commit fc62cfe

Please sign in to comment.