3namespace Bitrix\Bizproc\Calc\Libs;
6use Bitrix\Bizproc\Calc\Arguments;
7use Bitrix\Main\Localization\Loc;
16 'func' =>
'callNumberFormat',
17 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_NUMBER_FORMAT_DESCRIPTION'),
21 'func' =>
'callSubstr',
22 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_SUBSTR_DESCRIPTION'),
26 'func' =>
'callStrpos',
27 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_STRPOS_DESCRIPTION'),
31 'func' =>
'callStrlen',
32 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_STRLEN_DESCRIPTION'),
36 'func' =>
'callRandString',
37 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_RANDSTRING_DESCRIPTION'),
41 'func' =>
'callStrtolower',
42 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_STRTOLOWER_DESCRIPTION'),
46 'func' =>
'callStrtoupper',
47 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_STRTOUPPER_DESCRIPTION'),
51 'func' =>
'callUcwords',
52 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_UCWORDS_DESCRIPTION'),
56 'func' =>
'callUcfirst',
57 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_UCFIRST_DESCRIPTION'),
62 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_TRIM_DESCRIPTION'),
66 'func' =>
'callUrlencode',
67 'description' => Loc::getMessage(
'BIZPROC_CALC_FUNCTION_URLENCODE_DESCRIPTION'),
75 $decimals = (int)($args->
getSecond() ?: 0);
78 if (!is_scalar($decPoint))
82 $decPoint = (string)$decPoint;
84 $thousandsSeparator = $args->
getArg(3);
85 if (!is_scalar($thousandsSeparator))
87 $thousandsSeparator =
',';
89 $thousandsSeparator = (string)$thousandsSeparator;
91 return number_format($number, $decimals, $decPoint, $thousandsSeparator);
119 return mb_substr(
$str, $pos, $len);
122 return mb_substr(
$str, $pos);
130 if (empty($haystack) || is_array($haystack) || is_array($needle))
134 $haystack = (string)$haystack;
135 $needle = (string)$needle;
137 $maxOffset = mb_strlen($haystack);
138 $minOffset = -1 * $maxOffset;
140 $offset = max($minOffset, min($maxOffset, (
int)$args->
getThird()));
142 return mb_strpos($haystack, $needle, $offset);
149 if (!is_scalar(
$str))
156 return mb_strlen(
$str);
163 if (!is_scalar(
$str))
177 return urlencode(
$str);
184 if (!is_scalar(
$str))
189 return mb_strtolower((
string)
$str);
196 if (!is_scalar(
$str))
201 return mb_strtoupper((
string)
$str);
208 if (!is_scalar(
$str))
213 return mb_convert_case((
string)
$str, MB_CASE_TITLE);
220 if (!is_scalar(
$str))
225 return $this->mbUcFirst((
string)
$str);
228 private function mbUcFirst(
$str)
230 $len = mb_strlen(
$str);
231 $firstChar = mb_substr(
$str, 0, 1);
232 $otherChars = mb_substr(
$str, 1, $len - 1);
234 return mb_strtoupper($firstChar) . $otherChars;
242 foreach ($array as
$str)
244 if (is_scalar(
$str) || (is_object(
$str) && method_exists(
$str,
'__toString')))
callStrlen(Arguments $args)
callStrpos(Arguments $args)
callUrlencode(Arguments $args)
callSubstr(Arguments $args)
callUcwords(Arguments $args)
callNumberFormat(Arguments $args)
callStrtolower(Arguments $args)
callTrim(Arguments $args)
callRandString(Arguments $args)
callStrtoupper(Arguments $args)
callUcfirst(Arguments $args)
static getString($length, $caseSensitive=false)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
</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."%"