newsletter_plain.php

Go to the documentation of this file.
00001 <?php
00002 
00008 class Newsletter_Plain extends oxAdminDetails
00009 {
00017     public function render()
00018     {
00019         parent::render();
00020 
00021         $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
00022         if ( $soxId != "-1" && isset( $soxId)) {
00023             // load object
00024             $oNewsletter = oxNew( "oxnewsletter" );
00025             $oNewsletter->load( $soxId);
00026             $this->_aViewData["edit"] =  $oNewsletter;
00027         }
00028 
00029         return "newsletter_plain.tpl";
00030     }
00031 
00037     public function save()
00038     {
00039         $soxId = $this->getEditObjectId();
00040         $aParams    = oxConfig::getParameter( "editval");
00041 
00042         // shopid
00043         $sShopID = oxSession::getVar( "actshop");
00044         $aParams['oxnewsletter__oxshopid'] = $sShopID;
00045 
00046         $oNewsletter = oxNew( "oxnewsletter" );
00047         if ( $soxId != "-1")
00048             $oNewsletter->load( $soxId);
00049         else
00050             $aParams['oxnewsletter__oxid'] = null;
00051         //$aParams = $oNewsletter->ConvertNameArray2Idx( $aParams);
00052         $oNewsletter->assign( $aParams);
00053         $oNewsletter->save();
00054 
00055         // set oxid if inserted
00056         $this->setEditObjectId( $oNewsletter->getId() );
00057     }
00058 }