Skip to content

Commit

Permalink
Ticket #4817 - Courses improvements. Core changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Nov 5, 2024
1 parent 6b614d6 commit 3ccb69b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
4 changes: 4 additions & 0 deletions modules/base/general/classes/BxBaseModGeneralConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class BxBaseModGeneralConfig extends BxDolModuleConfig
protected $_aHtmlIds;
protected $_aGridObjects;

protected $_bIsApi;

/**
* Delayed Publishing Notification Time (in seconds)
* If video transcoding takes more than specified amount of time
Expand All @@ -39,6 +41,8 @@ function __construct($aModule)
$this->_aJsObjects = array();
$this->_aGridObjects = array();

$this->_bIsApi = bx_is_api();

$this->_iDpnTime = 3600;
}

Expand Down
1 change: 0 additions & 1 deletion modules/base/general/classes/BxBaseModGeneralFormEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,6 @@ protected function _processContextBeforeAdd()
'value' => (int)$iUsage
];
}

}

protected function _processContextAfterAdd($iContentId, $iContextNid, $iContextUsage = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,9 @@ protected function redirectAfterEdit($aContentInfo, $sUrl = '')
if ($sUrl == '')
$sUrl = 'page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']];

if(($mixedUrl = $this->_getRedirectFromContext('edit', $aContentInfo)) !== false)
$sUrl = $mixedUrl;

/**
* @hooks
* @hookdef hook-bx_base_general-redirect_after_edit '{module_name}', 'redirect_after_edit' - hook to override redirect URL which is used after content changing
Expand Down
5 changes: 3 additions & 2 deletions modules/base/groups/classes/BxBaseModGroupsFormEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ public function insert ($aValsToAdd = array(), $isIgnore = false)

$aValsToAdd[$CNF['FIELD_PUBLISHED']] = $iPublished;
}

$aValsToAdd[$CNF['FIELD_STATUS']] = (isset($CNF['FIELD_PUBLISHED']) && ($aValsToAdd[$CNF['FIELD_PUBLISHED']] > $aValsToAdd[$CNF['FIELD_ADDED']])) ? 'awaiting' : 'active';

if(!empty($CNF['FIELD_STATUS']) && empty($aValsToAdd[$CNF['FIELD_STATUS']]))
$aValsToAdd[$CNF['FIELD_STATUS']] = (isset($CNF['FIELD_PUBLISHED']) && ($aValsToAdd[$CNF['FIELD_PUBLISHED']] > $aValsToAdd[$CNF['FIELD_ADDED']])) ? 'awaiting' : 'active';

return parent::insert ($aValsToAdd, $isIgnore);
}
Expand Down
7 changes: 7 additions & 0 deletions modules/base/groups/classes/BxBaseModGroupsPageEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public function __construct($aObject, $oTemplate = false)
$sStatus = isset($CNF['FIELD_STATUS']) && isset($this->_aContentInfo[$CNF['FIELD_STATUS']]) ? $this->_aContentInfo[$CNF['FIELD_STATUS']] : '';
$sStatusAdmin = isset($CNF['FIELD_STATUS_ADMIN']) && isset($this->_aContentInfo[$CNF['FIELD_STATUS_ADMIN']]) ? $this->_aContentInfo[$CNF['FIELD_STATUS_ADMIN']] : '';

//--- Display message to context author if context isn't active
if ($bLoggedOwner && !empty($CNF['INFORMERS']['status'])) {
$aInformer = $CNF['INFORMERS']['status'];
if (isset($aInformer['map'][$sStatus]))
$aInformers[] = ['name' => $aInformer['name'], 'msg' => _t($aInformer['map'][$sStatus]), 'type' => BX_INFORMER_ALERT];
}

//--- Display 'approving' informer.
if(!empty($sStatusAdmin) && $sStatusAdmin != BX_BASE_MOD_GENERAL_STATUS_ACTIVE) {
if(!empty($CNF['INFORMERS']['approving']) && isset($CNF['INFORMERS']['approving']['map'][$sStatusAdmin])) {
Expand Down

0 comments on commit 3ccb69b

Please sign in to comment.