summaryrefslogtreecommitdiff
path: root/icon_browser.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2009-03-10 06:51:43 +0000
committerMax Kremmel <xing@synapse.plus.com>2009-03-10 06:51:43 +0000
commit9d9f927b5382312dc3a8f92351955c613ddeb3b6 (patch)
tree1976ba1d93ea17ce72ac3bf1d0af0f733a91f345 /icon_browser.php
parentd7441c6719fa7d3999eaee12aa8fd651d8c88db0 (diff)
downloadthemes-9d9f927b5382312dc3a8f92351955c613ddeb3b6.tar.gz
themes-9d9f927b5382312dc3a8f92351955c613ddeb3b6.tar.bz2
themes-9d9f927b5382312dc3a8f92351955c613ddeb3b6.zip
avoid displaying same icon in duplicate
Diffstat (limited to 'icon_browser.php')
-rw-r--r--icon_browser.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/icon_browser.php b/icon_browser.php
index 7847c02..287f337 100644
--- a/icon_browser.php
+++ b/icon_browser.php
@@ -38,24 +38,26 @@ $iconUsage = array(
"dialog-information" => "Information",
);
$gBitSmarty->assign( 'iconUsage', $iconUsage );
-$defaultIconList = icon_fetcher( THEMES_PKG_PATH."icon_styles/".DEFAULT_ICON_STYLE."/" );
+$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( THEMES_PKG_PATH."icon_styles/".$gBitSystem->getConfig( 'site_icon_style' )."/" );
+ $activeIconList = icon_fetcher( $gBitSystem->getConfig( 'site_icon_style' ));
$gBitSmarty->assign( 'activeIcons', $activeIconList );
}
-$iconNames = array_merge( array_keys( $activeIconList ), array_keys( $defaultIconList ) );
+$iconNames = array_merge( $activeIconList, $defaultIconList );
asort( $iconNames );
$gBitSmarty->assign( 'iconNames', $iconNames );
$gBitSystem->display( 'bitpackage:themes/icon_browser.tpl', tra( 'Icon Listing' ) , array( 'display_mode' => 'display' ));
-function icon_fetcher( $pStylePath ) {
- if( is_dir( $pStylePath."large" )) {
- $handle = opendir( $pStylePath."large" );
+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 );