function _actionMarkFeatured($iEntryId, $sMsgSuccessAdd, $sMsgSuccessRemove)
{
header('Content-type:text/html;charset=utf-8');
$iEntryId = (int) $iEntryId;
if (!($aDataEntry = $this->_oDb->getEntryByIdAndOwner($iEntryId, $this->_iProfileId, $this->isAdmin()))) {
echo MsgBox(_t('_sys_request_page_not_found_cpt')) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div');
exit;
}
if (!$this->isAllowedMarkAsFeatured($aDataEntry) || 0 !== strcasecmp($_SERVER['REQUEST_METHOD'], 'POST')) {
echo MsgBox(_t('_Access denied')) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div');
exit;
}
if ($this->_oDb->markAsFeatured($iEntryId)) {
$this->isAllowedMarkAsFeatured($aDataEntry, true);
// perform action
$this->onEventMarkAsFeatured($iEntryId, $aDataEntry);
$sRedirect = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aDataEntry[$this->_oDb->_sFieldUri];
$sJQueryJS = genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div', $sRedirect);
echo MsgBox($aDataEntry[$this->_oDb->_sFieldFeatured] ? $sMsgSuccessRemove : $sMsgSuccessAdd) . $sJQueryJS;
exit;
}
echo MsgBox(_t('_Error Occured')) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div');
exit;
}