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);
71 $oArticleFile->save();
85 if ($this->_oArticle !== null && !$blReset) {
90 $oProduct =
oxNew(
'oxArticle' );
91 $oProduct->load( $sProductId );
92 $this->_oArticle = $oProduct;
107 $oEx =
oxNew(
"oxExceptionToDisplay" );
108 $oEx->setMessage(
'ARTICLE_EXTEND_UPLOADISDISABLED' );
118 $aNewFile = $this->
getConfig()->getUploadedFile(
"newArticleFile");
123 $oArticleFile =
oxNew(
"oxFile" );
124 $oArticleFile->assign($aParams);
126 if (!$aNewFile[
'name'] && !$oArticleFile->oxfiles__oxfilename->value) {
127 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_NOFILE' );
130 if ($aNewFile[
'name']) {
133 $oArticleFile->processFile(
'newArticleFile' );
135 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay( $e->getMessage() );
141 $oArticleFile->save();
154 $oEx =
oxNew(
"oxExceptionToDisplay" );
155 $oEx->setMessage(
'ARTICLE_EXTEND_UPLOADISDISABLED' );
163 $oArticleFile =
oxNew(
'oxFile');
164 $oArticleFile->load($sArticleFileId);
165 if ($oArticleFile->hasValidDownloads()) {
166 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_DELETING_VALID_FILE' );
168 if ($oArticleFile->oxfiles__oxartid->value == $sArticleId) {
169 $oArticleFile->delete();
182 $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;