This commit is contained in:
2021-10-08 16:22:44 +03:00
parent d6ddca4532
commit cf1405bef6
8 changed files with 62 additions and 47 deletions
+14 -11
View File
@@ -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']);
if($webp->convert()->isSuccess()) {
$webpSrc = $webp->getRelativePath();
?><source class="owl-lazy" data-srcset="<?=$webpSrc?>" type="image/webp"><?
$webp = new \Wt\Core\Media\Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']);
if($webp->make()->isSuccess()) {
?><source class="owl-lazy" data-srcset="<?=$webp->getPathOut(true)?>" 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'])?>"<?}?>
<?
if($arParams['ATTR']) {
echo \Bx\Kit\Template::get('attr', $arParams['ATTR']);
<img class="kit-img owl-lazy" data-src="<?=$arParams['SRC']?>" alt="<?=TemplaterTools::safeHtmlAttr($arParams['ALT'])?>"<?
if($arParams['TITLE']) {
?> title="<?=TemplaterTools::safeHtmlAttr($arParams['TITLE'])?>"<?
}
?>
/>
echo TemplaterTools::getAttrByArray($arParams['ATTR']);
?>/>
</picture>