35 if (!$this->
getConfig()->getConfigParam(
'blEnableDownloads')) {
36 oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_DISABLED_DOWNLOADABLE_PRODUCTS');
40 if ($oArticle->oxarticles__oxparentid->value) {
41 $oParentArticle =
oxNew(
'oxarticle');
42 $oParentArticle->load($oArticle->oxarticles__oxparentid->value);
43 $oArticle->oxarticles__oxisdownloadable =
new oxField($oParentArticle->oxarticles__oxisdownloadable->value);
44 $this->_aViewData[
"oxparentid"] = $oArticle->oxarticles__oxparentid->value;
59 $oArticle->assign($aArticleChanges);
64 if (count($aArticleFiles) > 0) {
65 foreach ($aArticleFiles as $sArticleFileId => $aArticleFileUpdate) {
66 $oArticleFile =
oxNew(
'oxFile');
67 $oArticleFile->load($sArticleFileId);
69 $oArticleFile->assign($aArticleFileUpdate);
71 if ($oArticleFile->isUnderDownloadFolder()) {
72 $oArticleFile->save();
89 if ($this->_oArticle !== null && !$blReset) {
94 $oProduct =
oxNew(
'oxArticle');
95 $oProduct->load($sProductId);
96 $this->_oArticle = $oProduct;
111 $oEx =
oxNew(
"oxExceptionToDisplay");
112 $oEx->setMessage(
'ARTICLE_EXTEND_UPLOADISDISABLED');
122 $aNewFile = $this->
getConfig()->getUploadedFile(
"newArticleFile");
125 $oArticleFile =
oxNew(
"oxFile");
126 $oArticleFile->assign($aParams);
128 if (!$aNewFile[
'name'] && !$oArticleFile->oxfiles__oxfilename->value) {
129 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_NOFILE');
132 if ($aNewFile[
'name']) {
135 $oArticleFile->processFile(
'newArticleFile');
137 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay($e->getMessage());
141 if (!$oArticleFile->isUnderDownloadFolder()) {
142 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_NOFILE');
147 $oArticleFile->save();
160 $oEx =
oxNew(
"oxExceptionToDisplay");
161 $oEx->setMessage(
'ARTICLE_EXTEND_UPLOADISDISABLED');
169 $oArticleFile =
oxNew(
'oxFile');
170 $oArticleFile->load($sArticleFileId);
171 if ($oArticleFile->hasValidDownloads()) {
172 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_DELETING_VALID_FILE');
174 if ($oArticleFile->oxfiles__oxartid->value == $sArticleId) {
175 $oArticleFile->delete();
188 $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;