12 protected $_aSkipMultiline = array(
'aHomeCountry',
'iShopID_TrustedShops',
'aTsUser',
'aTsPassword');
16 "bool" =>
'confbools',
19 "aarr" =>
'confaarrs',
20 "select" =>
'confselects',
37 if ($soxId !=
"-1" && isset($soxId)) {
39 $this->_aViewData[
"edit"] = $oShop = $this->
_getEditShop($soxId);
43 $this->_aViewData[
"defcat"] = null;
44 if ($oShop->oxshops__oxdefcat->value) {
45 $oCat =
oxNew(
"oxCategory");
46 if ($oCat->load($oShop->oxshops__oxdefcat->value)) {
47 $this->_aViewData[
"defcat"] = $oCat;
53 $this->_aViewData[
"updateViews"] = 1;
58 $oShopDefaultCategoryAjax =
oxNew(
'shop_default_category_ajax');
59 $this->_aViewData[
'oxajax'] = $oShopDefaultCategoryAjax->getColumns();
61 return "popups/shop_default_category.tpl";
67 $aConfVars = $aDbVariables[
'vars'];
68 $aConfVars[
'str'][
'sVersion'] =
$myConfig->getConfigParam(
'sVersion');
70 $this->_aViewData[
"var_constraints"] = $aDbVariables[
'constraints'];
71 $this->_aViewData[
"var_grouping"] = $aDbVariables[
'grouping'];
72 foreach ($this->_aConfParams as $sType => $sParam) {
73 $this->_aViewData[$sParam] = $aConfVars[$sType];
77 $oCountryList =
oxNew(
"oxCountryList");
79 if (isset($aConfVars[
'arr'][
"aHomeCountry"]) && count($aConfVars[
'arr'][
"aHomeCountry"]) && count($oCountryList)) {
80 foreach ($oCountryList as $sCountryId => $oCountry) {
81 if (in_array($oCountry->oxcountry__oxid->value, $aConfVars[
'arr'][
"aHomeCountry"])) {
82 $oCountryList[$sCountryId]->selected =
"1";
87 $this->_aViewData[
"countrylist"] = $oCountryList;
90 $this->_aViewData[
"blCurlIsActive"] = (!function_exists(
'curl_init')) ?
false :
true;
116 foreach ($this->_aConfParams as $sType => $sParam) {
118 if (is_array($aConfVars)) {
119 foreach ($aConfVars as $sName => $sValue) {
120 $oldValue =
$myConfig->getConfigParam($sName);
121 if ($sValue !== $oldValue) {
138 public function save()
145 $oShop =
oxNew(
"oxshop");
146 if ($oShop->load($this->getEditObjectId())) {
174 $aVarConstraints = array();
175 $aGrouping = array();
178 "select cfg.oxvarname,
180 DECODE( cfg.oxvarvalue, " . $oDb->quote(
$myConfig->getConfigParam(
'sConfigKey')) .
") as oxvarvalue,
181 disp.oxvarconstraint,
184 left join oxconfigdisplay as disp
185 on cfg.oxmodule=disp.oxcfgmodule and cfg.oxvarname=disp.oxcfgvarname
186 where cfg.oxshopid = '$sShopId'
187 and cfg.oxmodule=" . $oDb->quote($sModule) .
"
188 order by disp.oxpos, cfg.oxvarname"
191 if ($rs !=
false && $rs->recordCount() > 0) {
193 list($sName, $sType, $sValue, $sConstraint, $sGrouping) = $rs->fields;
197 if (!isset($aGrouping[$sGrouping])) {
198 $aGrouping[$sGrouping] = array($sName => $sType);
200 $aGrouping[$sGrouping][$sName] = $sType;
208 'vars' => $aConfVars,
209 'constraints' => $aVarConstraints,
210 'grouping' => $aGrouping,
226 return array_map(
'trim', explode(
'|', $sConstraint));
244 return implode(
'|', array_map(
'trim', $sConstraint));
266 $mData = ($sValue ==
"true" || $sValue ==
"1");
273 $mData = $oStr->htmlentities($sValue);
274 if (in_array($sName, $this->_aParseFloat)) {
275 $mData = str_replace(
',',
'.', $mData);
280 if (in_array($sName, $this->_aSkipMultiline)) {
281 $mData = unserialize($sValue);
288 if (in_array($sName, $this->_aSkipMultiline)) {
289 $mData = unserialize($sValue);
319 if (in_array($sName, $this->_aParseFloat)) {
320 $sData = str_replace(
',',
'.', $sData);
325 if (!is_array($mValue)) {
348 if (is_array($aInput)) {
349 $sVal = implode(
"\n", $aInput);
364 $aArr = explode(
"\n", $sMultiline);
365 if (is_array($aArr)) {
366 foreach ($aArr as $sKey => $sVal) {
367 $aArr[$sKey] = trim($sVal);
368 if ($aArr[$sKey] ==
"") {
386 if (is_array($aInput)) {
388 foreach ($aInput as $sKey => $sVal) {
392 $sMultiline .= $sKey .
" => " . $sVal;
410 $aLines = explode(
"\n", $sMultiline);
411 foreach ($aLines as $sLine) {
412 $sLine = trim($sLine);
413 if ($sLine !=
"" && $oStr->preg_match(
"/(.+)=>(.+)/", $sLine, $aRegs)) {
414 $sKey = trim($aRegs[1]);
415 $sVal = trim($aRegs[2]);
416 if ($sKey !=
"" && $sVal !=
"") {
417 $aArr[$sKey] = $sVal;