From 747f52cace76508a73ca7532756bff6fe9cac6d3 Mon Sep 17 00:00:00 2001 From: bellord13 Date: Wed, 15 Nov 2023 23:20:58 +0300 Subject: [PATCH] fix --- templates/form/field/iblockproperty.php | 28 +++++++++++++++++++++++++ templates/form/field/input.php | 18 ++++++++++++++++ templates/form/field/select.php | 26 +++++++++++++++++++++++ templates/form/field/textarea.php | 22 +++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 templates/form/field/iblockproperty.php create mode 100644 templates/form/field/input.php create mode 100644 templates/form/field/select.php create mode 100644 templates/form/field/textarea.php diff --git a/templates/form/field/iblockproperty.php b/templates/form/field/iblockproperty.php new file mode 100644 index 0000000..39541bf --- /dev/null +++ b/templates/form/field/iblockproperty.php @@ -0,0 +1,28 @@ +addJs('/bitrix/js/iblock/iblock_edit.js'); +Asset::getInstance()->addJs("/bitrix/js/main/core/core.js"); +\Bitrix\Main\UI\Extension::load(array("popup", "ajax", "ui.buttons", "ui.forms", "main.polyfill.core", "color_picker")); +$bLabel = mb_strlen($field->getLabel()); +$labelAttrs = []; +if(mb_strlen($field->getId())){ + $labelAttrs['for'] = $field->getId(); +} +if($bLabel){?>getAttributes(); +$inputAttributes['data-dirty'] = $field->isDirty()?'true':'false'; +if($field->isMultiple()){ + $inputAttributes['name'] = preg_replace('/\[]$/', '', $inputAttributes['name']) . '[]'; +} +unset($inputAttributes['options']); + +_ShowPropertyField($field->getName(), $field->getPropertyEntity()->getRaw(), [], false, false, 50000, $field->getForm()->getName(), false); +echo "\n\r"; \ No newline at end of file diff --git a/templates/form/field/input.php b/templates/form/field/input.php new file mode 100644 index 0000000..e21a9d6 --- /dev/null +++ b/templates/form/field/input.php @@ -0,0 +1,18 @@ +getLabel()); +$labelAttrs = []; +if(mb_strlen($field->getId())){ + $labelAttrs['for'] = $field->getId(); +} +if($bLabel){?>getAttributes(); +$inputAttributes['data-dirty'] = $field->isDirty()?'true':'false'; + + ?>>getLabel()); +$labelAttrs = []; +if(mb_strlen($field->getId())){ + $labelAttrs['for'] = $field->getId(); +} +if($bLabel){?>getAttributes(); +$inputAttributes['data-dirty'] = $field->isDirty()?'true':'false'; +if($field->isMultiple()){ + $inputAttributes['name'] = preg_replace('/\[]$/', '', $inputAttributes['name']) . '[]'; +} +unset($inputAttributes['options']); + +?>getLabel()); +$labelAttrs = []; +if(mb_strlen($field->getId())){ + $labelAttrs['for'] = $field->getId(); +} +if($bLabel){?> +getAttributes(); +$inputAttributes['data-dirty'] = $field->isDirty()?'true':'false'; +unset($inputAttributes['multiple']); +if($field->isMultiple()){ + +} +?>