OXID eShop CE  4.8.11
 All Classes Files Functions Variables Pages
newsletter_plain.php
Go to the documentation of this file.
1 <?php
2 
9 {
17  public function render()
18  {
20 
21  $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
22  if ( $soxId != "-1" && isset( $soxId)) {
23  // load object
24  $oNewsletter = oxNew( "oxnewsletter" );
25  $oNewsletter->load( $soxId);
26  $this->_aViewData["edit"] = $oNewsletter;
27  }
28 
29  return "newsletter_plain.tpl";
30  }
31 
37  public function save()
38  {
39  $soxId = $this->getEditObjectId();
40  $aParams = oxConfig::getParameter( "editval");
41 
42  // shopid
43  $sShopID = oxSession::getVar( "actshop");
44  $aParams['oxnewsletter__oxshopid'] = $sShopID;
45 
46  $oNewsletter = oxNew( "oxnewsletter" );
47  if ( $soxId != "-1")
48  $oNewsletter->load( $soxId);
49  else
50  $aParams['oxnewsletter__oxid'] = null;
51  //$aParams = $oNewsletter->ConvertNameArray2Idx( $aParams);
52  $oNewsletter->assign( $aParams);
53  $oNewsletter->save();
54 
55  // set oxid if inserted
56  $this->setEditObjectId( $oNewsletter->getId() );
57  }
58 }