article_pictures.php

Go to the documentation of this file.
00001 <?php
00002 
00010 class Article_Pictures extends oxAdminDetails
00011 {
00018     public function render()
00019     {
00020         parent::render();
00021 
00022         $this->_aViewData["edit"] = $oArticle = oxNew( "oxarticle");
00023 
00024         $soxId = oxConfig::getParameter( 'oxid' );
00025         if ( $soxId != "-1" && isset( $soxId ) ) {
00026             // load object
00027             $oArticle->load( $soxId);
00028 
00029 
00030             // variant handling
00031             if ( $oArticle->oxarticles__oxparentid->value) {
00032                 $oParentArticle = oxNew( "oxarticle");
00033                 $oParentArticle->load( $oArticle->oxarticles__oxparentid->value);
00034                 $this->_aViewData["parentarticle"] =  $oParentArticle;
00035                 $this->_aViewData["oxparentid"] =  $oArticle->oxarticles__oxparentid->value;
00036             }
00037         }
00038 
00039         return "article_pictures.tpl";
00040     }
00041 
00047     public function save()
00048     {
00049         $myConfig  = $this->getConfig();
00050 
00051 
00052         $soxId      = oxConfig::getParameter( "oxid");
00053         $aParams    = oxConfig::getParameter( "editval");
00054 
00055         $oArticle = oxNew( "oxarticle");
00056         $oArticle->load( $soxId);
00057 
00058             // shopid
00059             $sShopID = oxSession::getVar( "actshop");
00060             $aParams['oxarticles__oxshopid'] = $sShopID;
00061 
00062             // #1173M - not all pic are deleted
00063             if (oxUtilsPic::getInstance()->overwritePic( $oArticle, 'oxarticles', 'oxthumb', 'TH', '0', $aParams, $myConfig->getAbsDynImageDir() ))
00064                 oxUtilsPic::getInstance()->overwritePic( $oArticle, 'oxarticles', 'oxicon', 'ICO', 'icon', $aParams, $myConfig->getAbsDynImageDir() );
00065 
00066             for ($i=1; $i<=$myConfig->getConfigParam( 'iPicCount' ); $i++)
00067                 oxUtilsPic::getInstance()->overwritePic( $oArticle, 'oxarticles', 'oxpic'.$i, 'P'.$i, $i, $aParams, $myConfig->getAbsDynImageDir());
00068             for ($i=1; $i<=$myConfig->getConfigParam( 'iZoomPicCount' ); $i++)
00069                 oxUtilsPic::getInstance()->overwritePic( $oArticle, 'oxarticles', 'oxzoom'.$i, 'Z'.$i, 'z'.$i, $aParams, $myConfig->getAbsDynImageDir());
00070 
00071         //$aParams = $oArticle->ConvertNameArray2Idx( $aParams);
00072         $oArticle->assign( $aParams);
00073         $oArticle = oxUtilsFile::getInstance()->processFiles( $oArticle );
00074         $oArticle->save();
00075 
00076         return $this->autosave();
00077     }
00078 }

Generated on Thu Dec 4 12:04:55 2008 for OXID eShop CE by  doxygen 1.5.5