diff options
| author | Christian Fowler <spider@viovio.com> | 2009-11-25 01:23:04 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2009-11-25 01:23:04 +0000 |
| commit | 687377857e5f258ab8be76dc1fd6f3ce56cf63cb (patch) | |
| tree | f4d91482fa5107765aa1a73a914b4b8628c64b57 /icon_browser.php | |
| parent | ff37f8342566e65c8026f3c800f620ca6c5c6e8f (diff) | |
| download | themes-687377857e5f258ab8be76dc1fd6f3ce56cf63cb.tar.gz themes-687377857e5f258ab8be76dc1fd6f3ce56cf63cb.tar.bz2 themes-687377857e5f258ab8be76dc1fd6f3ce56cf63cb.zip | |
add listing of ALL installed icon styles and highlight active & default; and linking drilldown to see just one icon set
Diffstat (limited to 'icon_browser.php')
| -rw-r--r-- | icon_browser.php | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/icon_browser.php b/icon_browser.php index cba2019..18d400b 100644 --- a/icon_browser.php +++ b/icon_browser.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_themes/icon_browser.php,v 1.6 2009/10/01 14:17:05 wjames5 Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_themes/icon_browser.php,v 1.7 2009/11/25 01:23:04 spiderr Exp $ * * Copyright (c) 2008 bitweaver * All Rights Reserved. See below for details and a complete list of authors. @@ -52,29 +52,38 @@ $iconUsage = array( "dialog-information" => "Information", ); $gBitSmarty->assign( 'iconUsage', $iconUsage ); -$defaultIconList = icon_fetcher(); -$gBitSmarty->assign( 'defaultIcons', $defaultIconList ); -$activeIconList = array(); -if( $gBitSystem->isFeatureActive( 'site_icon_style' ) && $gBitSystem->getConfig( 'site_icon_style' ) != DEFAULT_ICON_STYLE ) { - $activeIconList = icon_fetcher( $gBitSystem->getConfig( 'site_icon_style' )); - $gBitSmarty->assign( 'activeIcons', $activeIconList ); +$iconList = array(); +$iconNames = array(); +if( !empty( $_REQUEST['icon_style'] ) ) { + $iconThemes = array( $_REQUEST['icon_style'] ); +} else { + $iconThemes = scandir( THEMES_PKG_PATH."icon_styles/" ); +} + +foreach( $iconThemes as $iconStyle ) { + if( $icons = icon_fetcher( $iconStyle ) ) { + $iconList[$iconStyle] = $icons; + $iconNames = array_merge( $iconNames, $iconList[$iconStyle] ); + } } -$iconNames = array_merge( $activeIconList, $defaultIconList ); asort( $iconNames ); $gBitSmarty->assign( 'iconNames', $iconNames ); +$gBitSmarty->assign( 'iconList', $iconList ); $gBitSystem->display( 'bitpackage:themes/icon_browser.tpl', tra( 'Icon Listing' ) , array( 'display_mode' => 'display' )); function icon_fetcher( $pStyle = DEFAULT_ICON_STYLE ) { $ret = array(); - $stylePath = THEMES_PKG_PATH."icon_styles/".$pStyle; - if( is_dir( $stylePath."/large" )) { - $handle = opendir( $stylePath."/large" ); - while( FALSE !== ( $icon = readdir( $handle ))) { - if( preg_match( "#\.png$#", $icon ) && !preg_match( "#^process-working\.#", $icon )) { - $ret[str_replace( ".png", "", $icon )] = str_replace( ".png", "", $icon ); + if( strpos( $pStyle, '.' ) !== 0 && $pStyle != 'CVS' ) { + $stylePath = THEMES_PKG_PATH."icon_styles/".$pStyle; + if( is_dir( $stylePath."/large" )) { + $handle = opendir( $stylePath."/large" ); + while( FALSE !== ( $icon = readdir( $handle ))) { + if( preg_match( "#\.png$#", $icon ) && !preg_match( "#^process-working\.#", $icon )) { + $ret[str_replace( ".png", "", $icon )] = str_replace( ".png", "", $icon ); + } } } } |
