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);
70 $oArticleFile->save();
84 if ($this->_oArticle !== null && !$blReset) {
89 $oProduct =
oxNew(
'oxArticle');
90 $oProduct->load($sProductId);
91 $this->_oArticle = $oProduct;
106 $oEx =
oxNew(
"oxExceptionToDisplay");
107 $oEx->setMessage(
'ARTICLE_EXTEND_UPLOADISDISABLED');
117 $aNewFile = $this->
getConfig()->getUploadedFile(
"newArticleFile");
122 $oArticleFile =
oxNew(
"oxFile");
123 $oArticleFile->assign($aParams);
125 if (!$aNewFile[
'name'] && !$oArticleFile->oxfiles__oxfilename->value) {
126 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_NOFILE');
129 if ($aNewFile[
'name']) {
132 $oArticleFile->processFile(
'newArticleFile');
134 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay($e->getMessage());
140 $oArticleFile->save();
153 $oEx =
oxNew(
"oxExceptionToDisplay");
154 $oEx->setMessage(
'ARTICLE_EXTEND_UPLOADISDISABLED');
162 $oArticleFile =
oxNew(
'oxFile');
163 $oArticleFile->load($sArticleFileId);
164 if ($oArticleFile->hasValidDownloads()) {
165 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_DELETING_VALID_FILE');
167 if ($oArticleFile->oxfiles__oxartid->value == $sArticleId) {
168 $oArticleFile->delete();
181 $iOption = ($iOption < 0) ?
"" : $iOption;
195 if (!is_array($aParams)) {
199 if (!isset($aParams[
"oxfiles__oxdownloadexptime"]) || $aParams[
"oxfiles__oxdownloadexptime"] ==
"") {
200 $aParams[
"oxfiles__oxdownloadexptime"] = -1;
202 if (!isset($aParams[
"oxfiles__oxlinkexptime"]) || $aParams[
"oxfiles__oxlinkexptime"] ==
"") {
203 $aParams[
"oxfiles__oxlinkexptime"] = -1;
205 if (!isset($aParams[
"oxfiles__oxmaxunregdownloads"]) || $aParams[
"oxfiles__oxmaxunregdownloads"] ==
"") {
206 $aParams[
"oxfiles__oxmaxunregdownloads"] = -1;
208 if (!isset($aParams[
"oxfiles__oxmaxdownloads"]) || $aParams[
"oxfiles__oxmaxdownloads"] ==
"") {
209 $aParams[
"oxfiles__oxmaxdownloads"] = -1;