newsletter_plain.php

Go to the documentation of this file.
00001 <?php
00002 
00009 class Newsletter_Plain extends oxAdminDetails
00010 {
00018     public function render()
00019     {
00020         parent::render();
00021 
00022         $soxId = oxConfig::getParameter( "oxid");
00023         // check if we right now saved a new entry
00024         $sSavedID = oxConfig::getParameter( "saved_oxid");
00025         if ( ($soxId == "-1" || !isset( $soxId)) && isset( $sSavedID) ) {
00026             $soxId = $sSavedID;
00027             oxSession::deleteVar( "saved_oxid");
00028             $this->_aViewData["oxid"] =  $soxId;
00029             // for reloading upper frame
00030             $this->_aViewData["updatelist"] =  "1";
00031         }
00032 
00033         if ( $soxId != "-1" && isset( $soxId)) {
00034             // load object
00035             $oNewsletter = oxNew( "oxnewsletter" );
00036             $oNewsletter->load( $soxId);
00037             $this->_aViewData["edit"] =  $oNewsletter;
00038         }
00039 
00040         return "newsletter_plain.tpl";
00041     }
00042 
00048     public function save()
00049     {
00050         $soxId      = oxConfig::getParameter( "oxid");
00051         $aParams    = oxConfig::getParameter( "editval");
00052 
00053         // shopid
00054         $sShopID = oxSession::getVar( "actshop");
00055         $aParams['oxnewsletter__oxshopid'] = $sShopID;
00056 
00057         $oNewsletter = oxNew( "oxnewsletter" );
00058         if ( $soxId != "-1")
00059             $oNewsletter->load( $soxId);
00060         else
00061             $aParams['oxnewsletter__oxid'] = null;
00062         //$aParams = $oNewsletter->ConvertNameArray2Idx( $aParams);
00063         $oNewsletter->assign( $aParams);
00064         $oNewsletter->save();
00065         // set oxid if inserted
00066         if ( $soxId == "-1")
00067             oxSession::setVar( "saved_oxid", $oNewsletter->oxnewsletter__oxid->value);
00068 
00069         return $this->autosave();
00070     }
00071 }

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