23 $strParentResult =
'';
25 $parentResultValues =
array();
26 $resultValues =
array();
28 if (is_string($arControl))
30 $arControl = static::GetControls($arControl);
32 $boolError = !is_array($arControl);
37 $arValues = static::Check($arOneCondition, $arOneCondition, $arControl,
false);
43 $arLogic = static::SearchLogic(
$arValues[
'logic'], $arControl[
'LOGIC']);
44 if (!isset($arLogic[
'OP'][$arControl[
'MULTIPLE']]) || empty($arLogic[
'OP'][$arControl[
'MULTIPLE']]))
50 $useParent = ($arControl[
'PARENT'] && isset($arLogic[
'PARENT']));
51 $strParent =
$arParams[
'BASKET_ROW'].
'[\'CATALOG\'][\'PARENT_'.$arControl[
'FIELD'].
'\']
';
52 $strField = $arParams['BASKET_ROW
'].'[\
'CATALOG\'][\''.$arControl[
'FIELD'].
'\']
';
53 switch ($arControl['FIELD_TYPE
'])
57 if (is_array($arValues['value
']))
59 if (!isset($arLogic['MULTI_SEP
']))
65 foreach ($arValues['value
'] as &$value)
68 $parentResultValues[] = str_replace(
69 array('#FIELD#
', '#VALUE#
'),
70 array($strParent, $value),
71 $arLogic['OP
'][$arControl['MULTIPLE
']]
73 $resultValues[] = str_replace(
74 array('#FIELD#
', '#VALUE#
'),
75 array($strField, $value),
76 $arLogic['OP
'][$arControl['MULTIPLE
']]
81 $strParentResult = '(
'.implode($arLogic['MULTI_SEP
'], $parentResultValues).')
';
82 $strResult = '(
'.implode($arLogic['MULTI_SEP
'], $resultValues).')
';
83 unset($resultValues, $parentResultValues);
89 $strParentResult = str_replace(
90 array('#FIELD#
', '#VALUE#
'),
91 array($strParent, $arValues['value
']),
92 $arLogic['OP
'][$arControl['MULTIPLE
']]
94 $strResult = str_replace(
95 array('#FIELD#
', '#VALUE#
'),
96 array($strField, $arValues['value
']),
97 $arLogic['OP
'][$arControl['MULTIPLE
']]
104 if (is_array($arValues['value
']))
111 $strParentResult = str_replace(
112 array('#FIELD#
', '#VALUE#
'),
113 array($strParent, '"'.EscapePHPString($arValues['value']).'"'),
114 $arLogic['OP
'][$arControl['MULTIPLE
']]
116 $strResult = str_replace(
117 array('#FIELD#
', '#VALUE#
'),
118 array($strField, '"'.EscapePHPString($arValues['value']).'"'),
119 $arLogic['OP
'][$arControl['MULTIPLE
']]
125 if (is_array($arValues['value
']))
132 $strParentResult = str_replace(
133 array('#FIELD#
', '#VALUE#
'),
134 array($strParent, $arValues['value
']),
135 $arLogic['OP
'][$arControl['MULTIPLE
']]
137 $strResult = str_replace(
138 array('#FIELD#
', '#VALUE#
'),
139 array($strField, $arValues['value
']),
140 $arLogic['OP
'][$arControl['MULTIPLE
']]
146 $strResult = 'isset(
'.$strField.') &&
'.$strResult;
148 $strResult = 'isset(
'.$strParent.') ? ((
'.$strResult.')
'.$arLogic['PARENT
'].$strParentResult.') : (
'.$strResult.')
';
149 $strResult = '(
'.$strResult.')
';
153 return (!$boolError ? $strResult : false);