コード例 #1
0
ファイル: ShopMain.php プロジェクト: Alpha-Sys/oxideshop_ce
 /**
  * Copies base shop config variables to current
  *
  * @param oxshop $shop new shop object
  */
 protected function _copyConfigVars($shop)
 {
     $config = $this->getConfig();
     $utilsObject = oxUtilsObject::getInstance();
     $db = oxDb::getDb();
     $nonCopyVars = $this->_getNonCopyConfigVars();
     $selectShopConfigurationQuery = "select oxvarname, oxvartype,\n            DECODE( oxvarvalue, " . $db->quote($config->getConfigParam('sConfigKey')) . ") as oxvarvalue, oxmodule\n            from oxconfig where oxshopid = '1'";
     $shopConfiguration = $db->select($selectShopConfigurationQuery);
     if ($shopConfiguration != false && $shopConfiguration->count() > 0) {
         while (!$shopConfiguration->EOF) {
             $configName = $shopConfiguration->fields[0];
             if (!in_array($configName, $nonCopyVars)) {
                 $newId = $utilsObject->generateUID();
                 $insertNewConfigQuery = "insert into oxconfig\n                        (oxid, oxshopid, oxvarname, oxvartype, oxvarvalue, oxmodule) values ( '{$newId}', " . $db->quote($shop->getId()) . ", " . $db->quote($shopConfiguration->fields[0]) . ", " . $db->quote($shopConfiguration->fields[1]) . ",  ENCODE( " . $db->quote($shopConfiguration->fields[2]) . ", '" . $config->getConfigParam('sConfigKey') . "')" . ", " . $db->quote($shopConfiguration->fields[3]) . " )";
                 $db->execute($insertNewConfigQuery);
             }
             $shopConfiguration->fetchRow();
         }
     }
     $inheritAll = $shop->oxshops__oxisinherited->value ? "true" : "false";
     $multiShopTables = $config->getConfigParam('aMultiShopTables');
     foreach ($multiShopTables as $multishopTable) {
         $config->saveShopConfVar("bool", 'blMallInherit_' . strtolower($multishopTable), $inheritAll, $shop->oxshops__oxid->value);
     }
 }
コード例 #2
0
ファイル: shop_main.php プロジェクト: mibexx/oxid_yttutorials
 /**
  * Copies base shop config variables to current
  *
  * @param oxshop $oShop new shop object
  */
 protected function _copyConfigVars($oShop)
 {
     $myConfig = $this->getConfig();
     $myUtilsObject = oxUtilsObject::getInstance();
     $oDB = oxDb::getDb();
     $aNonCopyVars = $this->_getNonCopyConfigVars();
     $sSelect = "select oxvarname, oxvartype, DECODE( oxvarvalue, " . $oDB->quote($myConfig->getConfigParam('sConfigKey')) . ") as oxvarvalue, oxmodule from oxconfig where oxshopid = '1'";
     $rs = $oDB->execute($sSelect);
     if ($rs != false && $rs->recordCount() > 0) {
         while (!$rs->EOF) {
             $sVarName = $rs->fields[0];
             if (!in_array($sVarName, $aNonCopyVars)) {
                 $sID = $myUtilsObject->generateUID();
                 $sInsert = "insert into oxconfig (oxid, oxshopid, oxvarname, oxvartype, oxvarvalue, oxmodule) values ( '{$sID}', " . $oDB->quote($oShop->getId()) . ", " . $oDB->quote($rs->fields[0]) . ", " . $oDB->quote($rs->fields[1]) . ",  ENCODE( " . $oDB->quote($rs->fields[2]) . ", '" . $myConfig->getConfigParam('sConfigKey') . "')" . ", " . $oDB->quote($rs->fields[3]) . " )";
                 $oDB->execute($sInsert);
             }
             $rs->moveNext();
         }
     }
     $sInheritAll = $oShop->oxshops__oxisinherited->value ? "true" : "false";
     $aMultiShopTables = $myConfig->getConfigParam('aMultiShopTables');
     foreach ($aMultiShopTables as $sMultishopTable) {
         $myConfig->saveShopConfVar("bool", 'blMallInherit_' . strtolower($sMultishopTable), $sInheritAll, $oShop->oxshops__oxid->value);
     }
 }