summaryrefslogtreecommitdiff
path: root/icon_browser.php
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2025-08-27 15:41:02 +0100
committerlsces <lester@lsces.co.uk>2025-08-27 15:41:02 +0100
commit0e12ec2be3836065ecaa2dbb1c4b5da30501a933 (patch)
tree5852ce7d8ac0e7d2470056a1472944ec0cc99bb9 /icon_browser.php
parent676eee147404699eae27e678f2f5616758773c10 (diff)
downloadthemes-0e12ec2be3836065ecaa2dbb1c4b5da30501a933.tar.gz
themes-0e12ec2be3836065ecaa2dbb1c4b5da30501a933.tar.bz2
themes-0e12ec2be3836065ecaa2dbb1c4b5da30501a933.zip
General tools updated to PHP8.4 and namespace
Diffstat (limited to 'icon_browser.php')
-rwxr-xr-x[-rw-r--r--]icon_browser.php24
1 files changed, 10 insertions, 14 deletions
diff --git a/icon_browser.php b/icon_browser.php
index c878817..0cf4efe 100644..100755
--- a/icon_browser.php
+++ b/icon_browser.php
@@ -13,13 +13,14 @@
/**
* Setup
*/
-require_once( "../kernel/includes/setup_inc.php" );
+use Bitweaver\KernelTools;
+require_once "../kernel/includes/setup_inc.php";
if( !$gBitUser->isRegistered() ) {
$gBitSystem->fatalError( "You need to be registered to view this page." );
}
-$iconUsage = array(
+$iconUsage = [
"dialog-ok" => "Success / Accept",
"document-open" => "Import",
"document-properties" => "Configuration",
@@ -50,16 +51,12 @@ $iconUsage = array(
"folder" => "Folder",
"dialog-error" => "Error",
"dialog-information" => "Information",
-);
+];
$gBitSmarty->assign( 'iconUsage', $iconUsage );
-$iconList = array();
-$iconNames = array();
-if( !empty( $_REQUEST['icon_style'] ) ) {
- $iconThemes = array( $_REQUEST['icon_style'] );
-} else {
- $iconThemes = scandir( CONFIG_PKG_PATH."iconsets/" );
-}
+$iconList = [];
+$iconNames = [];
+$iconThemes = ( !empty( $_REQUEST['icon_style'] ) ) ? [ $_REQUEST['icon_style'] ] : scandir( CONFIG_PKG_PATH . "iconsets/" );
foreach( $iconThemes as $iconStyle ) {
if( $icons = icon_fetcher( $iconStyle ) ) {
@@ -72,15 +69,15 @@ asort( $iconNames );
$gBitSmarty->assign( 'iconNames', $iconNames );
$gBitSmarty->assign( 'iconList', $iconList );
-$gBitSystem->display( 'bitpackage:themes/icon_browser.tpl', tra( 'Icon Listing' ) , array( 'display_mode' => 'display' ));
+$gBitSystem->display( 'bitpackage:themes/icon_browser.tpl', KernelTools::tra( 'Icon Listing' ) , [ 'display_mode' => 'display' ]);
function icon_fetcher( $pStyle = DEFAULT_ICON_STYLE ) {
- $ret = array();
+ $ret = [];
if( strpos( $pStyle, '.' ) !== 0 && $pStyle != 'CVS' ) {
$stylePath = CONFIG_PKG_PATH."iconsets/".$pStyle;
if( is_dir( $stylePath."/large" )) {
$handle = opendir( $stylePath."/large" );
- while( FALSE !== ( $icon = readdir( $handle ))) {
+ while( false !== ( $icon = readdir( $handle ))) {
if( preg_match( "#\.png$#", $icon ) && !preg_match( "#^process-working\.#", $icon )) {
$ret[str_replace( ".png", "", $icon )] = str_replace( ".png", "", $icon );
}
@@ -90,4 +87,3 @@ function icon_fetcher( $pStyle = DEFAULT_ICON_STYLE ) {
ksort( $ret );
return $ret;
}
-?>