OXID eShop CE  4.9.6
 All Classes Files Functions Variables Pages
newsletter_plain.php
Go to the documentation of this file.
1 <?php
2 
9 {
10 
18  public function render()
19  {
21 
22  $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
23  if ($soxId != "-1" && isset($soxId)) {
24  // load object
25  $oNewsletter = oxNew("oxnewsletter");
26  $oNewsletter->load($soxId);
27  $this->_aViewData["edit"] = $oNewsletter;
28  }
29 
30  return "newsletter_plain.tpl";
31  }
32 
36  public function save()
37  {
38  $soxId = $this->getEditObjectId();
39  $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
40 
41  // shopid
42  $sShopID = oxRegistry::getSession()->getVariable("actshop");
43  $aParams['oxnewsletter__oxshopid'] = $sShopID;
44 
45  $oNewsletter = oxNew("oxnewsletter");
46  if ($soxId != "-1") {
47  $oNewsletter->load($soxId);
48  } else {
49  $aParams['oxnewsletter__oxid'] = null;
50  }
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 }