11 protected $_aSkipMultiline = array(
'aHomeCountry',
'iShopID_TrustedShops',
'aTsUser',
'aTsPassword');
15 "bool" =>
'confbools',
18 "aarr" =>
'confaarrs',
19 "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";
86 $this->_aViewData[
"countrylist"] = $oCountryList;
89 $this->_aViewData[
"blCurlIsActive"] = ( !function_exists(
'curl_init') ) ?
false :
true;
117 $configValidator =
oxNew(
'oxNoJsValidator');
118 foreach ($this->_aConfParams as $sType => $sParam) {
120 if (is_array($aConfVars)) {
121 foreach ($aConfVars as $sName => $sValue) {
122 $oldValue =
$myConfig->getConfigParam($sName);
123 if ($sValue !== $oldValue) {
124 $sValueToValidate = is_array($sValue) ? join(
', ', $sValue) : $sValue;
125 if (!$configValidator->isValid($sValueToValidate)) {
126 $error =
oxNew(
'oxDisplayError');
127 $error->setFormatParameters(htmlspecialchars($sValueToValidate));
128 $error->setMessage(
"SHOP_CONFIG_ERROR_INVALID_VALUE");
156 $oShop =
oxNew(
"oxshop" );
157 if ( $oShop->load( $this->getEditObjectId() ) ) {
204 $aVarConstraints = array();
205 $aGrouping = array();
208 "select cfg.oxvarname,
210 DECODE( cfg.oxvarvalue, ".$oDb->quote(
$myConfig->getConfigParam(
'sConfigKey' ) ).
") as oxvarvalue,
211 disp.oxvarconstraint,
214 left join oxconfigdisplay as disp
215 on cfg.oxmodule=disp.oxcfgmodule and cfg.oxvarname=disp.oxcfgvarname
216 where cfg.oxshopid = '$sShopId'
217 and cfg.oxmodule=".$oDb->quote($sModule).
"
218 order by disp.oxpos, cfg.oxvarname"
221 if ($rs !=
false && $rs->recordCount() > 0) {
223 list($sName, $sType, $sValue, $sConstraint, $sGrouping) = $rs->fields;
227 if (!isset($aGrouping[$sGrouping])) {
228 $aGrouping[$sGrouping] = array($sName=>$sType);
230 $aGrouping[$sGrouping][$sName] = $sType;
238 'vars' => $aConfVars,
239 'constraints' => $aVarConstraints,
240 'grouping' => $aGrouping,
256 return array_map(
'trim', explode(
'|', $sConstraint));
274 return implode(
'|', array_map(
'trim', $sConstraint));
296 $mData = ($sValue ==
"true" || $sValue ==
"1");
303 $mData = $oStr->htmlentities( $sValue );
304 if (in_array($sName, $this->_aParseFloat)) {
305 $mData = str_replace(
',',
'.', $mData );
310 if (in_array($sName, $this->_aSkipMultiline)) {
311 $mData = unserialize( $sValue );
313 $mData = $oStr->htmlentities( $this->
_arrayToMultiline( unserialize( $sValue ) ) );
318 if (in_array($sName, $this->_aSkipMultiline)) {
319 $mData = unserialize( $sValue );
348 if (in_array($sName, $this->_aParseFloat)) {
349 $sData = str_replace(
',',
'.', $sData );
354 if ( !is_array( $mValue ) ) {
376 if ( is_array( $aInput ) ) {
377 $sVal = implode(
"\n", $aInput );
391 $aArr = explode(
"\n", $sMultiline );
392 if ( is_array( $aArr ) ) {
393 foreach ( $aArr as $sKey => $sVal ) {
394 $aArr[$sKey] = trim( $sVal );
395 if ( $aArr[$sKey] ==
"" ) {
396 unset( $aArr[$sKey] );
412 if ( is_array( $aInput ) ) {
414 foreach ( $aInput as $sKey => $sVal ) {
418 $sMultiline .= $sKey.
" => ".$sVal;
435 $aLines = explode(
"\n", $sMultiline );
436 foreach ( $aLines as $sLine ) {
437 $sLine = trim( $sLine );
438 if ( $sLine !=
"" && $oStr->preg_match(
"/(.+)=>(.+)/", $sLine, $aRegs ) ) {
439 $sKey = trim( $aRegs[1] );
440 $sVal = trim( $aRegs[2] );
441 if ( $sKey !=
"" && $sVal !=
"" ) {
442 $aArr[$sKey] = $sVal;