28 $this->_aViewData[
'edit'] = $oArticle =
oxNew(
'oxArticle' );
35 if ( $soxId !=
"-1" && isset( $soxId ) ) {
37 $oArticle->loadInLang( $this->_iEditLang, $soxId );
41 $oOtherLang = $oArticle->getAvailableInLangs();
42 if (!isset($oOtherLang[$this->_iEditLang])) {
44 $oArticle->loadInLang( key($oOtherLang), $soxId );
47 foreach ( $oOtherLang as $id => $language) {
48 $oLang=
new stdClass();
49 $oLang->sLangDesc = $language;
51 $this->_aViewData[
"otherlang"][$id] = clone $oLang;
55 if ( $oArticle->oxarticles__oxparentid->value) {
56 $oParentArticle =
oxNew(
'oxArticle' );
57 $oParentArticle->load( $oArticle->oxarticles__oxparentid->value);
58 $this->_aViewData[
"parentarticle"] = $oParentArticle;
59 $this->_aViewData[
"oxparentid"] = $oArticle->oxarticles__oxparentid->value;
67 $sArticleTable = getViewName(
'oxarticles', $this->_iEditLang );
68 $sSelect =
"select $sArticleTable.oxtitle, $sArticleTable.oxartnum, $sArticleTable.oxvarselect from $sArticleTable where 1 ";
70 $sSelect .=
$myConfig->getConfigParam(
'blVariantsSelection' )?
'':
" and $sArticleTable.oxparentid = '' ";
71 $sSelect .=
" and $sArticleTable.oxid = ".$oDB->quote( $oArticle->oxarticles__oxbundleid->value );
73 $rs = $oDB->Execute( $sSelect);
74 if ($rs !=
false && $rs->RecordCount() > 0) {
76 $sArtNum =
new oxField($rs->fields[1]);
77 $sArtTitle =
new oxField($rs->fields[0].
" ".$rs->fields[2]);
81 $this->_aViewData[
'bundle_artnum'] = $sArtNum;
82 $this->_aViewData[
'bundle_title'] = $sArtTitle;
85 $iAoc = $this->
getConfig()->getRequestParameter(
"aoc");
87 $oArticleExtendAjax =
oxNew(
'article_extend_ajax' );
88 $this->_aViewData[
'oxajax'] = $oArticleExtendAjax->getColumns();
90 return "popups/article_extend.tpl";
91 } elseif ( $iAoc == 2 ) {
92 $oArticleBundleAjax =
oxNew(
'article_bundle_ajax' );
93 $this->_aViewData[
'oxajax'] = $oArticleBundleAjax->getColumns();
95 return "popups/article_bundle.tpl";
99 $this->_aViewData[
'aMediaUrls'] = $oArticle->getMediaUrls();
101 return "article_extend.tpl";
113 $aMyFile = $this->
getConfig()->getUploadedFile(
"myfile" );
114 $aMediaFile = $this->
getConfig()->getUploadedFile(
"mediaFile" );
115 if ( is_array( $aMyFile[
'name'] ) && reset( $aMyFile[
'name'] ) || $aMediaFile[
'name'] ) {
118 $oEx =
oxNew(
"oxExceptionToDisplay" );
119 $oEx->setMessage(
'ARTICLE_EXTEND_UPLOADISDISABLED' );
129 if ( !isset( $aParams[
'oxarticles__oxissearch'])) {
130 $aParams[
'oxarticles__oxissearch'] = 0;
132 if ( !isset( $aParams[
'oxarticles__oxblfixedprice'])) {
133 $aParams[
'oxarticles__oxblfixedprice'] = 0;
143 $oArticle =
oxNew(
"oxarticle" );
144 $oArticle->loadInLang( $this->_iEditLang, $soxId);
146 if ( $aParams[
'oxarticles__oxtprice'] != $oArticle->oxarticles__oxtprice->value && $aParams[
'oxarticles__oxtprice'] && $aParams[
'oxarticles__oxtprice'] <= $oArticle->oxarticles__oxprice->value) {
147 $this->_aViewData[
"errorsavingtprice"] = 1;
150 $oArticle->setLanguage(0);
151 $oArticle->assign( $aParams);
152 $oArticle->setLanguage($this->_iEditLang);
157 $sMediaUrl = $this->
getConfig()->getRequestParameter(
"mediaUrl" );
158 $sMediaDesc = $this->
getConfig()->getRequestParameter(
"mediaDesc");
160 if ( ( $sMediaUrl && $sMediaUrl !=
'http://' ) || $aMediaFile[
'name'] || $sMediaDesc ) {
162 if ( !$sMediaDesc ) {
163 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_NODESCRIPTIONADDED' );
166 if ( ( !$sMediaUrl || $sMediaUrl ==
'http://' ) && !$aMediaFile[
'name'] ) {
167 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_NOMEDIAADDED' );
170 $oMediaUrl =
oxNew(
"oxMediaUrl" );
171 $oMediaUrl->setLanguage( $this->_iEditLang );
175 if ($aMediaFile[
'name']) {
177 $sMediaUrl =
oxRegistry::get(
"oxUtilsFile")->processFile(
'mediaFile',
'out/media/' );
180 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay( $e->getMessage() );
192 oxNew(
"oxArticleList" )->renewPriceUpdateTime();
203 $sMediaId = $this->
getConfig()->getRequestParameter(
"mediaid" );
204 if ($sMediaId && $soxId) {
205 $oMediaUrl =
oxNew(
"oxMediaUrl");
206 $oMediaUrl->load($sMediaId);
207 $oMediaUrl->delete();
221 $aParams[
'oxarticles__oxexturl'] = str_replace(
"http://",
"", $aParams[
'oxarticles__oxexturl']);
233 $aMediaUrls = $this->
getConfig()->getRequestParameter(
'aMediaUrls' );
234 if ( is_array( $aMediaUrls ) ) {
235 foreach ( $aMediaUrls as $sMediaId => $aMediaParams ) {
236 $oMedia =
oxNew(
"oxMediaUrl");
237 if ( $oMedia->load( $sMediaId ) ) {
238 $oMedia->setLanguage(0);
239 $oMedia->assign( $aMediaParams );
240 $oMedia->setLanguage( $this->_iEditLang );
254 if ( $this->_aUnitsArray === null ) {
255 $this->_aUnitsArray =
oxRegistry::getLang()->getSimilarByKey(
"_UNIT_", $this->_iEditLang,
false );