mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use \Wt\Core\Templater\Tools as TemplaterTools;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $arParams
|
* @var array $arParams
|
||||||
*/
|
*/
|
||||||
@@ -20,8 +22,8 @@ $preloader = \Wt\Core\Tools::isTrue($arParams['PRELOADER']);
|
|||||||
<?if($arParams['ENTITY']){?>data-entity="<?=$arParams['ENTITY']?>"<?}?>
|
<?if($arParams['ENTITY']){?>data-entity="<?=$arParams['ENTITY']?>"<?}?>
|
||||||
<?if($arParams['VALUE']){?>value="<?=$arParams['VALUE']?>"<?}?>
|
<?if($arParams['VALUE']){?>value="<?=$arParams['VALUE']?>"<?}?>
|
||||||
class="kit-button <?=$arParams['CLASS']?:app()->config()->get('templaterParams.button.class', '')?> <?=$arParams['ADD_CLASS']?><?=(!$preloader?' not-preloader ':'')?>"
|
class="kit-button <?=$arParams['CLASS']?:app()->config()->get('templaterParams.button.class', '')?> <?=$arParams['ADD_CLASS']?><?=(!$preloader?' not-preloader ':'')?>"
|
||||||
onclick="<?=\Bx\Kit\Node\Lib::safeHtmlAttr($arParams['ONCLICK'])?>"
|
onclick="<?=TemplaterTools::safeHtmlAttr($arParams['ONCLICK'])?>"
|
||||||
<?=\Bx\Kit\Node\Lib::getAttrByArray($arParams['ATTR']);?>
|
<?=TemplaterTools::getAttrByArray($arParams['ATTR']);?>
|
||||||
><div class="kit-button__icon kit-icon"><?=$arParams['ICON']?></div>
|
><div class="kit-button__icon kit-icon"><?=$arParams['ICON']?></div>
|
||||||
<div class="kit-button__label kit-line-clamp"><?=$arParams['LABEL']?:$arParams['NAME']?:''?></div>
|
<div class="kit-button__label kit-line-clamp"><?=$arParams['LABEL']?:$arParams['NAME']?:''?></div>
|
||||||
<div class="kit-button__border"></div>
|
<div class="kit-button__border"></div>
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
<div class="kit-field__hint kit-icon" data-bs-toggle="tooltip" title="<?=\Bx\Kit\Node\Lib::safeHtmlAttr($arParams['TITLE'])?>">
|
<?php
|
||||||
|
use Wt\Core\Templater\Tools as TemplaterTools;
|
||||||
|
?>
|
||||||
|
<div class="kit-field__hint kit-icon" data-bs-toggle="tooltip" title="<?=TemplaterTools::safeHtmlAttr($arParams['TITLE'])?>">
|
||||||
<?app()->service()->templater()->render('kit:svg/hint')?>
|
<?app()->service()->templater()->render('kit:svg/hint')?>
|
||||||
</div>
|
</div>
|
||||||
+6
-6
@@ -3,8 +3,8 @@
|
|||||||
* @var array $arParams
|
* @var array $arParams
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Wt\Core\Type\Str as Str;
|
use Wt\Core\Templater\Tools as TemplaterTools;
|
||||||
use Wt\Core\Tools as Tools;
|
use Wt\Core\Tools;
|
||||||
|
|
||||||
//include ".con/fields.php";
|
//include ".con/fields.php";
|
||||||
|
|
||||||
@@ -49,13 +49,13 @@ if($isHint) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>"
|
?>"
|
||||||
value="<?=Str::safeHtmlAttr($arParams['VALUE'])?>"
|
value="<?=TemplaterTools::safeHtmlAttr($arParams['VALUE'])?>"
|
||||||
maxlength="255"
|
maxlength="255"
|
||||||
placeholder="<?=Str::safeHtmlAttr($arParams['PLACEHOLDER']).''?>"
|
placeholder="<?=TemplaterTools::safeHtmlAttr($arParams['PLACEHOLDER']).''?>"
|
||||||
<?
|
<?
|
||||||
echo \Bx\Kit\Node\Lib::getAttrByArray($arParams['ATTR']);
|
echo TemplaterTools::getAttrByArray($arParams['ATTR']);
|
||||||
if($isDatepicker) {
|
if($isDatepicker) {
|
||||||
echo \Bx\Kit\Node\Lib::getAttrByArray([
|
echo TemplaterTools::getAttrByArray([
|
||||||
'data-position' => 'bottom left'
|
'data-position' => 'bottom left'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use \Wt\Core\Templater\Tools as TemplaterTools;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="modal fade <?=$arParams['WRAP_CLASS']?>" id="<?=$arParams['ID']?>" tabindex="-1" aria-labelledby="<?=$arParams['ID']?>" aria-hidden="true" <?=\Bx\Kit\Node\Lib::getAttrByArray($arParams['ATTR'])?>>
|
<div class="modal fade <?=$arParams['WRAP_CLASS']?>" id="<?=$arParams['ID']?>" tabindex="-1" aria-labelledby="<?=$arParams['ID']?>" aria-hidden="true" <?=TemplaterTools::getAttrByArray($arParams['ATTR'])?>>
|
||||||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
use Bx\Kit\Lib\Type\Str as StrAlias;
|
use Wt\Core\Templater\Tools as TemplaterTools;
|
||||||
|
|
||||||
$root = '';
|
$root = '';
|
||||||
if(strlen($arParams['ROOT'])) {
|
if(strlen($arParams['ROOT'])) {
|
||||||
$root = StrAlias::safeHtmlAttr($arParams['ROOT']) . ':';
|
$root = TemplaterTools::safeHtmlAttr($arParams['ROOT']) . ':';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
?><meta property="<?=$root?><?=TemplaterTools::safeHtmlAttr($arParams['PROPERTY']?:$arParams['NAME'])?>" content="<?= TemplaterTools::safeHtmlAttr($arParams['CONTENT']?:$arParams['VALUE'])?>">
|
||||||
?><meta property="<?=$root?><?= StrAlias::safeHtmlAttr($arParams['PROPERTY']?:$arParams['NAME'])?>" content="<?= StrAlias::safeHtmlAttr($arParams['CONTENT']?:$arParams['VALUE'])?>">
|
|
||||||
|
|||||||
+12
-8
@@ -1,15 +1,19 @@
|
|||||||
<?
|
<?
|
||||||
use Wt\Core\Type;
|
|
||||||
|
use \Wt\Core\Templater\Tools as TemplaterTools;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<picture class="kit-picture <?=$arParams['CLASS']?>">
|
<picture class="kit-picture <?=$arParams['CLASS']?>">
|
||||||
<?
|
<?
|
||||||
$webp = new \Bx\Kit\Image\Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']);
|
$webp = new \Wt\Core\Media\Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']);
|
||||||
if($webp->convert()->isSuccess()) {
|
if($webp->make()->isSuccess()) {
|
||||||
$webpSrc = $webp->getRelativePath();
|
?><source srcset="<?=$webp->getPathOut(true)?>" type="image/webp"><?
|
||||||
?><source srcset="<?=$webpSrc?>" type="image/webp"><?
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<img class="kit-img" src="<?=$arParams['SRC']?>" alt="<?=Type\Str::safeHtmlAttr($arParams['ALT'])?>"<?if($arParams['TITLE']) {?> title="<?=Type\Str::safeHtmlAttr($arParams['TITLE'])?>"<?}?>
|
<img class="kit-img" src="<?=$arParams['SRC']?>" alt="<?=TemplaterTools::safeHtmlAttr($arParams['ALT'])?>"<?
|
||||||
<?=\Bx\Kit\Node\Lib::getAttrByArray($arParams['ATTR']);?>
|
if($arParams['TITLE']) {
|
||||||
/>
|
?> title="<?=TemplaterTools::safeHtmlAttr($arParams['TITLE'])?>"<?
|
||||||
|
}
|
||||||
|
echo TemplaterTools::getAttrByArray($arParams['ATTR']);
|
||||||
|
?>/>
|
||||||
</picture>
|
</picture>
|
||||||
@@ -1,16 +1,19 @@
|
|||||||
<picture class="kit-picture">
|
<?
|
||||||
|
|
||||||
|
use \Wt\Core\Templater\Tools as TemplaterTools;
|
||||||
|
|
||||||
|
?>
|
||||||
|
<picture class="kit-picture <?=$arParams['CLASS']?>">
|
||||||
<?
|
<?
|
||||||
$webp = new \Bx\Kit\Image\Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']);
|
$webp = new \Wt\Core\Media\Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']);
|
||||||
if($webp->convert()->isSuccess()) {
|
if($webp->make()->isSuccess()) {
|
||||||
$webpSrc = $webp->getRelativePath();
|
?><source class="owl-lazy" data-srcset="<?=$webp->getPathOut(true)?>" type="image/webp"><?
|
||||||
?><source class="owl-lazy" data-srcset="<?=$webpSrc?>" type="image/webp"><?
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<img class="kit-img owl-lazy" data-src="<?=$arParams['SRC']?>" alt="<?=\Bx\Kit\Lib\Type\Str::safeHtmlAttr($arParams['ALT'])?>"<?if($arParams['TITLE']) {?> title="<?=\Bx\Kit\Lib\Type\Str::safeHtmlAttr($arParams['TITLE'])?>"<?}?>
|
<img class="kit-img owl-lazy" data-src="<?=$arParams['SRC']?>" alt="<?=TemplaterTools::safeHtmlAttr($arParams['ALT'])?>"<?
|
||||||
<?
|
if($arParams['TITLE']) {
|
||||||
if($arParams['ATTR']) {
|
?> title="<?=TemplaterTools::safeHtmlAttr($arParams['TITLE'])?>"<?
|
||||||
echo \Bx\Kit\Template::get('attr', $arParams['ATTR']);
|
|
||||||
}
|
}
|
||||||
?>
|
echo TemplaterTools::getAttrByArray($arParams['ATTR']);
|
||||||
/>
|
?>/>
|
||||||
</picture>
|
</picture>
|
||||||
+17
-14
@@ -3,6 +3,9 @@
|
|||||||
/**
|
/**
|
||||||
* @var array $arParams
|
* @var array $arParams
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Wt\Core\Templater\Tools as TemplaterTools;
|
||||||
|
use Wt\Core\Tools;
|
||||||
use \Wt\Core\Type;
|
use \Wt\Core\Type;
|
||||||
|
|
||||||
$arParamsDefault = [
|
$arParamsDefault = [
|
||||||
@@ -36,7 +39,7 @@ $optionDefault = [
|
|||||||
if(!isset($arParams['AUTO_SELECT'])) {
|
if(!isset($arParams['AUTO_SELECT'])) {
|
||||||
$arParams['AUTO_SELECT'] = $arParamsDefault['AUTO_SELECT'];
|
$arParams['AUTO_SELECT'] = $arParamsDefault['AUTO_SELECT'];
|
||||||
}
|
}
|
||||||
$arParams['AUTO_SELECT'] = \Bx\Kit\Tools::isTrue($arParams['AUTO_SELECT']);
|
$arParams['AUTO_SELECT'] = Tools::isTrue($arParams['AUTO_SELECT']);
|
||||||
|
|
||||||
if(!isset($arParams['OPTIONS_VALUE_KEY'])) {
|
if(!isset($arParams['OPTIONS_VALUE_KEY'])) {
|
||||||
$arParams['OPTIONS_VALUE_KEY'] = $arParamsDefault['OPTIONS_VALUE_KEY'];
|
$arParams['OPTIONS_VALUE_KEY'] = $arParamsDefault['OPTIONS_VALUE_KEY'];
|
||||||
@@ -47,22 +50,22 @@ if(!isset($arParams['OPTIONS_TEXT_KEY'])) {
|
|||||||
$arParams['OPTIONS'] = (array)$arParams['OPTIONS'];
|
$arParams['OPTIONS'] = (array)$arParams['OPTIONS'];
|
||||||
|
|
||||||
|
|
||||||
$arrowInLabel = \Bx\Kit\Tools::isTrue($arParams['ARROW_IN_LABEL']);
|
$arrowInLabel = Tools::isTrue($arParams['ARROW_IN_LABEL']);
|
||||||
|
|
||||||
if(!isset($arParams['CHECK_DIRTY'])) {
|
if(!isset($arParams['CHECK_DIRTY'])) {
|
||||||
$arParams['CHECK_DIRTY'] = $arParamsDefault['CHECK_DIRTY'];
|
$arParams['CHECK_DIRTY'] = $arParamsDefault['CHECK_DIRTY'];
|
||||||
}
|
}
|
||||||
$checkDirty = \Bx\Kit\Tools::isTrue($arParams['CHECK_DIRTY']);
|
$checkDirty = Tools::isTrue($arParams['CHECK_DIRTY']);
|
||||||
|
|
||||||
$optionSelectedArray = [];
|
$optionSelectedArray = [];
|
||||||
$hidden = \Bx\Kit\Tools::isTrue($arParams['HIDDEN']) || ($arParams['TYPE'] == 'hidden');
|
$hidden = Tools::isTrue($arParams['HIDDEN']) || ($arParams['TYPE'] == 'hidden');
|
||||||
$multiple = \Bx\Kit\Tools::isTrue($arParams['MULTIPLE']);
|
$multiple = Tools::isTrue($arParams['MULTIPLE']);
|
||||||
$optionsHtml = '';
|
$optionsHtml = '';
|
||||||
|
|
||||||
if($arParams['OPTIONS']) {
|
if($arParams['OPTIONS']) {
|
||||||
if(strlen($arParams['SELECTED'])) {
|
if(strlen($arParams['SELECTED'])) {
|
||||||
foreach ($arParams['OPTIONS'] as $option) {
|
foreach ($arParams['OPTIONS'] as $option) {
|
||||||
if(isset($option['VISIBLE']) && !\Bx\Kit\Tools::isTrue($option['VISIBLE'])) continue;
|
if(isset($option['VISIBLE']) && !Tools::isTrue($option['VISIBLE'])) continue;
|
||||||
if($arParams['SELECTED'] == Type\Arr::get($option, $arParams['OPTIONS_VALUE_KEY'])) {
|
if($arParams['SELECTED'] == Type\Arr::get($option, $arParams['OPTIONS_VALUE_KEY'])) {
|
||||||
$optionSelectedArray = $option;
|
$optionSelectedArray = $option;
|
||||||
break;
|
break;
|
||||||
@@ -73,8 +76,8 @@ if($arParams['OPTIONS']) {
|
|||||||
if($arParams['AUTO_SELECT']) {
|
if($arParams['AUTO_SELECT']) {
|
||||||
if(!$optionSelectedArray) {
|
if(!$optionSelectedArray) {
|
||||||
foreach ($arParams['OPTIONS'] as $option) {
|
foreach ($arParams['OPTIONS'] as $option) {
|
||||||
if(isset($option['VISIBLE']) && !\Bx\Kit\Tools::isTrue($option['VISIBLE'])) continue;
|
if(isset($option['VISIBLE']) && !Tools::isTrue($option['VISIBLE'])) continue;
|
||||||
if(\Bx\Kit\Tools::isTrue($option['SELECTED'])) {
|
if(Tools::isTrue($option['SELECTED'])) {
|
||||||
$optionSelectedArray = $option;
|
$optionSelectedArray = $option;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -88,12 +91,12 @@ if($arParams['OPTIONS']) {
|
|||||||
}
|
}
|
||||||
$optionsCount = 0;
|
$optionsCount = 0;
|
||||||
foreach ($arParams['OPTIONS'] as $option) {
|
foreach ($arParams['OPTIONS'] as $option) {
|
||||||
if(isset($option['VISIBLE']) && !\Bx\Kit\Tools::isTrue($option['VISIBLE'])) continue;
|
if(isset($option['VISIBLE']) && !Tools::isTrue($option['VISIBLE'])) continue;
|
||||||
$isSelected = (Type\Arr::get($optionSelectedArray, $arParams['OPTIONS_VALUE_KEY']) == Type\Arr::get($option, $arParams['OPTIONS_VALUE_KEY']));
|
$isSelected = (Type\Arr::get($optionSelectedArray, $arParams['OPTIONS_VALUE_KEY']) == Type\Arr::get($option, $arParams['OPTIONS_VALUE_KEY']));
|
||||||
$isDisabled = \Bx\Kit\Tools::isTrue($option['DISABLED']) || \Bx\Kit\Tools::isTrue($option['RESTRICTED']);
|
$isDisabled = Tools::isTrue($option['DISABLED']) || Tools::isTrue($option['RESTRICTED']);
|
||||||
|
|
||||||
$optionsCount++;
|
$optionsCount++;
|
||||||
$optionsHtml .= ' <option value="'.Type\Arr::get($option, $arParams['OPTIONS_VALUE_KEY']).'" '. \Bx\Kit\Node\Lib::getAttrByArray($option['ATTR']) .
|
$optionsHtml .= ' <option value="'.Type\Arr::get($option, $arParams['OPTIONS_VALUE_KEY']).'" '. TemplaterTools::getAttrByArray($option['ATTR']) .
|
||||||
($isSelected?' selected':'').''.
|
($isSelected?' selected':'').''.
|
||||||
($isDisabled?' disabled':'').'>'.Type\Arr::get($option, $arParams['OPTIONS_TEXT_KEY']).'</option>';
|
($isDisabled?' disabled':'').'>'.Type\Arr::get($option, $arParams['OPTIONS_TEXT_KEY']).'</option>';
|
||||||
}
|
}
|
||||||
@@ -105,9 +108,9 @@ foreach ($arParams['OPTIONS'] as $option) {
|
|||||||
name="<?=$arParams['NAME']?>"
|
name="<?=$arParams['NAME']?>"
|
||||||
<?if($arParams['ID']){?>id="<?=$arParams['ID']?>"<?}?>
|
<?if($arParams['ID']){?>id="<?=$arParams['ID']?>"<?}?>
|
||||||
<?if($multiple){?> multiple<?}?>
|
<?if($multiple){?> multiple<?}?>
|
||||||
<?if($arParams['ONCHANGE']){?> onchange="<?=\Bx\Kit\Lib\Type\Str::safeHtmlAttr($arParams['ONCHANGE'])?>"<?}?>
|
<?if($arParams['ONCHANGE']){?> onchange="<?=TemplaterTools::safeHtmlAttr($arParams['ONCHANGE'])?>"<?}?>
|
||||||
class="kit-field__input <?=$arParams['CLASS']?> <?=$arParams['ADD_CLASS']?>"
|
class="kit-field__input <?=$arParams['CLASS']?> <?=$arParams['ADD_CLASS']?>"
|
||||||
<?=\Bx\Kit\Node\Lib::getAttrByArray($arParams['ATTR'])?>
|
<?=TemplaterTools::getAttrByArray($arParams['ATTR'])?>
|
||||||
<?if($arParams['PLACEHOLDER']){?>data-placeholder="<?=$arParams['PLACEHOLDER']?>"<?}?>
|
<?if($arParams['PLACEHOLDER']){?>data-placeholder="<?=$arParams['PLACEHOLDER']?>"<?}?>
|
||||||
><?echo $optionsHtml?:$arParams['OPTIONS_HTML']; ?></select>
|
><?echo $optionsHtml?:$arParams['OPTIONS_HTML']; ?></select>
|
||||||
<?
|
<?
|
||||||
@@ -116,7 +119,7 @@ foreach ($arParams['OPTIONS'] as $option) {
|
|||||||
}?>
|
}?>
|
||||||
<?if(!$arrowInLabel){?><span class="kit-field__arrow"><?=app()->service()->templater()->get('kit:svg/chevronAnimate')?></span><?}?>
|
<?if(!$arrowInLabel){?><span class="kit-field__arrow"><?=app()->service()->templater()->get('kit:svg/chevronAnimate')?></span><?}?>
|
||||||
<span class="kit-field__display"><?=Type\Arr::get($optionSelectedArray, $arParams['OPTIONS_TEXT_KEY'])?:$arParams['PLACEHOLDER']?></span>
|
<span class="kit-field__display"><?=Type\Arr::get($optionSelectedArray, $arParams['OPTIONS_TEXT_KEY'])?:$arParams['PLACEHOLDER']?></span>
|
||||||
<span class="kit-field__label"><?=$arParams['LABEL']?:$arParams['NAME']?:''?><?if($arrowInLabel){?><span class="kit-field__arrow"><?=\Bx\Kit\Template::get('svg/chevronAnimate')?></span><?}?></span>
|
<span class="kit-field__label"><?=$arParams['LABEL']?:$arParams['NAME']?:''?><?if($arrowInLabel){?><span class="kit-field__arrow"><?=app()->service()->templater()->get('svg/chevronAnimate')?></span><?}?></span>
|
||||||
<span class="kit-field__error"></span>
|
<span class="kit-field__error"></span>
|
||||||
<span class="kit-field__hr"></span>
|
<span class="kit-field__hr"></span>
|
||||||
<?if($arParams['AREA_LEFT']){?><div class="kit-field__area-left"><?=$arParams['AREA_LEFT']?></div><?}?>
|
<?if($arParams['AREA_LEFT']){?><div class="kit-field__area-left"><?=$arParams['AREA_LEFT']?></div><?}?>
|
||||||
|
|||||||
Reference in New Issue
Block a user