13 $arKeys = array_keys(
$ar);
15 foreach ($arKeys as
$key)
18 if (
$key.
"!" !== $ind.
"!" &&
"".$key !==
"n".$ind)
41 fwrite(
$f, date(
"Y-m-d H:i:s").
" - ".
$code.
" - ".
$text.
"\n");
43 if (is_array($arVars))
45 foreach ($arVars as $varName => $varData)
47 fwrite(
$f, $varName.
": ");
48 fwrite(
$f, print_r($varData,
true));
66 public static function getAdminHtml($fieldId, $arField, $fieldName, $formName)
72 if(isset($arField[
'PRE_TEXT']))
73 $resultHtml = $arField[
'PRE_TEXT'].
' ';
75 if(isset($arField[
'BLOCK_HIDEABLE']))
76 $resultHtml .=
'<a href="javascript:void(0);" style="border-bottom: 1px dashed; text-decoration: none;">';
78 switch ($arField[
"TYPE"])
88 $resultHtml .=
'<input '.
92 ($arField[
"VALUE"] ==
"Y" ?
"checked=\"checked\"" :
"");
94 if(isset($arField[
'HIDE_BY_NAMES']) && is_array($arField[
'HIDE_BY_NAMES']))
95 $resultHtml .=
'onclick="hideFormElementsByNames(this, '.CUtil::PhpToJSObject($arField[
'HIDE_BY_NAMES']).
');"';
99 if(isset($arField[
'HIDE_BY_NAMES']) && is_array($arField[
'HIDE_BY_NAMES']))
105 var cbObj = document.forms["'.$formName.
'"]["'.
$name.
'"];
108 hideFormElementsByNames(cbObj, '.CUtil::PhpToJSObject($arField[
'HIDE_BY_NAMES']).
');
118 foreach ($arField[
"VALUES"] as $value =>
$title)
120 $resultHtml .=
'<input type="radio"
123 'value="'.htmlspecialcharsbx($value).
'"'.
124 ($value == $arField[
"VALUE"] ?
" checked=\"checked\"" :
"").
' />'.
133 $resultHtml .=
'<input '.
136 'value="'.htmlspecialcharsbx($arField[
"VALUE"]).
'" />';
142 $resultHtml .=
'<select name="'.$name.
'" ';
144 if(isset($arField[
'ONCHANGE']))
145 $resultHtml .=
' onchange = "'.$arField[
'ONCHANGE'].
'"';
149 foreach ($arField[
"VALUES"] as $value =>
$title)
151 $resultHtml .=
'<option '.
152 'value="'.htmlspecialcharsbx($value).
'"'.
153 ($value == $arField[
"VALUE"] ?
" selected=\"selected\"" :
"").
'>'.
158 $resultHtml .=
'</select>';
163 $resultHtml .=
'<select name="'.$name.
'" multiple="multiple">';
165 foreach ($arField[
"VALUES"] as $value =>
$title)
166 $resultHtml .=
'<option '.
167 'value="'.htmlspecialcharsbx($value).
'"'.
168 (in_array($value, $arField[
"VALUE"]) ?
" selected=\"selected\"" :
"").
'>'.
172 $resultHtml .=
'</select>';
176 case "TEXT_CENTERED":
177 case "MULTI_CONTROL_STRING":
184 $resultHtml .= $arField[
"VALUE"];
188 $resultHtml .=
'<input type="text"'.
190 'value="'.htmlspecialcharsbx($arField[
"VALUE"]).
'" '.
191 (isset($arField[
"SIZE"]) ?
'size="'.$arField[
"SIZE"].
'"' :
'').
195 if(isset($arField[
'BLOCK_HIDEABLE']))
196 $resultHtml .=
'</a>';
198 if(isset($arField[
'POST_TEXT'])):
199 $resultHtml .=
' '.$arField[
'POST_TEXT'];
209 if(is_array($arMultiControlQuery))
211 reset($arMultiControlQuery);
212 $key = key($arMultiControlQuery);
213 if(isset($arMultiControlQuery[
$key][
'ITEMS']) && isset($arMultiControlQuery[
$key][
'CONFIG']))
215 $multiHtml = implode(
' ', $arMultiControlQuery[
$key][
'ITEMS']);
227 $tdStyle = isset($arConfig[
"TOP_LINE"]) && $arConfig[
"TOP_LINE"] ==
"Y" ?
' border-top: 1px solid #DDDDDD;' :
'';
229 switch ($arConfig[
"TYPE"])
232 $wrapHtml .=
'<tr class="heading"><td colspan="2">'.$controlHtml.
'</td></tr>';
235 case "TEXT_CENTERED":
238 if(isset($arConfig[
"BLOCK_HIDEABLE"]))
239 $wrapHtml .=
' onclick="BX.Sale.PaySystem.toggleNextSiblings(this,'.intval($arConfig[
"BLOCK_LENGTH"]).
');" class="ps-admin-hide" ';
241 $wrapHtml .=
'><td style="text-align: center; font-weight: bold;'.$tdStyle.
'" colspan="2">'.$controlHtml;
243 if(isset($arConfig[
"BLOCK_DELETABLE"]))
244 $wrapHtml .=
' <a href="javascript:void(0);" onclick="BX.Sale.PaySystem.deleteObjectAndNextSiblings(this,'.intval($arConfig[
"BLOCK_LENGTH"]).
',2);" style="border-bottom: 1px dashed; text-decoration: none;">'.
GetMessage(
"SALE_HELPER_DELETE").
'</a>';
246 $wrapHtml .=
'</td></tr>';
251 '<td style="'.$tdStyle.
'" class="field-name"'.(($arConfig[
"TYPE"] ==
"MULTISELECT") ?
' valign="top"' :
'').
' width="40%" align="right">'.
htmlspecialcharsbx($arConfig[
"TITLE"]).
':</td>'.
252 '<td style="'.$tdStyle.
'" valign="top" width="60%">'.
265 if(trim($optName) !==
'')
267 $optValue = COption::GetOptionString(
'sale', $optName,
'',
$siteId);
268 $arOptValue = unserialize($optValue, [
'allowed_classes' =>
false]);
270 if(empty($arOptValue))
272 if($importFuncName !==
false && is_callable($importFuncName))
274 $arResult = call_user_func_array($importFuncName, $arFuncParams);
275 COption::SetOptionString(
'sale', $optName, serialize(
$arResult),
false,
$siteId);
287 private static function getShopLocationParams(
$siteId =
false):
array
289 $loc_diff = COption::GetOptionString(
'sale',
'ADDRESS_different_set',
'N');
291 if ($loc_diff ==
"Y" && (
$siteId !==
false || defined(
'SITE_ID')))
296 $locId = COption::GetOptionString(
'sale',
'location',
'',
$siteId);
297 $locZip = COption::GetOptionString(
'sale',
'location_zip',
'',
$siteId);
306 static $defSite =
null;
307 if (!isset($defSite))
318 if((
string)$locId !==
'')
336 static $shopLocationId =
array();
338 if(!isset($shopLocationId[
$siteId]))
340 $locParams = self::getShopLocationParams(
$siteId);
342 if(isset($locParams[
'ID']) && $locParams[
'ID'] <>
'')
343 $shopLocationId[
$siteId] = $locParams[
'ID'];
346 return $shopLocationId[
$siteId] ??
'';
351 static $shopLocationZip =
'';
353 if($shopLocationZip ==
'')
355 $locParams = self::getShopLocationParams();
357 if(isset($locParams[
'ZIP']) && $locParams[
'ZIP'] <>
'')
358 $shopLocationZip = strval($locParams[
'ZIP']);
361 return $shopLocationZip;
366 static $shopLocation =
array();
368 if(empty($shopLocation))
372 if(intval($shopLocationId) > 0)
376 return $shopLocation;
382 $csvFile->LoadFile($filePath);
383 $csvFile->SetFieldsType(
"R");
384 $csvFile->SetFirstHeader(
false);
385 $csvFile->SetDelimiter(
",");
398 public static function getFileInfo($fileId, $arSize =
array(
"WIDTH" => 90,
"HEIGHT" => 90))
401 $arFile = CFile::GetFileArray($fileId);
404 $is_image = CFile::IsImage($arFile[
"FILE_NAME"], $arFile[
"CONTENT_TYPE"]);
406 $resultHTML = CFile::ShowImage($arFile[
"ID"], $arSize[
"WIDTH"], $arSize[
"HEIGHT"],
"border=0", $arFile[
"SRC"],
true);
408 $resultHTML =
'<a href="'.$arFile[
"SRC"].
'">'.$arFile[
"ORIGINAL_NAME"].
'</a>';
417 if ($propData[
"MULTIPLE"] ==
"Y")
420 if (!is_array($value))
422 if (mb_strpos($value,
",") !==
false)
423 $arVal = explode(
",", $value);
434 if ($propData[
"PROPERTY_TYPE"] ==
"F")
437 $res .=
"<br/> ".CSaleHelper::getFileInfo(trim(
$val), $arSize);
453 if ($propData[
"PROPERTY_TYPE"] ==
"F")
static GetOptionString($module_id, $name, $def="", $site=false, $bExactSite=false)
static GetByIDForLegacyDelivery($primary, $strLang=LANGUAGE_ID)
static GetDefSite($LID=false)
static getConfValue($arField)
static getCsvObject($filePath)
static wrapAdminHtml($controlHtml, &$arConfig)
static getShopLocation($siteId=false)
static getIblockPropInfo($value, $propData, $arSize=array("WIDTH"=> 90, "HEIGHT"=> 90))
static getAdminMultilineControl($arMultiControlQuery)
static getLocationByIdHitCached($id)
static getShopLocationId($siteId)
static getFileInfo($fileId, $arSize=array("WIDTH"=> 90, "HEIGHT"=> 90))
static getOptionOrImportValues($optName, $importFuncName=false, $arFuncParams=array(), $siteId="")
static getShopLocationZIP()
static WriteToLog($text, $arVars=array(), $code="")
static IsAssociativeArray($ar)
static getAdminHtml($fieldId, $arField, $fieldName, $formName)
static GetByID($primary, $strLang=LANGUAGE_ID)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"