summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2008-07-29 08:51:32 +0000
committerMax Kremmel <xing@synapse.plus.com>2008-07-29 08:51:32 +0000
commitc96846b267356994cbce9bf4d923ba621811963f (patch)
tree755fac49c4ff0897eb699aad2967f044ab755127
parent2092bc27aa4081e0262079581e55f8aaed743751 (diff)
downloadthemes-c96846b267356994cbce9bf4d923ba621811963f.tar.gz
themes-c96846b267356994cbce9bf4d923ba621811963f.tar.bz2
themes-c96846b267356994cbce9bf4d923ba621811963f.zip
update icon browser to display currently active icons as well, add entry to menu and move it from themes/admin/ to themes/ to make it more accessible.
-rw-r--r--icon_browser.php (renamed from admin/icon_browser.php)31
-rw-r--r--templates/admin_themes_manager.tpl2
-rw-r--r--templates/icon_browser.tpl29
-rw-r--r--templates/menu_themes_admin.tpl2
4 files changed, 44 insertions, 20 deletions
diff --git a/admin/icon_browser.php b/icon_browser.php
index 7eabf6e..6586f97 100644
--- a/admin/icon_browser.php
+++ b/icon_browser.php
@@ -1,7 +1,9 @@
<?php
-require_once( "../../bit_setup_inc.php" );
+require_once( "../bit_setup_inc.php" );
-$gBitSystem->verifyPermission( 'p_admin' );
+if( !$gBitUser->isRegistered() ) {
+ $gBitSystem->fatalError( "You need to be registered to view this page." );
+}
$iconUsage = array(
"dialog-ok" => "Success / Accept",
@@ -36,15 +38,24 @@ $iconUsage = array(
"dialog-information" => "Information",
);
$gBitSmarty->assign( 'iconUsage', $iconUsage );
+$gBitSmarty->assign( 'defaultIconList', icon_fetcher( THEMES_PKG_PATH."icon_styles/".DEFAULT_ICON_STYLE."/" ));
-$handle = opendir( THEMES_PKG_PATH."icon_styles/tango/large" );
-while( FALSE !== ( $icon = readdir( $handle ))) {
- if( preg_match( "#\.png$#", $icon ) && !preg_match( "#^process-working\.#", $icon )) {
- $iconList[] = str_replace( ".png", "", $icon );
- }
+if( $gBitSystem->isFeatureActive( 'site_icon_style' ) && $gBitSystem->getConfig( 'site_icon_style' ) != DEFAULT_ICON_STYLE ) {
+ $gBitSmarty->assign( 'activeIconList', icon_fetcher( THEMES_PKG_PATH."icon_styles/".$gBitSystem->getConfig( 'site_icon_style' )."/" ));
}
-asort( $iconList );
-$gBitSmarty->assign( 'iconList', $iconList );
-$gBitSystem->display( 'bitpackage:themes/icon_browser.tpl', tra( 'Icon Listing' ) , array( 'display_mode' => 'admin' ));
+$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" );
+ while( FALSE !== ( $icon = readdir( $handle ))) {
+ if( preg_match( "#\.png$#", $icon ) && !preg_match( "#^process-working\.#", $icon )) {
+ $ret[str_replace( ".png", "", $icon )] = str_replace( ".png", "", $icon );
+ }
+ }
+ }
+ asort( $ret );
+ return $ret;
+}
?>
diff --git a/templates/admin_themes_manager.tpl b/templates/admin_themes_manager.tpl
index a0e848c..d837278 100644
--- a/templates/admin_themes_manager.tpl
+++ b/templates/admin_themes_manager.tpl
@@ -90,7 +90,7 @@
Icon themes can be downloaded from <a class="external" href="http://art.gnome.org/themes/icon/">Gnome</a> or <a class="external" href="http://www.kde-look.org/?xcontentmode=27">KDE</a> as long as they adhere to the <a class="external" href="http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html">Icon Naming Specifications</a>. For more information, please visit <a class="external" href="http://www.bitweaver.org/wiki/IconStyles">IconStyles</a>.
</p>
<p class="help">
- If you are a developer and you want to view a list of available icons, you can do this with the {smartlink ititle="Icon Browser" ifile="admin/icon_browser.php"}.
+ If you are a developer and you want to view a list of available icons, you can do this with the {smartlink ititle="Icon Browser" ifile="icon_browser.php"}.
</p>
<ul class="data">
diff --git a/templates/icon_browser.tpl b/templates/icon_browser.tpl
index c8b3f28..6ebe7b2 100644
--- a/templates/icon_browser.tpl
+++ b/templates/icon_browser.tpl
@@ -6,21 +6,20 @@
<div class="body">
<p class="help">
- These are the icons available in a standard set of icons. Icons from the Tango icon style are displayed here since this is the default style and should be used as refernce.
- Both sizes <em>large</em> and <em>small</em> are displayed side by side.
- <br />
- Missing icons haven't been submitted by the tango team yet - they will however be added as they become available.
- <br />
+ These are the icons available in a standard set of icons. Icons from the Tango icon style are displayed here since this is the default style and should be used as refernce. Both sizes <em>large</em> and <em>small</em> are displayed side by side.<br />
Please view the <a class="external" href="http://tango.freedesktop.org/Tango_Icon_Gallery">Tango icon gallery</a> for the originally designated uses of the icons.
</p>
<table class="data">
<tr>
- <th style="width:1%;" colspan="2">{tr}Icons{/tr}</th>
+ <th style="width:1%;" colspan="2">{tr}Default Icons{/tr}</th>
+ {if $activeIconList}
+ <th style="width:1%;" colspan="2">{tr}Active Icons{/tr}</th>
+ {/if}
<th style="width:70%;">{tr}Icon name{/tr}</th>
<th style="width:29%;">{tr}bitweaver uses{/tr}</th>
</tr>
- {foreach from=$iconList item=icon}
+ {foreach from=$defaultIconList item=icon}
<tr class="{cycle values="odd,even"}">
<td>
{* avoid translation here by not using iexplain *}
@@ -29,9 +28,23 @@
<td>
{biticon istyle=tango ipackage=icons iname="large/$icon"}
</td>
+ {if $activeIconList}
+ {if $activeIconList.$icon}
+ <td>
+ {* avoid translation here by not using iexplain *}
+ {biticon ipackage=icons iname="small/$icon"}
+ </td>
+ <td>
+ {biticon ipackage=icons iname="large/$icon"}
+ </td>
+ {else}
+ <td></td>
+ <td></td>
+ {/if}
+ {/if}
<td>
{$icon}<br />
- <small>{ldelim}biticon ipackage="icons" iname="{$icon}" iexplain="Help"{rdelim}</small>
+ <small>{ldelim}biticon ipackage="icons" iname="{$icon}" iexplain="Icon"{rdelim}</small>
</td>
<td>
{foreach from=$iconUsage key=ucon item=usage}
diff --git a/templates/menu_themes_admin.tpl b/templates/menu_themes_admin.tpl
index 27c682a..7b5e911 100644
--- a/templates/menu_themes_admin.tpl
+++ b/templates/menu_themes_admin.tpl
@@ -2,11 +2,11 @@
<ul>
<li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=themes" >{tr}Theme Settings{/tr}</a></li>
<li><a class="item" href="{$smarty.const.THEMES_PKG_URL}admin/admin_themes_manager.php">{tr}Themes Manager{/tr}</a></li>
+ <li><a class="item" href="{$smarty.const.THEMES_PKG_URL}icon_browser.php">{tr}Icon Browser{/tr}</a></li>
<li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=columns" >{tr}Column Control{/tr}</a></li>
<li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=layout" >{tr}Manage Layouts{/tr}</a></li>
<li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=layout_overview" >{tr}Configure Layout Options{/tr}</a></li>
<li><a class="item" href="{$smarty.const.THEMES_PKG_URL}admin/menus.php">{tr}Menus{/tr}</a></li>
- {* <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=modules">{tr}Module Settings{/tr}</a></li> *}
<li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=custom_modules">{tr}Custom Modules{/tr}</a></li>
</ul>
{/strip}