本文整理汇总了PHP中oxAdminDetails::save方法的典型用法代码示例。如果您正苦于以下问题:PHP oxAdminDetails::save方法的具体用法?PHP oxAdminDetails::save怎么用?PHP oxAdminDetails::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxAdminDetails
的用法示例。
在下文中一共展示了oxAdminDetails::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* Saves selection list parameters changes.
*
* @return mixed
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = oxRegistry::getConfig()->getRequestParameter("editval");
if (!isset($aParams['oxvendor__oxactive'])) {
$aParams['oxvendor__oxactive'] = 0;
}
$oVendor = oxNew("oxvendor");
if ($soxId != "-1") {
$oVendor->loadInLang($this->_iEditLang, $soxId);
} else {
$aParams['oxvendor__oxid'] = null;
}
//Disable editing for derived articles
if ($oVendor->isDerived()) {
return;
}
$oVendor->setLanguage(0);
$oVendor->assign($aParams);
$oVendor->setLanguage($this->_iEditLang);
$oVendor = oxRegistry::get("oxUtilsFile")->processFiles($oVendor);
$oVendor->save();
// set oxid if inserted
$this->setEditObjectId($oVendor->getId());
}
示例2: save
/**
* Saves changed main shop configuration parameters.
*
* @return null
*/
public function save()
{
parent::save();
$myConfig = $this->getConfig();
$soxId = $this->getEditObjectId();
$aParams = oxConfig::getParameter("editval");
// #918 S
// checkbox handling
$aParams['oxshops__oxactive'] = isset($aParams['oxshops__oxactive']) && $aParams['oxshops__oxactive'] == true ? 1 : 0;
$aParams['oxshops__oxproductive'] = isset($aParams['oxshops__oxproductive']) && $aParams['oxshops__oxproductive'] == true ? 1 : 0;
$isubjlang = oxConfig::getParameter("subjlang");
$iLang = $isubjlang && $isubjlang > 0 ? $isubjlang : 0;
$oShop = oxNew("oxshop");
if ($soxId != "-1") {
$oShop->loadInLang($iLang, $soxId);
} else {
$aParams['oxshops__oxid'] = null;
}
if ($aParams['oxshops__oxsmtp']) {
$aParams['oxshops__oxsmtp'] = trim($aParams['oxshops__oxsmtp']);
}
$oShop->setLanguage(0);
$oShop->assign($aParams);
$oShop->setLanguage($iLang);
if ($sNewSMPTPass = oxConfig::getParameter("oxsmtppwd")) {
$oShop->oxshops__oxsmtppwd->setValue($sNewSMPTPass == '-' ? "" : $sNewSMPTPass);
}
$oShop->save();
$this->_aViewData["updatelist"] = "1";
oxSession::setVar("actshop", $soxId);
}
示例3: save
/**
* Saves user extended information.
*
* @return mixed
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
if (!$this->_allowAdminEdit($soxId)) {
return false;
}
$aParams = oxRegistry::getConfig()->getRequestParameter("editval");
$oUser = oxNew("oxuser");
if ($soxId != "-1") {
$oUser->load($soxId);
} else {
$aParams['oxuser__oxid'] = null;
}
// checkbox handling
$aParams['oxuser__oxactive'] = $oUser->oxuser__oxactive->value;
$blNewsParams = oxRegistry::getConfig()->getRequestParameter("editnews");
if (isset($blNewsParams)) {
$oNewsSubscription = $oUser->getNewsSubscription();
$oNewsSubscription->setOptInStatus((int) $blNewsParams);
$oNewsSubscription->setOptInEmailStatus((int) oxRegistry::getConfig()->getRequestParameter("emailfailed"));
}
$oUser->assign($aParams);
$oUser->save();
// set oxid if inserted
$this->setEditObjectId($oUser->getId());
}
示例4: save
/**
* Saves deliveryset information changes.
*
* @return mixed
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = oxRegistry::getConfig()->getRequestParameter("editval");
$oDelSet = oxNew("oxdeliveryset");
if ($soxId != "-1") {
$oDelSet->loadInLang($this->_iEditLang, $soxId);
} else {
$aParams['oxdeliveryset__oxid'] = null;
}
// checkbox handling
if (!isset($aParams['oxdeliveryset__oxactive'])) {
$aParams['oxdeliveryset__oxactive'] = 0;
}
//Disable editing for derived articles
if ($oDelSet->isDerived()) {
return;
}
//$aParams = $oDelSet->ConvertNameArray2Idx( $aParams);
$oDelSet->setLanguage(0);
$oDelSet->assign($aParams);
$oDelSet->setLanguage($this->_iEditLang);
$oDelSet = oxRegistry::get("oxUtilsFile")->processFiles($oDelSet);
$oDelSet->save();
// set oxid if inserted
$this->setEditObjectId($oDelSet->getId());
}
示例5: save
/**
* Saves news text.
*
* @return mixed
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = oxRegistry::getConfig()->getRequestParameter("editval");
$oNews = oxNew("oxnews");
$iNewsLang = oxRegistry::getConfig()->getRequestParameter("newslang");
if (!isset($iNewsLang)) {
$iNewsLang = $this->_iEditLang;
}
if ($soxId != "-1") {
$oNews->loadInLang($iNewsLang, $soxId);
} else {
$aParams['oxnews__oxid'] = null;
}
// Disable editing for derived items.
if ($oNews->isDerived()) {
return;
}
$oNews->setLanguage(0);
$oNews->assign($aParams);
$oNews->setLanguage($iNewsLang);
$oNews->save();
// set oxid if inserted
$this->setEditObjectId($oNews->getId());
}
示例6: save
/**
* Saves deliveryset information changes.
*
* @return mixed
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = oxConfig::getParameter("editval");
// shopid
$sShopID = oxSession::getVar("actshop");
$aParams['oxdeliveryset__oxshopid'] = $sShopID;
$oDelSet = oxNew("oxdeliveryset");
if ($soxId != "-1") {
$oDelSet->loadInLang($this->_iEditLang, $soxId);
} else {
$aParams['oxdeliveryset__oxid'] = null;
}
// checkbox handling
if (!isset($aParams['oxdeliveryset__oxactive'])) {
$aParams['oxdeliveryset__oxactive'] = 0;
}
//$aParams = $oDelSet->ConvertNameArray2Idx( $aParams);
$oDelSet->setLanguage(0);
$oDelSet->assign($aParams);
$oDelSet->setLanguage($this->_iEditLang);
$oDelSet = oxUtilsFile::getInstance()->processFiles($oDelSet);
$oDelSet->save();
// set oxid if inserted
$this->setEditObjectId($oDelSet->getId());
}
示例7: save
/**
* Speichert den Standort mit den jeweiligen Parameter
* Saves selection list parameters changes.
*
* @return mixed
*/
public function save()
{
parent::save();
$this->resetContentCache();
$soxId = $this->getEditObjectId();
$aParams = oxConfig::getParameter("editval");
if (!isset($aParams['stores__store_active'])) {
$aParams['stores__store_active'] = 0;
}
$oShoplocator = oxNew("shoplocator");
if (isset($aParams['stores__store_address'])) {
$address = str_replace(' ', '', $aParams['stores__store_address']) . "+" . $aParams['stores__store_city'] . "+" . $aParams['stores__store_zip'];
$pc = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . $address . '&sensor=false');
$output = json_decode($pc);
$aParams['stores__store_latitude'] = $output->results[0]->geometry->location->lat;
$aParams['stores__store_logitude'] = $output->results[0]->geometry->location->lng;
}
if ($soxId != "-1") {
$oShoplocator->load($soxId);
} else {
$aParams['stores__oxid'] = null;
}
//Disable editing for derived articles
if ($oShoplocator->isDerived()) {
return;
}
$oShoplocator->assign($aParams);
$oShoplocator->save();
// set oxid if inserted
$this->setEditObjectId($oShoplocator->getId());
}
示例8: save
/**
* Saves main wrapping parameters.
*
* @return null
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = oxRegistry::getConfig()->getRequestParameter("editval");
// checkbox handling
if (!isset($aParams['oxwrapping__oxactive'])) {
$aParams['oxwrapping__oxactive'] = 0;
}
// shopid
$aParams['oxwrapping__oxshopid'] = oxRegistry::getSession()->getVariable("actshop");
$oWrapping = oxNew("oxwrapping");
if ($soxId != "-1") {
$oWrapping->loadInLang($this->_iEditLang, $soxId);
// #1173M - not all pic are deleted, after article is removed
oxRegistry::get("oxUtilsPic")->overwritePic($oWrapping, 'oxwrapping', 'oxpic', 'WP', '0', $aParams, $this->getConfig()->getPictureDir(false));
} else {
$aParams['oxwrapping__oxid'] = null;
//$aParams = $oWrapping->ConvertNameArray2Idx( $aParams);
}
$oWrapping->setLanguage(0);
$oWrapping->assign($aParams);
$oWrapping->setLanguage($this->_iEditLang);
$oWrapping = oxRegistry::get("oxUtilsFile")->processFiles($oWrapping);
$oWrapping->save();
// set oxid if inserted
$this->setEditObjectId($oWrapping->getId());
}
示例9: save
/**
* Saves category description text to DB.
*
* @return mixed
*/
public function save()
{
parent::save();
$myConfig = $this->getConfig();
$soxId = $this->getEditObjectId();
$aParams = oxRegistry::getConfig()->getRequestParameter("editval");
$oCategory = oxNew("oxCategory");
$iCatLang = oxRegistry::getConfig()->getRequestParameter("catlang");
$iCatLang = $iCatLang ? $iCatLang : 0;
if ($soxId != "-1") {
$oCategory->loadInLang($iCatLang, $soxId);
} else {
$aParams['oxcategories__oxid'] = null;
}
//Disable editing for derived items
if ($oCategory->isDerived()) {
return;
}
$oCategory->setLanguage(0);
$oCategory->assign($aParams);
$oCategory->setLanguage($iCatLang);
$oCategory->save();
// set oxid if inserted
$this->setEditObjectId($oCategory->getId());
}
示例10: save
/**
* Saves main orders configuration parameters.
*
* @return string
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = oxConfig::getParameter("editval");
// shopid
$sShopID = oxSession::getVar("actshop");
$aParams['oxorder__oxshopid'] = $sShopID;
$oOrder = oxNew("oxorder");
if ($soxId != "-1") {
$oOrder->load($soxId);
} else {
$aParams['oxorder__oxid'] = null;
}
$oOrder->assign($aParams);
$aDynvalues = oxConfig::getParameter("dynvalue");
if (isset($aDynvalues)) {
// #411 Dodger
$oPayment = oxNew("oxuserpayment");
$oPayment->load($oOrder->oxorder__oxpaymentid->value);
$oPayment->oxuserpayments__oxvalue->setValue(oxUtils::getInstance()->assignValuesToText($aDynvalues));
$oPayment->save();
}
// keeps old delivery cost
$oOrder->reloadDelivery(false);
// keeps old discount
$oOrder->reloadDiscount(false);
$oOrder->recalculateOrder();
// set oxid if inserted
$this->setEditObjectId($oOrder->getId());
}
示例11: save
/**
* Saves selection list parameters changes.
*
* @return mixed
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = oxRegistry::getConfig()->getRequestParameter("editval");
if (!isset($aParams['oxmanufacturers__oxactive'])) {
$aParams['oxmanufacturers__oxactive'] = 0;
}
// shopid
$sShopID = oxRegistry::getSession()->getVariable("actshop");
$aParams['oxmanufacturers__oxshopid'] = $sShopID;
$oManufacturer = oxNew("oxmanufacturer");
if ($soxId != "-1") {
$oManufacturer->loadInLang($this->_iEditLang, $soxId);
} else {
$aParams['oxmanufacturers__oxid'] = null;
}
//$aParams = $oManufacturer->ConvertNameArray2Idx( $aParams);
$oManufacturer->setLanguage(0);
$oManufacturer->assign($aParams);
$oManufacturer->setLanguage($this->_iEditLang);
$oManufacturer = oxRegistry::get("oxUtilsFile")->processFiles($oManufacturer);
$oManufacturer->save();
// set oxid if inserted
$this->setEditObjectId($oManufacturer->getId());
}
示例12: save
/**
* Saves main orders configuration parameters.
*/
public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = oxRegistry::getConfig()->getRequestParameter("editval");
$oOrder = oxNew("oxorder");
if ($soxId != "-1") {
$oOrder->load($soxId);
} else {
$aParams['oxorder__oxid'] = null;
}
$needOrderRecalculate = false;
if (is_array($aParams)) {
foreach ($aParams as $parameter => $value) {
//parameter changes for not whitelisted parameters trigger order recalculation
$orderField = $oOrder->{$parameter};
if ($value != $orderField->value && !in_array($parameter, $this->fieldsTriggerNoOrderRecalculation)) {
$needOrderRecalculate = true;
continue;
}
}
}
//change payment
$sPayId = oxRegistry::getConfig()->getRequestParameter("setPayment");
if (!empty($sPayId) && $sPayId != $oOrder->oxorder__oxpaymenttype->value) {
$aParams['oxorder__oxpaymenttype'] = $sPayId;
$needOrderRecalculate = true;
}
$oOrder->assign($aParams);
$aDynvalues = oxRegistry::getConfig()->getRequestParameter("dynvalue");
if (isset($aDynvalues)) {
$oPayment = oxNew("oxuserpayment");
$oPayment->load($oOrder->oxorder__oxpaymentid->value);
$oPayment->oxuserpayments__oxvalue->setValue(oxRegistry::getUtils()->assignValuesToText($aDynvalues));
$oPayment->save();
$needOrderRecalculate = true;
}
//change delivery set
$sDelSetId = oxRegistry::getConfig()->getRequestParameter("setDelSet");
if (!empty($sDelSetId) && $sDelSetId != $oOrder->oxorder__oxdeltype->value) {
$oOrder->oxorder__oxpaymenttype->setValue("oxempty");
$oOrder->setDelivery($sDelSetId);
$needOrderRecalculate = true;
} else {
// keeps old delivery cost
$oOrder->reloadDelivery(false);
}
if ($needOrderRecalculate) {
// keeps old discount
$oOrder->reloadDiscount(false);
$oOrder->recalculateOrder();
} else {
//nothing changed in order that requires a full recalculation
$oOrder->save();
}
// set oxid if inserted
$this->setEditObjectId($oOrder->getId());
}
示例13: save
/**
* Saves user history text changes.
*/
public function save()
{
parent::save();
$oRemark = oxNew("oxremark");
// try to load if exists
$oRemark->load(oxRegistry::getConfig()->getRequestParameter("rem_oxid"));
$oRemark->oxremark__oxtext = new oxField(oxRegistry::getConfig()->getRequestParameter("remarktext"));
$oRemark->oxremark__oxheader = new oxField(oxRegistry::getConfig()->getRequestParameter("remarkheader"));
$oRemark->oxremark__oxparentid = new oxField($this->getEditObjectId());
$oRemark->oxremark__oxtype = new oxField("r");
$oRemark->save();
}
示例14: save
/**
* Saves order history item text changes.
*/
public function save()
{
parent::save();
$oOrder = oxNew("oxorder");
if ($oOrder->load($this->getEditObjectId())) {
$oRemark = oxNew("oxremark");
$oRemark->load(oxRegistry::getConfig()->getRequestParameter("rem_oxid"));
$oRemark->oxremark__oxtext = new oxField(oxRegistry::getConfig()->getRequestParameter("remarktext"));
$oRemark->oxremark__oxheader = new oxField(oxRegistry::getConfig()->getRequestParameter("remarkheader"));
$oRemark->oxremark__oxtype = new oxField("r");
$oRemark->oxremark__oxparentid = new oxField($oOrder->oxorder__oxuserid->value);
$oRemark->save();
}
}
示例15: saveConfVars
/**
* Saves shop configuration variables
*/
public function saveConfVars()
{
$myConfig = $this->getConfig();
oxAdminDetails::save();
$sShopId = $myConfig->getShopId();
$sModule = $this->_getModuleForConfigVars();
foreach ($this->_aConfParams as $sType => $sParam) {
$aConfVars = $myConfig->getRequestParameter($sParam);
if (is_array($aConfVars)) {
foreach ($aConfVars as $sName => $sValue) {
$myConfig->saveShopConfVar($sType, $sName, $this->_serializeConfVar($sType, $sName, $sValue), $sShopId, $sModule);
}
}
}
}