function _addForm($sRedirectUrl)
{
bx_import('FormAdd', $this->_aModule);
$sClass = $this->_aModule['class_prefix'] . 'FormAdd';
$oForm = new $sClass($this, $this->_iProfileId);
$oForm->initChecker();
if ($oForm->isSubmittedAndValid()) {
$sStatus = $this->_oDb->getParam($this->_sPrefix . '_autoapproval') == 'on' || $this->isAdmin() ? 'approved' : 'pending';
$aValsAdd = array($this->_oDb->_sFieldCreated => time(), $this->_oDb->_sFieldUri => $oForm->generateUri(), $this->_oDb->_sFieldStatus => $sStatus);
$aValsAdd[$this->_oDb->_sFieldAuthorId] = $this->_iProfileId;
$iEntryId = $oForm->insert($aValsAdd);
if ($iEntryId) {
$this->isAllowedAdd(true);
// perform action
$oForm->processMedia($iEntryId, $this->_iProfileId);
$aDataEntry = $this->_oDb->getEntryByIdAndOwner($iEntryId, $this->_iProfileId, $this->isAdmin());
$this->onEventCreate($iEntryId, $sStatus, $aDataEntry);
if (!$sRedirectUrl) {
$sRedirectUrl = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aDataEntry[$this->_oDb->_sFieldUri];
}
header('Location:' . $sRedirectUrl);
exit;
} else {
MsgBox(_t('_Error Occured'));
}
} else {
echo $oForm->getCode();
}
}