From 148083ad66aa306924302f7a07f05f0f2790b09d Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Fri, 5 Jun 2026 14:30:32 +0100 Subject: Add istyle=flag for scalable 4:3 SVG flag sizing istyle=flag scales height via isize (small=16, medium=24, large=32) and derives width as (height/3)*4. istyle is already in the cache hash so no further cache key changes needed. Also reverts width/height from $ommit so they remain available as pass-through HTML attributes. Co-Authored-By: Claude Sonnet 4.6 --- smartyplugins/function.biticon.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smartyplugins/function.biticon.php b/smartyplugins/function.biticon.php index d866e70..c5839d3 100755 --- a/smartyplugins/function.biticon.php +++ b/smartyplugins/function.biticon.php @@ -61,7 +61,7 @@ function biticon_output( $pParams, $pFile ) { $outstr .= ' alt=""'; } - $ommit = [ 'ilocation', 'ipackage', 'ipath', 'iname', 'iexplain', 'iforce', 'istyle', 'iclass', 'isize', 'width', 'height' ]; + $ommit = [ 'ilocation', 'ipackage', 'ipath', 'iname', 'iexplain', 'iforce', 'istyle', 'iclass', 'isize' ]; foreach( $pParams as $name => $val ) { if( !in_array( $name, $ommit ) ) { $outstr .= ' '.$name.'="'.$val.'"'; @@ -80,8 +80,8 @@ function biticon_output( $pParams, $pFile ) { if( str_ends_with( $pFile, '.svg' ) ) { $svgSizes = ['small' => 16, 'medium' => 24, 'large' => 32]; - $w = $pParams['width'] ?? ($svgSizes[$pParams['isize'] ?? 'small'] ?? 16); - $h = $pParams['height'] ?? $w; + $h = $svgSizes[$pParams['isize'] ?? 'small'] ?? 16; + $w = ($pParams['istyle'] ?? '') === 'flag' ? (int)round( $h * 4 / 3 ) : $h; $outstr .= " width=\"$w\" height=\"$h\""; } -- cgit v1.3