34 if ( !$this->
getConfig()->getConfigParam(
'blEnableDownloads' ) ) {
35 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_DISABLED_DOWNLOADABLE_PRODUCTS' );
39 if ( $oArticle->oxarticles__oxparentid->value) {
40 $oParentArticle =
oxNew(
'oxarticle' );
41 $oParentArticle->load( $oArticle->oxarticles__oxparentid->value);
42 $oArticle->oxarticles__oxisdownloadable =
new oxField( $oParentArticle->oxarticles__oxisdownloadable->value );
43 $this->_aViewData[
"oxparentid"] = $oArticle->oxarticles__oxparentid->value;
60 $oArticle->assign($aArticleChanges);
65 if (count($aArticleFiles) > 0) {
66 foreach ($aArticleFiles as $sArticleFileId => $aArticleFileUpdate) {
67 $oArticleFile =
oxNew(
'oxFile');
68 $oArticleFile->load($sArticleFileId);
70 $oArticleFile->assign($aArticleFileUpdate);
72 if ($oArticleFile->isUnderDownloadFolder()) {
73 $oArticleFile->save();
90 if ($this->_oArticle !== null && !$blReset) {
95 $oProduct =
oxNew(
'oxArticle' );
96 $oProduct->load( $sProductId );
97 $this->_oArticle = $oProduct;
112 $oEx =
oxNew(
"oxExceptionToDisplay" );
113 $oEx->setMessage(
'ARTICLE_EXTEND_UPLOADISDISABLED' );
123 $aNewFile = $this->
getConfig()->getUploadedFile(
"newArticleFile");
126 $oArticleFile =
oxNew(
"oxFile" );
127 $oArticleFile->assign($aParams);
129 if (!$aNewFile[
'name'] && !$oArticleFile->oxfiles__oxfilename->value) {
130 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_NOFILE' );
133 if ($aNewFile[
'name']) {
136 $oArticleFile->processFile(
'newArticleFile' );
138 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay( $e->getMessage() );
142 if (!$oArticleFile->isUnderDownloadFolder()) {
143 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_NOFILE');
148 $oArticleFile->save();
161 $oEx =
oxNew(
"oxExceptionToDisplay" );
162 $oEx->setMessage(
'ARTICLE_EXTEND_UPLOADISDISABLED' );
170 $oArticleFile =
oxNew(
'oxFile');
171 $oArticleFile->load($sArticleFileId);
172 if ($oArticleFile->hasValidDownloads()) {
173 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_DELETING_VALID_FILE' );
175 if ($oArticleFile->oxfiles__oxartid->value == $sArticleId) {
176 $oArticleFile->delete();
189 $iOption = ( $iOption < 0 ) ?
"" : $iOption;
202 if (!is_array($aParams)) {
206 if (!isset($aParams[
"oxfiles__oxdownloadexptime"]) || $aParams[
"oxfiles__oxdownloadexptime"] ==
"") {
207 $aParams[
"oxfiles__oxdownloadexptime"] = -1;
209 if (!isset($aParams[
"oxfiles__oxlinkexptime"]) || $aParams[
"oxfiles__oxlinkexptime"] ==
"") {
210 $aParams[
"oxfiles__oxlinkexptime"] = -1;
212 if (!isset($aParams[
"oxfiles__oxmaxunregdownloads"]) || $aParams[
"oxfiles__oxmaxunregdownloads"] ==
"") {
213 $aParams[
"oxfiles__oxmaxunregdownloads"] = -1;
215 if (!isset($aParams[
"oxfiles__oxmaxdownloads"]) || $aParams[
"oxfiles__oxmaxdownloads"] ==
"") {
216 $aParams[
"oxfiles__oxmaxdownloads"] = -1;