article_pictures.php

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

Generated on Wed May 13 13:25:50 2009 for OXID eShop CE by  doxygen 1.5.5