diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-06-04 10:47:42 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-06-04 10:47:42 +0100 |
| commit | de955c85fc44c2f437af523b4a19c2bf4a8e3cb7 (patch) | |
| tree | 3d3334a61f8d82d37b7d6cda9b8f404d5480fd73 /icon_browser.php | |
| parent | 8ea9ae28981761ba32861f5f1b9c74b7aca62a2c (diff) | |
| download | themes-de955c85fc44c2f437af523b4a19c2bf4a8e3cb7.tar.gz themes-de955c85fc44c2f437af523b4a19c2bf4a8e3cb7.tar.bz2 themes-de955c85fc44c2f437af523b4a19c2bf4a8e3cb7.zip | |
Icon system: switch from silk-sprite/colourstrap to Tango3 freedesktop iconset with SVG support
- function.biticon.php: look in util/iconsets/ (moved from config/); add SVG fallback
via scalable/ directory; biticon_first_match accepts optional extensions param;
isize (small/medium/large) mapped to 16/24/32px for SVG width+height; isize added
to ommit list so it never leaks as an HTML attribute
- admin_themes_inc.php: iconset path updated to UTIL_PKG_PATH; biticon_sizes expanded
to small (16px) / medium (24px) / large (32px)
- admin_themes_manager.php: iconset path updated to UTIL_PKG_PATH
- admin_themes_manager.tpl: replace stale Gnome/KDE links with Tango3/freedesktop refs
- icon_browser.php: icon_fetcher now uses scalable/ SVGs as primary name source,
supplements with large/ PNGs; all iconset paths updated to UTIL_PKG_PATH
- icon_browser.tpl: three clean size columns (small/medium/large) using isize=
instead of sloppy iname path embedding; help text updated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'icon_browser.php')
| -rwxr-xr-x | icon_browser.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/icon_browser.php b/icon_browser.php index 0cf4efe..9c6bda9 100755 --- a/icon_browser.php +++ b/icon_browser.php @@ -56,7 +56,7 @@ $gBitSmarty->assign( 'iconUsage', $iconUsage ); $iconList = []; $iconNames = []; -$iconThemes = ( !empty( $_REQUEST['icon_style'] ) ) ? [ $_REQUEST['icon_style'] ] : scandir( CONFIG_PKG_PATH . "iconsets/" ); +$iconThemes = ( !empty( $_REQUEST['icon_style'] ) ) ? [ $_REQUEST['icon_style'] ] : scandir( UTIL_PKG_PATH . "iconsets/" ); foreach( $iconThemes as $iconStyle ) { if( $icons = icon_fetcher( $iconStyle ) ) { @@ -74,12 +74,24 @@ $gBitSystem->display( 'bitpackage:themes/icon_browser.tpl', KernelTools::tra( 'I function icon_fetcher( $pStyle = DEFAULT_ICON_STYLE ) { $ret = []; if( strpos( $pStyle, '.' ) !== 0 && $pStyle != 'CVS' ) { - $stylePath = CONFIG_PKG_PATH."iconsets/".$pStyle; + $stylePath = UTIL_PKG_PATH."iconsets/".$pStyle; + + // Primary: scalable SVGs give the most complete name list + if( is_dir( $stylePath."/scalable" )) { + foreach( scandir( $stylePath."/scalable" ) as $icon ) { + if( preg_match( "#\.svg$#", $icon )) { + $name = substr( $icon, 0, -4 ); + $ret[$name] = $name; + } + } + } + + // Supplement with large PNGs not covered by scalable if( is_dir( $stylePath."/large" )) { - $handle = opendir( $stylePath."/large" ); - while( false !== ( $icon = readdir( $handle ))) { + foreach( scandir( $stylePath."/large" ) as $icon ) { if( preg_match( "#\.png$#", $icon ) && !preg_match( "#^process-working\.#", $icon )) { - $ret[str_replace( ".png", "", $icon )] = str_replace( ".png", "", $icon ); + $name = substr( $icon, 0, -4 ); + $ret[$name] ??= $name; } } } |
