23 if (file_exists($fname))
31 if (file_exists($fname))
39 unset($arData[
"NEW_COMPONENT_TEMPLATE"]);
41 if (isset($arData[
"SEF_MODE"]) && $arData[
"SEF_MODE"] ==
"Y")
43 unset($arData[
"VARIABLE_ALIASES"]);
44 unset($arData[
"SEF_URL_TEMPLATES"]);
46 foreach ($arData as $dataKey => $dataValue)
48 if (str_starts_with($dataKey,
"SEF_URL_TEMPLATES_"))
50 $len = strlen(
"SEF_URL_TEMPLATES_");
51 $arData[
"SEF_URL_TEMPLATES"][substr($dataKey, $len)] = $dataValue;
52 unset($arData[$dataKey]);
54 if (preg_match_all(
"'(\\?|&)(.+?)=#([^#]+?)#'is", $dataValue, $arMatches, PREG_SET_ORDER))
56 foreach ($arMatches as $arMatch)
57 $arData[
"VARIABLE_ALIASES"][substr($dataKey, $len)][$arMatch[3]] = $arMatch[2];
60 elseif (str_starts_with($dataKey,
"VARIABLE_ALIASES_"))
62 unset($arData[$dataKey]);
68 unset($arData[
"VARIABLE_ALIASES"]);
69 unset($arData[
"SEF_URL_TEMPLATES"]);
71 foreach ($arData as $dataKey => $dataValue)
73 if (str_starts_with($dataKey,
"SEF_URL_TEMPLATES_"))
75 unset($arData[$dataKey]);
77 elseif (str_starts_with($dataKey,
"VARIABLE_ALIASES_"))
79 $arData[
"VARIABLE_ALIASES"][substr($dataKey, strlen(
"VARIABLE_ALIASES_"))] = $dataValue;
80 unset($arData[$dataKey]);
89 echo
"<font color=\"#FF0000\">".$errorMessage.
"</font>";
94 $arBXTopComponentCatalogLevel =
array(
"content",
"service",
"communication",
"e-store",
"utility");
95 $arBXTopComponentCatalogLevelSort =
array(600, 700, 800, 900, 1000);
97 if (!isset($arTree[
"#"]) || !is_array($arTree[
"#"]))
98 $arTree[
"#"] =
array();
100 if (!array_key_exists(
$arPath[
"ID"], $arTree[
"#"]))
104 $arTree[
"#"][
$arPath[
"ID"]][
"@"][
"NAME"] =
"";
105 $arTree[
"#"][
$arPath[
"ID"]][
"@"][
"SORT"] = intval(
$arPath[
"SORT"] ?? 0);
106 if ($level == 1 && in_array(
$arPath[
"ID"], $arBXTopComponentCatalogLevel))
109 $arTree[
"#"][
$arPath[
"ID"]][
"@"][
"SORT"] = intval($arBXTopComponentCatalogLevelSort[array_search(
$arPath[
"ID"], $arBXTopComponentCatalogLevel)]);
111 if ($arTree[
"#"][
$arPath[
"ID"]][
"@"][
"NAME"] ==
'')
113 if ($arTree[
"#"][
$arPath[
"ID"]][
"@"][
"SORT"] <= 0)
114 $arTree[
"#"][
$arPath[
"ID"]][
"@"][
"SORT"] = 100;
117 if (array_key_exists(
"CHILD",
$arPath))
123 if (!isset($arTree[
"#"][
$arPath[
"ID"]][
"*"]) || !is_array($arTree[
"#"][
$arPath[
"ID"]][
"*"]))
134 if(!$bDirectoryExists)
139 if($bComponentExists)
156 "/bitrix/components",
159 foreach($folders as $componentFolder)
161 if(file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$componentFolder))
165 while (($file = readdir(
$handle)) !==
false)
167 if ($file ==
"." || $file ==
"..")
170 if (is_dir(
$_SERVER[
"DOCUMENT_ROOT"].$componentFolder.
"/".$file))
175 if ($filterNamespace !==
false && $filterNamespace <>
'')
180 if (file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$componentFolder.
"/".$file.
"/.description.php"))
185 include(
$_SERVER[
"DOCUMENT_ROOT"].$componentFolder.
"/".$file.
"/.description.php");
205 $arComponent[
"ICON"] =
"/bitrix/images/fileman/htmledit2/component.gif";
222 $arComponent[
"SCREENSHOT"][] = $componentFolder.
"/".$file.$arComponentDescription[
"SCREENSHOT"][
$i];
232 if ($filterNamespace !==
false && ($filterNamespace ==
'' || $filterNamespace != $file))
235 if ($handle1 = opendir(
$_SERVER[
"DOCUMENT_ROOT"].$componentFolder.
"/".$file))
237 while (($file1 = readdir($handle1)) !==
false)
239 if ($file1 ==
"." || $file1 ==
"..")
242 if (is_dir(
$_SERVER[
"DOCUMENT_ROOT"].$componentFolder.
"/".$file.
"/".$file1))
249 if (file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$componentFolder.
"/".$file.
"/".$file1.
"/.description.php"))
254 include(
$_SERVER[
"DOCUMENT_ROOT"].$componentFolder.
"/".$file.
"/".$file1.
"/.description.php");
273 $arComponent[
"ICON"] =
"/bitrix/images/fileman/htmledit2/component.gif";
290 $arComponent[
"SCREENSHOT"][] = $componentFolder.
"/".$file.
"/".$file1.$arComponentDescription[
"SCREENSHOT"][
$i];
314 if (
$a[
"@"][
"SORT"] < $b[
"@"][
"SORT"] ||
$a[
"@"][
"SORT"] == $b[
"@"][
"SORT"] && mb_strtolower(
$a[
"@"][
"NAME"]) < mb_strtolower($b[
"@"][
"NAME"]))
316 elseif (
$a[
"@"][
"SORT"] > $b[
"@"][
"SORT"] ||
$a[
"@"][
"SORT"] == $b[
"@"][
"SORT"] && mb_strtolower(
$a[
"@"][
"NAME"]) > mb_strtolower($b[
"@"][
"NAME"]))
324 if (
$a[
"COMPLEX"] ==
"Y" && $b[
"COMPLEX"] ==
"Y" ||
$a[
"COMPLEX"] !=
"Y" && $b[
"COMPLEX"] !=
"Y")
326 if (
$a[
"SORT"] < $b[
"SORT"] ||
$a[
"SORT"] == $b[
"SORT"] && mb_strtolower(
$a[
"TITLE"]) < mb_strtolower($b[
"TITLE"]))
328 elseif (
$a[
"SORT"] > $b[
"SORT"] ||
$a[
"SORT"] == $b[
"SORT"] && mb_strtolower(
$a[
"TITLE"]) > mb_strtolower($b[
"TITLE"]))
335 if (
$a[
"COMPLEX"] ==
"Y")
337 if ($b[
"COMPLEX"] ==
"Y")
345 uasort($arTree,
array(
"CComponentUtil",
"__TreeFolderCompare"));
346 foreach ($arTree as
$key => $value)
348 if (array_key_exists(
"#", $arTree[
$key]))
350 if (array_key_exists(
"*", $arTree[
$key]))
351 uasort($arTree[
$key][
"*"],
array(
"CComponentUtil",
"__TreeItemCompare"));
359 if (isset($arTree[
"#"]))
369 $arNamespaces =
array();
372 "/bitrix/components",
375 foreach($folders as $componentFolder)
377 if(file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$componentFolder))
381 while (($file = readdir(
$handle)) !==
false)
383 if ($file ==
"." || $file ==
"..")
387 is_dir(
$_SERVER[
"DOCUMENT_ROOT"].$componentFolder.
"/".$file)
391 $arNamespaces[] = $file;
399 return array_unique($arNamespaces);
406 static $cache =
array();
447 if (
$a[
"SORT"] < $b[
"SORT"])
463 $arComponentParameters =
array();
469 if ($path2Comp ==
'')
485 if ($templateProperties && is_array($templateProperties))
487 if(isset($arComponentParameters[
"PARAMETERS"]) && is_array($arComponentParameters[
"PARAMETERS"]))
488 $arComponentParameters[
"PARAMETERS"] = array_merge ($arComponentParameters[
"PARAMETERS"], $templateProperties);
490 $arComponentParameters[
"PARAMETERS"] = $templateProperties;
493 if (!array_key_exists(
"PARAMETERS", $arComponentParameters) || !is_array($arComponentParameters[
"PARAMETERS"]))
495 $arComponentParameters[
"PARAMETERS"] =
array();
498 if (!array_key_exists(
"GROUPS", $arComponentParameters) || !is_array($arComponentParameters[
"GROUPS"]))
499 $arComponentParameters[
"GROUPS"] =
array();
501 $arParamKeys = array_keys($arComponentParameters[
"GROUPS"]);
502 for (
$i = 0, $cnt =
count($arParamKeys);
$i < $cnt;
$i++)
504 if (!IsSet($arComponentParameters[
"GROUPS"][$arParamKeys[
$i]][
"SORT"]))
505 $arComponentParameters[
"GROUPS"][$arParamKeys[
$i]][
"SORT"] = 1000+
$i;
506 $arComponentParameters[
"GROUPS"][$arParamKeys[
$i]][
"SORT"] = intval($arComponentParameters[
"GROUPS"][$arParamKeys[
$i]][
"SORT"]);
507 if ($arComponentParameters[
"GROUPS"][$arParamKeys[
$i]][
"SORT"] <= 0)
508 $arComponentParameters[
"GROUPS"][$arParamKeys[
$i]][
"SORT"] = 1000+
$i;
511 $arVariableAliasesSettings =
null;
512 $arParamKeys = array_keys($arComponentParameters[
"PARAMETERS"]);
513 for (
$i = 0, $cnt =
count($arParamKeys);
$i < $cnt;
$i++)
515 if ($arParamKeys[
$i] ==
"SET_TITLE")
517 $arComponentParameters[
"GROUPS"][
"ADDITIONAL_SETTINGS"] =
array(
518 "NAME" =>
GetMessage(
"COMP_GROUP_ADDITIONAL_SETTINGS"),
522 $arComponentParameters[
"PARAMETERS"][
"SET_TITLE"] =
array(
523 "PARENT" =>
"ADDITIONAL_SETTINGS",
525 "TYPE" =>
"CHECKBOX",
527 "ADDITIONAL_VALUES" =>
"N",
531 elseif ($arParamKeys[
$i] ==
"CACHE_TIME")
533 $arComponentParameters[
"GROUPS"][
"CACHE_SETTINGS"] =
array(
534 "NAME" =>
GetMessage(
"COMP_GROUP_CACHE_SETTINGS"),
538 $arSavedParams = $arComponentParameters[
"PARAMETERS"];
539 $arComponentParameters[
"PARAMETERS"] =
array();
540 foreach ($arSavedParams as $keyTmp => $valueTmp)
542 if ($keyTmp ==
"CACHE_TIME")
544 $arComponentParameters[
"PARAMETERS"][
"CACHE_TYPE"] =
array(
545 "PARENT" =>
"CACHE_SETTINGS",
550 "ADDITIONAL_VALUES" =>
"N"
552 $arComponentParameters[
"PARAMETERS"][
"CACHE_TIME"] =
array(
553 "PARENT" =>
"CACHE_SETTINGS",
557 "DEFAULT" => intval($arSavedParams[
"CACHE_TIME"][
"DEFAULT"]),
560 $arComponentParameters[
"PARAMETERS"][
"CACHE_NOTES"] =
array(
561 "PARENT" =>
"CACHE_SETTINGS",
563 "JS_FILE" =>
"/bitrix/js/main/comp_props.js",
564 "JS_EVENT" =>
"BxShowComponentNotes",
566 "#LANG#" => LANGUAGE_ID,
567 "#AUTO_MODE#" => (COption::GetOptionString(
"main",
"component_cache_on",
"Y") ==
"Y"?
GetMessage(
"COMP_PARAM_CACHE_AUTO_ON"):
GetMessage(
"COMP_PARAM_CACHE_AUTO_OFF")),
568 "#MANAGED_MODE#" =>(defined(
"BX_COMP_MANAGED_CACHE")?
GetMessage(
"COMP_PARAM_CACHE_MANAGED_ON"):
GetMessage(
"COMP_PARAM_CACHE_MANAGED_OFF")),
574 $arComponentParameters[
"PARAMETERS"][$keyTmp] = $valueTmp;
578 elseif ($arParamKeys[
$i] ==
"SEF_MODE" && isset($arComponentParameters[
"PARAMETERS"][
"SEF_RULE"]))
580 $arComponentParameters[
"GROUPS"][
"SEF_MODE"] =
array(
584 $arComponentParameters[
"PARAMETERS"][
"SEF_MODE"] =
array(
585 "PARENT" =>
"SEF_MODE",
587 "TYPE" =>
"CHECKBOX",
590 $arComponentParameters[
"PARAMETERS"][
"SEF_RULE"][
"PARENT"] =
"SEF_MODE";
592 elseif ($arParamKeys[
$i] ==
"SEF_RULE")
594 $arComponentParameters[
"PARAMETERS"][
"SEF_RULE"][
"TYPE"] =
"TEMPLATES";
595 $arComponentParameters[
"PARAMETERS"][
"SEF_RULE"][
"NAME"] =
GetMessage(
"COMP_PARAM_SEF_RULE");
596 if (isset($arCurrentValues[
"SEF_MODE"]) && $arCurrentValues[
"SEF_MODE"] ===
"Y")
598 if (is_array($arComponentParameters[
"PARAMETERS"][
"SEF_RULE"][
"VALUES"]))
600 foreach ($arComponentParameters[
"PARAMETERS"][
"SEF_RULE"][
"VALUES"] as $sefRuleValue)
603 is_array($sefRuleValue)
604 && isset($sefRuleValue[
"PARAMETER_LINK"])
605 && isset($arComponentParameters[
"PARAMETERS"][$sefRuleValue[
"PARAMETER_LINK"]])
608 $arComponentParameters[
"PARAMETERS"][$sefRuleValue[
"PARAMETER_LINK"]][
"PARENT"] =
"SEF_MODE";
614 elseif ($arParamKeys[
$i] ==
"SEF_MODE")
616 $arComponentParameters[
"GROUPS"][
"SEF_MODE"] =
array(
621 $arSEFModeSettings = $arComponentParameters[
"PARAMETERS"][
"SEF_MODE"];
623 $arComponentParameters[
"PARAMETERS"][
"SEF_MODE"] =
array(
624 "PARENT" =>
"SEF_MODE",
626 "TYPE" =>
"CHECKBOX",
629 $arComponentParameters[
"PARAMETERS"][
"SEF_FOLDER"] =
array(
630 "PARENT" =>
"SEF_MODE",
638 if (is_array($arSEFModeSettings) && !empty($arSEFModeSettings))
640 if (!isset($arVariableAliasesSettings))
641 $arVariableAliasesSettings = $arComponentParameters[
"PARAMETERS"][
"VARIABLE_ALIASES"];
643 foreach ($arSEFModeSettings as $templateKey => $arTemplateValue)
645 $arComponentParameters[
"PARAMETERS"][
"SEF_URL_TEMPLATES_".$templateKey] =
array(
646 "PARENT" =>
"SEF_MODE",
647 "NAME" => $arTemplateValue[
"NAME"],
650 "DEFAULT" => $arTemplateValue[
"DEFAULT"],
651 "HIDDEN" => $arTemplateValue[
"HIDDEN"] ??
'',
653 "VARIABLES" =>
array(),
656 if (is_array($arVariableAliasesSettings) && !empty($arVariableAliasesSettings))
658 foreach ($arTemplateValue[
"VARIABLES"] as $variable)
660 if (!empty($arVariableAliasesSettings[$variable][
"TEMPLATE"]))
662 $arComponentParameters[
"PARAMETERS"][
"SEF_URL_TEMPLATES_".$templateKey][
"TYPE"] =
"TEMPLATES";
663 $arComponentParameters[
"PARAMETERS"][
"SEF_URL_TEMPLATES_".$templateKey][
"VALUES"][$variable] =
array(
664 "TEXT" => $arVariableAliasesSettings[$variable][
"NAME"],
665 "TEMPLATE" => $arVariableAliasesSettings[$variable][
"TEMPLATE"],
668 $arComponentParameters[
"PARAMETERS"][
"SEF_URL_TEMPLATES_".$templateKey][
"VARIABLES"][
"#".$variable.
"#"] = $arVariableAliasesSettings[$variable][
"NAME"] ??
'';
674 elseif ($arParamKeys[
$i] ==
"VARIABLE_ALIASES")
676 $arComponentParameters[
"GROUPS"][
"SEF_MODE"] =
array(
681 $arVariableAliasesSettings = $arComponentParameters[
"PARAMETERS"][
"VARIABLE_ALIASES"];
683 unset($arComponentParameters[
"PARAMETERS"][
"VARIABLE_ALIASES"]);
685 foreach ($arVariableAliasesSettings as $aliaseKey => $arAliaseValue)
687 $arComponentParameters[
"PARAMETERS"][
"VARIABLE_ALIASES_".$aliaseKey] =
array(
688 "PARENT" =>
"SEF_MODE",
689 "NAME" => $arAliaseValue[
"NAME"],
692 "DEFAULT" => $aliaseKey,
697 elseif (IsSet($arComponentParameters[
"PARAMETERS"][$arParamKeys[
$i]][
"PARENT"]) && $arComponentParameters[
"PARAMETERS"][$arParamKeys[
$i]][
"PARENT"] <>
'')
699 if ($arComponentParameters[
"PARAMETERS"][$arParamKeys[
$i]][
"PARENT"] ==
"URL_TEMPLATES")
701 $arComponentParameters[
"GROUPS"][
"URL_TEMPLATES"] =
array(
702 "NAME" =>
GetMessage(
"COMP_GROUP_URL_TEMPLATES"),
706 elseif ($arComponentParameters[
"PARAMETERS"][$arParamKeys[
$i]][
"PARENT"] ==
"VISUAL")
708 $arComponentParameters[
"GROUPS"][
"VISUAL"] =
array(
713 elseif ($arComponentParameters[
"PARAMETERS"][$arParamKeys[
$i]][
"PARENT"] ==
"DATA_SOURCE")
715 $arComponentParameters[
"GROUPS"][
"DATA_SOURCE"] =
array(
716 "NAME" =>
GetMessage(
"COMP_GROUP_DATA_SOURCE"),
720 elseif ($arComponentParameters[
"PARAMETERS"][$arParamKeys[
$i]][
"PARENT"] ==
"BASE")
722 $arComponentParameters[
"GROUPS"][
"BASE"] =
array(
727 elseif ($arComponentParameters[
"PARAMETERS"][$arParamKeys[
$i]][
"PARENT"] ==
"ADDITIONAL_SETTINGS")
729 $arComponentParameters[
"GROUPS"][
"ADDITIONAL_SETTINGS"] =
array(
730 "NAME" =>
GetMessage(
"COMP_GROUP_ADDITIONAL_SETTINGS"),
735 elseif ($arParamKeys[
$i] ==
"AJAX_MODE")
737 $arComponentParameters[
"GROUPS"][
"AJAX_SETTINGS"] =
array(
738 "NAME" =>
GetMessage(
"COMP_GROUP_AJAX_SETTINGS"),
742 $arComponentParameters[
"PARAMETERS"][
"AJAX_MODE"] =
array(
743 "PARENT" =>
"AJAX_SETTINGS",
745 "TYPE" =>
"CHECKBOX",
747 "ADDITIONAL_VALUES" =>
"N"
759 $arComponentParameters[
"PARAMETERS"][
"AJAX_OPTION_JUMP"] =
array(
760 "PARENT" =>
"AJAX_SETTINGS",
761 "NAME" =>
GetMessage(
"COMP_PROP_AJAX_OPTIONS_JUMP"),
762 "TYPE" =>
"CHECKBOX",
765 "ADDITIONAL_VALUES" =>
"N"
768 $arComponentParameters[
"PARAMETERS"][
"AJAX_OPTION_STYLE"] =
array(
769 "PARENT" =>
"AJAX_SETTINGS",
770 "NAME" =>
GetMessage(
"COMP_PROP_AJAX_OPTIONS_STYLE"),
771 "TYPE" =>
"CHECKBOX",
774 "ADDITIONAL_VALUES" =>
"N"
777 $arComponentParameters[
"PARAMETERS"][
"AJAX_OPTION_HISTORY"] =
array(
778 "PARENT" =>
"AJAX_SETTINGS",
779 "NAME" =>
GetMessage(
"COMP_PROP_AJAX_OPTIONS_HISTORY"),
780 "TYPE" =>
"CHECKBOX",
783 "ADDITIONAL_VALUES" =>
"N"
786 $arComponentParameters[
"PARAMETERS"][
"AJAX_OPTION_ADDITIONAL"] =
array(
787 "PARENT" =>
"AJAX_SETTINGS",
788 "NAME" =>
GetMessage(
"COMP_PROP_AJAX_OPTIONS_ADDITIONAL"),
793 "ADDITIONAL_VALUES" =>
"N"
796 elseif ($arParamKeys[
$i] ==
"USER_CONSENT")
798 $arComponentParameters[
"GROUPS"][
"USER_CONSENT"] =
array(
799 "NAME" =>
GetMessage(
"COMP_GROUP_USER_CONSENT"),
803 $arComponentParameters[
"PARAMETERS"][
"USER_CONSENT"] =
array(
804 "PARENT" =>
"USER_CONSENT",
805 "NAME" =>
GetMessage(
"COMP_PROP_USER_CONSENT_USE"),
806 "TYPE" =>
"CHECKBOX",
808 "ADDITIONAL_VALUES" =>
"N"
811 $arComponentParameters[
"PARAMETERS"][
"USER_CONSENT_ID"] =
array(
812 "PARENT" =>
"USER_CONSENT",
813 "NAME" =>
GetMessage(
"COMP_PROP_USER_CONSENT_ID"),
815 "VALUES" =>
array(
GetMessage(
"COMP_PROP_USER_CONSENT_ID_DEF")) + \
Bitrix\Main\UserConsent\Agreement::getActiveList(),
820 $arComponentParameters[
"PARAMETERS"][
"USER_CONSENT_IS_CHECKED"] =
array(
821 "PARENT" =>
"USER_CONSENT",
822 "NAME" =>
GetMessage(
"COMP_PROP_USER_CONSENT_IS_CHECKED"),
823 "TYPE" =>
"CHECKBOX",
825 "ADDITIONAL_VALUES" =>
"N"
828 $arComponentParameters[
"PARAMETERS"][
"USER_CONSENT_IS_LOADED"] =
array(
829 "PARENT" =>
"USER_CONSENT",
830 "NAME" =>
GetMessage(
"COMP_PROP_USER_CONSENT_IS_LOADED"),
831 "TYPE" =>
"CHECKBOX",
833 "ADDITIONAL_VALUES" =>
"N"
838 $parent = $arComponentParameters[
"PARAMETERS"][$arParamKeys[
$i]][
"PARENT"] ??
null;
839 if (!isset($parent) || !isset($arComponentParameters[
"GROUPS"][$parent]))
841 $arComponentParameters[
"PARAMETERS"][$arParamKeys[
$i]][
"PARENT"] =
"ADDITIONAL_SETTINGS";
842 if (!isset($arComponentParameters[
"GROUPS"][
"ADDITIONAL_SETTINGS"]))
844 $arComponentParameters[
"GROUPS"][
"ADDITIONAL_SETTINGS"] =
array(
845 "NAME" =>
GetMessage(
"COMP_GROUP_ADDITIONAL_SETTINGS"),
853 if (\
Bitrix\Main\Composite\Helper::isOn())
855 $arComponentParameters[
"GROUPS"][
"COMPOSITE_SETTINGS"] =
array(
856 "NAME" =>
GetMessage(
"COMP_GROUP_COMPOSITE_SETTINGS"),
860 $arComponentParameters[
"PARAMETERS"][
"COMPOSITE_FRAME_MODE"] =
array(
861 "PARENT" =>
"COMPOSITE_SETTINGS",
862 "NAME" =>
GetMessage(
"COMP_PROP_COMPOSITE_FRAME_MODE"),
865 "A" =>
GetMessage(
"COMP_PROP_COMPOSITE_FRAME_MODE_AUTO"),
866 "Y" =>
GetMessage(
"COMP_PROP_COMPOSITE_FRAME_MODE_PRO"),
867 "N" =>
GetMessage(
"COMP_PROP_COMPOSITE_FRAME_MODE_CONTRA")
871 "ADDITIONAL_VALUES" =>
"N"
875 !isset($arCurrentValues[
"COMPOSITE_FRAME_MODE"]) ||
876 in_array($arCurrentValues[
"COMPOSITE_FRAME_MODE"],
array(
"A",
"Y")))
878 $arComponentParameters[
"PARAMETERS"][
"COMPOSITE_FRAME_TYPE"] =
array(
879 "PARENT" =>
"COMPOSITE_SETTINGS",
880 "NAME" =>
GetMessage(
"COMP_PROP_COMPOSITE_FRAME_TYPE"),
883 "AUTO" =>
GetMessage(
"COMP_PROP_COMPOSITE_FRAME_TYPE_AUTO"),
884 "STATIC" =>
GetMessage(
"COMP_PROP_COMPOSITE_FRAME_TYPE_STATIC"),
885 "DYNAMIC_WITH_STUB" =>
GetMessage(
"COMP_PROP_COMPOSITE_FRAME_TYPE_DYNAMIC_WITH_STUB"),
886 "DYNAMIC_WITHOUT_STUB" =>
GetMessage(
"COMP_PROP_COMPOSITE_FRAME_TYPE_DYNAMIC_WITHOUT_STUB"),
887 "DYNAMIC_WITH_STUB_LOADING" =>
GetMessage(
"COMP_PROP_COMPOSITE_FRAME_TYPE_DYNAMIC_WITH_STUB_LOADING")
890 "ADDITIONAL_VALUES" =>
"N"
902 $help_lang_path =
$_SERVER[
"DOCUMENT_ROOT"].$componentPath.
"/lang";
903 if(!file_exists($help_lang_path))
904 mkdir($help_lang_path);
905 $help_lang_path .=
"/ru";
906 if(!file_exists($help_lang_path))
907 mkdir($help_lang_path);
908 $help_lang_path .=
"/help";
909 if(!file_exists($help_lang_path))
910 mkdir($help_lang_path);
911 if(is_dir($help_lang_path))
914 $lang_filename = $help_lang_path.
"/.tooltips.php";
915 if(!file_exists($lang_filename))
917 $handle=fopen($lang_filename,
"w");
921 $handle=fopen($lang_filename,
"r");
922 $lang_contents = fread(
$handle, filesize($lang_filename));
924 $lang_file_modified =
false;
926 if(str_contains($lang_contents,
"\$MESS['"))
928 $lang_contents = str_replace(
"\$MESS['",
"\$MESS ['", $lang_contents);
929 $lang_file_modified =
true;
932 foreach($arComponentParameters[
"PARAMETERS"] as $strName=>$arParameter)
934 if(!str_contains($lang_contents,
"\$MESS ['${strName}_TIP'] = "))
936 $lang_contents = str_replace(
"?>",
"\$MESS ['${strName}_TIP'] = \"".str_replace(
"\$",
"\\\$", str_replace(
'"',
'\\"',$arParameter[
"NAME"])).
"\";\n?>", $lang_contents);
937 $lang_file_modified =
true;
941 if($lang_file_modified)
943 $handle=fopen($lang_filename,
"w");
944 fwrite(
$handle, $lang_contents);
948 reset($arComponentParameters[
"PARAMETERS"]);
950 uasort($arComponentParameters[
"GROUPS"],
array(
"CComponentUtil",
"__GroupParamsCompare"));
953 return $arComponentParameters;
965 $arTemplateParameters =
array();
969 return $arTemplateParameters;
971 if ($templateName ==
'')
972 $templateName =
".default";
974 if(preg_match(
"#[^a-z0-9_.-]#i", $templateName))
975 return $arTemplateParameters;
978 if ($path2Comp ==
'')
979 return $arTemplateParameters;
985 return $arTemplateParameters;
988 if ($siteTemplate <>
"")
994 if ($siteTemplate <>
"")
996 $folders[] =
"/local/templates/".$siteTemplate.
"/components".$path2Comp.
"/".$templateName;
998 $folders[] =
"/local/templates/.default/components".$path2Comp.
"/".$templateName;
999 $folders[] =
"/local/components".$path2Comp.
"/templates/".$templateName;
1001 if ($siteTemplate <>
"")
1003 $folders[] = BX_PERSONAL_ROOT.
"/templates/".$siteTemplate.
"/components".$path2Comp.
"/".$templateName;
1005 $folders[] = BX_PERSONAL_ROOT.
"/templates/.default/components".$path2Comp.
"/".$templateName;
1006 $folders[] =
"/bitrix/components".$path2Comp.
"/templates/".$templateName;
1008 foreach($folders as $templateFolder)
1010 if (file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$templateFolder))
1012 if (file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$templateFolder.
"/.parameters.php"))
1015 include(
$_SERVER[
"DOCUMENT_ROOT"].$templateFolder.
"/.parameters.php");
1017 return $arTemplateParameters;
1021 return $arTemplateParameters;
1032 $path2Comp = CComponentEngine::MakeComponentPath(
$componentName);
1033 if ($path2Comp ==
'')
1043 $templateFolders =
array();
1044 $arExists =
array();
1047 BX_PERSONAL_ROOT.
"/templates",
1050 foreach($folders as $folder)
1052 if(file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$folder))
1056 while (($file = readdir(
$handle)) !==
false)
1058 if ($file ==
"." || $file ==
"..")
1061 if ($currentTemplate !==
false && $currentTemplate != $file || $file ==
".default")
1064 if (file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$folder.
"/".$file.
"/components".$path2Comp))
1066 $templateFolders[] =
array(
1067 "path" => $folder.
"/".$file.
"/components".$path2Comp,
1068 "template" => $file,
1074 if (file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$folder.
"/.default/components".$path2Comp))
1076 $templateFolders[] =
array(
1077 "path" => $folder.
"/.default/components".$path2Comp,
1078 "template" =>
".default",
1085 $templateFolders[] =
array(
1090 foreach($templateFolders as $templateFolder)
1092 $templateFolderPath = $templateFolder[
"path"];
1093 if ($handle1 = @opendir(
$_SERVER[
"DOCUMENT_ROOT"].$templateFolderPath))
1095 while (($file1 = readdir($handle1)) !==
false)
1097 if ($file1 ==
"." || $file1 ==
"..")
1100 if (in_array($file1, $arExists))
1105 "TEMPLATE" => $templateFolder[
"template"],
1108 if (file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$templateFolderPath.
"/".$file1.
"/.description.php"))
1112 $arTemplateDescription =
array();
1113 include(
$_SERVER[
"DOCUMENT_ROOT"].$templateFolderPath.
"/".$file1.
"/.description.php");
1115 $arTemplate[
"TITLE"] = $arTemplateDescription[
"NAME"];
1116 $arTemplate[
"DESCRIPTION"] = $arTemplateDescription[
"DESCRIPTION"];
1122 @closedir($handle1);
1141 $path2Comp = CComponentEngine::MakeComponentPath(
$componentName);
1142 if ($path2Comp ==
'')
1156 $newNamespace = trim($newNamespace);
1157 if ($newNamespace <>
'')
1159 if (preg_match(
"#[^a-z0-9_.-]#i", $newNamespace))
1161 $APPLICATION->ThrowException(str_replace(
"#NAME#", $newNamespace,
GetMessage(
"comp_util_err3")),
"ERROR_NEW_NAMESPACE");
1169 if ($newName !==
false)
1171 if (!preg_match(
"#^([a-z0-9_-]+\\.)*([a-z0-9_-]+)$#i", $newName))
1173 $APPLICATION->ThrowException(str_replace(
"#NAME#", $newName,
GetMessage(
"comp_util_err4")),
"ERROR_NEW_NAME");
1186 if ($namespace == $newNamespace
1187 && ($newName ===
false ||
$name == $newName))
1193 if ($newName !==
false)
1194 $componentNameNew = $newNamespace.
":".$newName;
1196 $componentNameNew = $newNamespace.
":".
$name;
1198 $path2CompNew = CComponentEngine::MakeComponentPath($componentNameNew);
1199 if ($path2CompNew ==
'')
1201 $APPLICATION->ThrowException(str_replace(
"#NAME#", $componentNameNew,
GetMessage(
"comp_util_err2")),
"ERROR_NOT_COMPONENT");
1205 $componentPathNew =
getLocalPath(
"components".$path2CompNew);
1207 if (file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$componentPathNew))
1211 $APPLICATION->ThrowException(str_replace(
"#NAME#", $componentNameNew,
GetMessage(
"comp_util_err6")),
"ERROR_EXISTS");
1238 $path2Comp = CComponentEngine::MakeComponentPath(
$componentName);
1239 if ($path2Comp ==
'')
1253 if ($templateName ==
'')
1254 $templateName =
".default";
1256 if (preg_match(
"#[^a-z0-9_.-]#i", $templateName))
1258 $APPLICATION->ThrowException(str_replace(
"#NAME#", $templateName,
GetMessage(
"comp_util_err7")),
"ERROR_BAD_TEMPLATE_NAME");
1262 if ($siteTemplate ==
'')
1263 $siteTemplate =
false;
1265 if ($siteTemplate !=
false)
1267 $siteTemplateDir =
getLocalPath(
"templates/".$siteTemplate, BX_PERSONAL_ROOT);
1268 if ($siteTemplateDir ===
false || !is_dir(
$_SERVER[
"DOCUMENT_ROOT"].$siteTemplateDir))
1270 $APPLICATION->ThrowException(str_replace(
"#NAME#", $siteTemplate,
GetMessage(
"comp_util_err8")),
"ERROR_NO_SITE_TEMPL");
1275 if ($siteTemplate !=
false)
1276 $path =
getLocalPath(
"templates/".$siteTemplate.
"/components".$path2Comp.
"/".$templateName, BX_PERSONAL_ROOT);
1286 if ($newSiteTemplate ==
'')
1292 $newSiteTemplateDir =
getLocalPath(
"templates/".$newSiteTemplate, BX_PERSONAL_ROOT);
1293 if ($newSiteTemplateDir ===
false || !is_dir(
$_SERVER[
"DOCUMENT_ROOT"].$newSiteTemplateDir))
1295 $APPLICATION->ThrowException(str_replace(
"#NAME#", $newSiteTemplate,
GetMessage(
"comp_util_err8")),
"ERROR_NO_SITE_TEMPL");
1299 if ($siteTemplate !==
false
1300 && $siteTemplate == $newSiteTemplate
1301 && ($newName ===
false || $templateName == $newName))
1307 if ($newName !==
false)
1308 $templateNameNew = $newName;
1310 $templateNameNew = $templateName;
1312 if (preg_match(
"#[^a-z0-9_.-]#i", $templateNameNew))
1314 $APPLICATION->ThrowException(str_replace(
"#NAME#", $templateNameNew,
GetMessage(
"comp_util_err7")),
"ERROR_BAD_TEMPLATE_NAME");
1318 $pathNew = $newSiteTemplateDir.
"/components".$path2Comp.
"/".$templateNameNew;
1320 if (file_exists(
$_SERVER[
"DOCUMENT_ROOT"].$pathNew))
1324 $APPLICATION->ThrowException(str_replace(
"#NAME#", $templateNameNew,
GetMessage(
"comp_util_err12")),
"ERROR_EXISTS");
1349 '#LAST_NAME# #NAME#' =>
GetMessage(
'COMP_NAME_TEMPLATE_SMITH_JOHN'),
1350 '#LAST_NAME# #NAME# #SECOND_NAME#' =>
GetMessage(
'COMP_NAME_TEMPLATE_SMITH_JOHN_LLOYD'),
1351 '#LAST_NAME#, #NAME# #SECOND_NAME#' =>
GetMessage(
'COMP_NAME_TEMPLATE_SMITH_COMMA_JOHN_LLOYD'),
1352 '#NAME# #SECOND_NAME# #LAST_NAME#' =>
GetMessage(
'COMP_NAME_TEMPLATE_JOHN_LLOYD_SMITH'),
1353 '#NAME_SHORT# #SECOND_NAME_SHORT# #LAST_NAME#' =>
GetMessage(
'COMP_NAME_TEMPLATE_J_L_SMITH'),
1354 '#NAME_SHORT# #LAST_NAME#' =>
GetMessage(
'COMP_NAME_TEMPLATE_J_SMITH'),
1355 '#LAST_NAME# #NAME_SHORT#' =>
GetMessage(
'COMP_NAME_TEMPLATE_SMITH_J'),
1356 '#LAST_NAME# #NAME_SHORT# #SECOND_NAME_SHORT#' =>
GetMessage(
'COMP_NAME_TEMPLATE_SMITH_J_L'),
1357 '#LAST_NAME#, #NAME_SHORT#' =>
GetMessage(
'COMP_NAME_TEMPLATE_SMITH_COMMA_J'),
1358 '#LAST_NAME#, #NAME_SHORT# #SECOND_NAME_SHORT#' =>
GetMessage(
'COMP_NAME_TEMPLATE_SMITH_COMMA_J_L'),
1359 '#NAME# #LAST_NAME#' =>
GetMessage(
'COMP_NAME_TEMPLATE_JOHN_SMITH'),
1360 '#NAME# #SECOND_NAME_SHORT# #LAST_NAME#' =>
GetMessage(
'COMP_NAME_TEMPLATE_JOHN_L_SMITH'),
1361 '' =>
GetMessage(
'COMP_PARAM_NAME_FORMAT_SITE')
1367 $timestamp = mktime(0,0,0,2,6,2010);
1369 "PARENT" => $parent,
1372 "VALUES" => $no_year ?
1393 "M j, Y" =>
FormatDate(
"M j, Y", $timestamp),
1395 "f j, Y" =>
FormatDate(
"f j, Y", $timestamp),
1396 "SHORT" =>
GetMessage(
'COMP_PARAM_DATE_FORMAT_SITE')
1399 "ADDITIONAL_VALUES" =>
"Y",
1407 return $DB->DateFormatToPHP($no_year ? preg_replace(
'/[\-\.\/]*[Y]{2,4}[\-\.\/]*/',
'', CSite::GetDateFormat(
'SHORT')) : CSite::GetDateFormat(
"SHORT"));
1412 $timestamp = mktime(16,10,45,2,6,2010);
1414 "PARENT" => $parent,
1418 "d-m-Y H:i:s" =>
FormatDate(
"d-m-Y H:i:s", $timestamp),
1419 "m-d-Y H:i:s" =>
FormatDate(
"m-d-Y H:i:s", $timestamp),
1420 "Y-m-d H:i:s" =>
FormatDate(
"Y-m-d H:i:s", $timestamp),
1421 "d.m.Y H:i:s" =>
FormatDate(
"d.m.Y H:i:s", $timestamp),
1422 "m.d.Y H:i:s" =>
FormatDate(
"m.d.Y H:i:s", $timestamp),
1423 "j M Y H:i:s" =>
FormatDate(
"j M Y H:i:s", $timestamp),
1424 "M j, Y H:i:s" =>
FormatDate(
"M j, Y H:i:s", $timestamp),
1425 "j F Y H:i:s" =>
FormatDate(
"j F Y H:i:s", $timestamp),
1426 "f j, Y H:i:s" =>
FormatDate(
"f j, Y H:i:s", $timestamp),
1427 "d.m.y g:i:s A" =>
FormatDate(
"d.m.y g:i:s A", $timestamp),
1428 "d.M.y g:i:s a" =>
FormatDate(
"d.M.y g:i:s a", $timestamp),
1429 "d.M.Y g:i:s a" =>
FormatDate(
"d.M.Y g:i:s a", $timestamp),
1430 "d.m.y G:i" =>
FormatDate(
"d.m.y G:i", $timestamp),
1431 "j F Y G:i" =>
FormatDate(
"j F Y G:i", $timestamp),
1432 "j F Y g:i a" =>
FormatDate(
"j F Y g:i a", $timestamp),
1433 "FULL" =>
GetMessage(
'COMP_PARAM_DATETIME_FORMAT_SITE')
1436 "ADDITIONAL_VALUES" =>
"Y",
1444 return $DB->DateFormatToPHP(CSite::GetDateFormat(
"FULL"));
1449 if (is_array($timestamp))
1452 $timestamp = (
$params[
'TIMESTAMP'] ??
false);
1453 $offset = (isset(
$params[
'TZ_OFFSET']) ? intval(
$params[
'TZ_OFFSET']) : 0);
1454 $hideToday = (
$params[
'HIDE_TODAY'] ??
false);
1457 if (empty($timestamp))
1462 $culture = \Bitrix\Main\Context::getCurrent()->getCulture();
1463 $timeFormat =
$culture->getShortTimeFormat();
1464 $dateTimeFormat =
$culture->getLongDateFormat().
' '.$timeFormat;
1465 $dateTimeFormatWOYear =
$culture->getDayMonthFormat().
' '.$timeFormat;
1468 "tomorrow" =>
"tomorrow, ".$timeFormat,
1469 "today" => ($hideToday ? $timeFormat :
"today, ".$timeFormat),
1470 "yesterday" =>
"yesterday, ".$timeFormat,
1472 date(
"Y", $timestamp) == date(
"Y")
1473 ? $dateTimeFormatWOYear
1478 return FormatDate($arFormat, $timestamp, (time() + $offset));
static convertLangPath($langFile, $language)
static GetOptionString($module_id, $name, $def="", $site=false)
static CheckComponentName($name, $arFilter)
static GetTemplateProps($componentName, $templateName, $siteTemplate="", $arCurrentValues=array())
static GetComponentDescr($componentName)
static __GroupParamsCompare($a, $b)
static __SortComponentsTree(&$arTree)
static GetDefaultNameTemplates()
static GetDateTimeFormatted($timestamp, $dateTimeFormat=false, $offset=0, $hideToday=false)
static __GetComponentsTree($filterNamespace=false, $arNameFilter=false, $arFilter=false)
static isComponent($componentPath)
static __TreeItemCompare($a, $b)
static GetDateFormatDefault($no_year=false)
static GetTemplatesList($componentName, $currentTemplate=false)
static __ShowError($errorMessage)
static GetComponentsTree($filterNamespace=false, $arNameFilter=false, $arFilter=false)
static CopyTemplate($componentName, $templateName, $siteTemplate, $newSiteTemplate, $newName=false, $bRewrite=false)
static __IncludeLang($filePath, $fileName, $lang=false)
static PrepareVariables(&$arData)
static GetDateTimeFormatField($name="", $parent="")
static __BuildTree($arPath, &$arTree, &$arComponent, $level=1)
static GetNamespaceList()
static GetDateTimeFormatDefault()
static GetComponentProps($componentName, $arCurrentValues=array(), $templateProperties=array())
static CopyComponent($componentName, $newNamespace, $newName=false, $bRewrite=false)
static __TreeFolderCompare($a, $b)
static GetDateFormatField($name="", $parent="", $no_year=false)
if( $strWarning=="") if($strWarning=="") $componentPath
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
while($arParentIBlockProperty=$dbParentIBlockProperty->Fetch()) $errorMessage
$_SERVER["DOCUMENT_ROOT"]
if(!defined('SITE_ID')) $lang
FormatDate($format="", $timestamp=false, $now=false, ?string $languageId=null)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
DeleteDirFilesEx($path, $root=null)
CopyDirFiles($path_from, $path_to, $ReWrite=true, $Recursive=false, $bDeleteAfterCopy=false, $strExclude="")
GetMessage($name, $aReplace=null)
getLocalPath($path, $baseFolder="/bitrix")
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
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."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
if(!Loader::includeModule('sale')) $pattern