This commit is contained in:
2023-11-15 23:20:58 +03:00
parent a0c185aeda
commit 747f52cace
4 changed files with 94 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
/**
* @var \Wt\Core\Templater\Shell $this
* @var \Wt\Core\Form\Field\DefaultField $field
*/
use Bitrix\Main\Page\Asset;
use Wt\Core\Templater\Tools;
\Bitrix\Main\Loader::includeModule('iblock');
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/prolog.php");
Bitrix\Main\Page\Asset::getInstance()->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){?><label <?=Tools::getAttrByArray($labelAttrs)?>><?=$field->getLabel()?></label><?}
$inputAttributes = $field->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";