diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-06-04 11:43:00 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-06-04 11:43:00 +0100 |
| commit | 3db2788ab3457128ff3e043506cff28adc50f021 (patch) | |
| tree | 1378328943f5e46d96a667e96e69f619edd01fb3 | |
| parent | 454c8c5135589a3e2f6ec98c50aec970e2809bec (diff) | |
| download | themes-3db2788ab3457128ff3e043506cff28adc50f021.tar.gz themes-3db2788ab3457128ff3e043506cff28adc50f021.tar.bz2 themes-3db2788ab3457128ff3e043506cff28adc50f021.zip | |
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 <noreply@anthropic.com>
| -rwxr-xr-x | icon_browser.php | 6 | ||||
| -rwxr-xr-x | templates/icon_browser.tpl | 7 |
2 files changed, 13 insertions, 0 deletions
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 <strong>tango</strong>, built from <a class="external" href="https://gitlab.com/tango-project/tango-icon-theme">Tango3</a> 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. </p> + <p> + {if $usedOnly} + {tr}Showing icons in use only.{/tr} <a href="{$smarty.request.SCRIPT_NAME}{if $smarty.request.icon_style}?icon_style={$smarty.request.icon_style}{/if}">{tr}Show all icons{/tr}</a> + {else} + {tr}Showing all icons.{/tr} <a href="{$smarty.request.SCRIPT_NAME}?used_only=1{if $smarty.request.icon_style}&icon_style={$smarty.request.icon_style}{/if}">{tr}Show used icons only{/tr}</a> + {/if} + </p> <table class="table data"> <tr> {foreach from=$iconList item=icons key=iconStyle} |
