mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fixpan
This commit is contained in:
+11
-1
@@ -6,12 +6,22 @@ use \Wt\Core\Templater\Tools as TemplaterTools;
|
||||
?>
|
||||
<picture class="kit-picture <?=$arParams['CLASS']?>">
|
||||
<?
|
||||
foreach ((array)$arParams['SRCSET_LIST'] as $srcset) {
|
||||
$webp = new Webp($_SERVER['DOCUMENT_ROOT'] . $srcset['src']);
|
||||
if($webp->make()->isSuccess()) {
|
||||
?><source srcset="<?=$webp->getPathOut(true)?>" type="image/webp"<?if($srcset['media']){?> media="<?=TemplaterTools::safeHtmlAttr($srcset['media'])?>"<?}?>><?
|
||||
}
|
||||
?>
|
||||
<source srcset="<?=$srcset['src']?>" type="<?=$webp->mime?>"<?if($srcset['media']){?> media="<?=TemplaterTools::safeHtmlAttr($srcset['media'])?>"<?}?>>
|
||||
<?
|
||||
}
|
||||
|
||||
$webp = new Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']);
|
||||
if($webp->make()->isSuccess()) {
|
||||
?><source srcset="<?=$webp->getPathOut(true)?>" type="image/webp"><?
|
||||
}
|
||||
?>
|
||||
<img class="kit-img" src="<?=$arParams['SRC']?>" alt="<?=TemplaterTools::safeHtmlAttr($arParams['ALT'])?>"<?
|
||||
<img class="kit-img"<?if($arParams['SRC']) {?> src="<?=$arParams['SRC']?>"<?}?> alt="<?=TemplaterTools::safeHtmlAttr($arParams['ALT'])?>"<?
|
||||
if($arParams['TITLE']) {
|
||||
?> title="<?=TemplaterTools::safeHtmlAttr($arParams['TITLE'])?>"<?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user