From 3db2788ab3457128ff3e043506cff28adc50f021 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Thu, 4 Jun 2026 11:43:00 +0100 Subject: icon_browser: add used_only filter to show only icons in active use ?used_only=1 filters the list to the ~70 icons in $iconUsage. Toggle link in the template switches between full and filtered view. icon_style filter is preserved across the toggle. Co-Authored-By: Claude Sonnet 4.6 --- icon_browser.php | 6 ++++++ templates/icon_browser.tpl | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/icon_browser.php b/icon_browser.php index 68d5a5b..8cdf596 100755 --- a/icon_browser.php +++ b/icon_browser.php @@ -131,9 +131,15 @@ foreach( $iconThemes as $iconStyle ) { } } +$usedOnly = !empty( $_REQUEST['used_only'] ); +if( $usedOnly ) { + $iconNames = array_intersect_key( $iconNames, $iconUsage ); +} + asort( $iconNames ); $gBitSmarty->assign( 'iconNames', $iconNames ); $gBitSmarty->assign( 'iconList', $iconList ); +$gBitSmarty->assign( 'usedOnly', $usedOnly ); $gBitSystem->display( 'bitpackage:themes/icon_browser.tpl', KernelTools::tra( 'Icon Listing' ) , [ 'display_mode' => 'display' ]); diff --git a/templates/icon_browser.tpl b/templates/icon_browser.tpl index 43ed76f..d80d5c1 100755 --- a/templates/icon_browser.tpl +++ b/templates/icon_browser.tpl @@ -10,6 +10,13 @@ The active set is tango, built from Tango3 with raster sizes at 16px (small), 24px (medium) and 32px (large), plus scalable SVGs. SVGs are served automatically when no raster file exists for the requested size.

+

+ {if $usedOnly} + {tr}Showing icons in use only.{/tr} {tr}Show all icons{/tr} + {else} + {tr}Showing all icons.{/tr} {tr}Show used icons only{/tr} + {/if} +

{foreach from=$iconList item=icons key=iconStyle} -- cgit v1.3