diff options
| -rw-r--r-- | icon_browser.php | 37 | ||||
| -rw-r--r-- | templates/icon_browser.tpl | 41 |
2 files changed, 44 insertions, 34 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 ); + } } } } diff --git a/templates/icon_browser.tpl b/templates/icon_browser.tpl index ad79eb5..6fa9fe7 100644 --- a/templates/icon_browser.tpl +++ b/templates/icon_browser.tpl @@ -11,36 +11,37 @@ </p> <table class="data"> <tr> - <th class="width1p" colspan="2">{tr}Default Icons{/tr}</th> - <th class="width1p" colspan="2">{if $activeIcons}{tr}Active Icons{/tr}{/if}</th> + {foreach from=$iconList item=icons key=iconStyle} + <th class="width1p" colspan="3"><a href="{$smarty.request.PHP_SELF}?icon_style={$iconStyle}">{$iconStyle}</a></th> + {/foreach} <th class="width70p;">{tr}Icon name{/tr}</th> <th class="width29p;">{tr}bitweaver uses{/tr}</th> </tr> {foreach from=$iconNames item=name} <tr class="{cycle values="odd,even"}"> - <td> - {if $defaultIcons.$name} - {* avoid translation here by not using iexplain *} - {biticon istyle=tango ipackage=icons iname="small/`$defaultIcons.$name`"} - {/if} - </td> - <td> - {if $defaultIcons.$name} - {biticon istyle=tango ipackage=icons iname="large/`$defaultIcons.$name`"} - {/if} + {foreach from=$iconList item=icons key=iconStyle} + <td {if $gBitSystem->getConfig( 'site_icon_style' ) == $iconStyle}class="prio1"{elseif $iconStyle == $smarty.const.DEFAULT_ICON_STYLE}class="prio2"{/if}> + {if $iconList.$iconStyle.$name} + {* avoid translation here by not using iexplain *} + {biticon istyle=$iconStyle ipackage=icons iname="small/`$iconList.$iconStyle.$name`"} + {/if} </td> - <td> - {if $activeIcons.$name} - {* avoid translation here by not using iexplain *} - {biticon ipackage=icons iname="small/`$activeIcons.$name`"} - {/if} + <td {if $gBitSystem->getConfig( 'site_icon_style' ) == $iconStyle}class="prio1"{elseif $iconStyle == $smarty.const.DEFAULT_ICON_STYLE}class="prio2"{/if}> + {if $iconList.$iconStyle.$name} + {* avoid translation here by not using iexplain *} + {biticon istyle=$iconStyle ipackage=icons iname="large/`$iconList.$iconStyle.$name`"} + {/if} </td> <td> - {if $activeIcons.$name} - {biticon ipackage=icons iname="large/`$activeIcons.$name`"} - {/if} + {* only show huge size if looking at a particular set *} + {if $smarty.request.icon_style && $iconList.$iconStyle.$name} + {* avoid translation here by not using iexplain *} + {biticon istyle=$iconStyle ipackage=icons iname="huge/`$iconList.$iconStyle.$name`"} + {/if} </td> + {/foreach} + <td> {$name}<br /> <small>{ldelim}biticon ipackage="icons" iname="{$name}" iexplain="Icon"{rdelim}</small> |
