mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -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";
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \Wt\Core\Templater\Shell $this
|
||||
* @var \Wt\Core\Form\Field\DefaultField $field
|
||||
*/
|
||||
use Wt\Core\Templater\Tools;
|
||||
|
||||
$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';
|
||||
|
||||
?><input <?=Tools::getAttrByArray($inputAttributes)?>><?
|
||||
echo "\n\r";
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \Wt\Core\Templater\Shell $this
|
||||
* @var \Wt\Core\Form\Field\DefaultField $field
|
||||
*/
|
||||
use Wt\Core\Templater\Tools;
|
||||
|
||||
$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']);
|
||||
|
||||
?><select <?=Tools::getAttrByArray($inputAttributes)?>><?
|
||||
foreach ($field->getOptions() as $key => $value){
|
||||
?><option value="<?=$key?>"<?if($field->isSelectValue($key)){?> selected<?}?>><?=$value?></option><?
|
||||
}
|
||||
?></select><?
|
||||
echo "\n\r";
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \Wt\Core\Templater\Shell $this
|
||||
* @var \Wt\Core\Form\Field\DefaultField $field
|
||||
*/
|
||||
use Wt\Core\Templater\Tools;
|
||||
|
||||
$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';
|
||||
unset($inputAttributes['multiple']);
|
||||
if($field->isMultiple()){
|
||||
|
||||
}
|
||||
?><textarea <?=Tools::getAttrByArray($inputAttributes)?>><?=$field->getValue()?></textarea><?
|
||||
echo "\n\r";
|
||||
Reference in New Issue
Block a user