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 = oxConfig::getParameter( "oxid");
00022         // check if we right now saved a new entry
00023         $sSavedID = oxConfig::getParameter( "saved_oxid");
00024         if ( ($soxId == "-1" || !isset( $soxId)) && isset( $sSavedID) ) {
00025             $soxId = $sSavedID;
00026             oxSession::deleteVar( "saved_oxid");
00027             $this->_aViewData["oxid"] =  $soxId;
00028             // for reloading upper frame
00029             $this->_aViewData["updatelist"] =  "1";
00030         }
00031 
00032         if ( $soxId != "-1" && isset( $soxId)) {
00033             // load object
00034             $oNewsletter = oxNew( "oxnewsletter" );
00035             $oNewsletter->load( $soxId);
00036             $this->_aViewData["edit"] =  $oNewsletter;
00037         }
00038 
00039         return "newsletter_plain.tpl";
00040     }
00041 
00047     public function save()
00048     {
00049         $soxId      = oxConfig::getParameter( "oxid");
00050         $aParams    = oxConfig::getParameter( "editval");
00051 
00052         // shopid
00053         $sShopID = oxSession::getVar( "actshop");
00054         $aParams['oxnewsletter__oxshopid'] = $sShopID;
00055 
00056         $oNewsletter = oxNew( "oxnewsletter" );
00057         if ( $soxId != "-1")
00058             $oNewsletter->load( $soxId);
00059         else
00060             $aParams['oxnewsletter__oxid'] = null;
00061         //$aParams = $oNewsletter->ConvertNameArray2Idx( $aParams);
00062         $oNewsletter->assign( $aParams);
00063         $oNewsletter->save();
00064         // set oxid if inserted
00065         if ( $soxId == "-1")
00066             oxSession::setVar( "saved_oxid", $oNewsletter->oxnewsletter__oxid->value);
00067     }
00068 }

Generated on Tue Apr 21 15:45:44 2009 for OXID eShop CE by  doxygen 1.5.5