Selaa lähdekoodia

Utilize new default icon theme path

stevetruckstuff 19 vuotta sitten
vanhempi
commit
6076183c83
1 muutettua tiedostoa jossa 7 lisäystä ja 2 poistoa
  1. 7 2
      templates/util_global.php

+ 7 - 2
templates/util_global.php

@@ -61,15 +61,20 @@ function getIcon($icon_theme_path, $icon_name, $text_icon, $alt_text='', $w=NULL
  * @since 1.5.2
  * @since 1.5.2
  */
  */
 function getIconPath ($icon_theme_path, $icon_name) {
 function getIconPath ($icon_theme_path, $icon_name) {
+    global $icon_theme_def;
+
     if (is_null($icon_theme_path))
     if (is_null($icon_theme_path))
         return NULL;
         return NULL;
     
     
     // Desired icon exists in the current theme?
     // Desired icon exists in the current theme?
     if (is_file($icon_theme_path . $icon_name)) {
     if (is_file($icon_theme_path . $icon_name)) {
         return $icon_theme_path . $icon_name;
         return $icon_theme_path . $icon_name;
-
+        
+    // Icon not found, check for the admin-specified default
+    } elseif (!is_null($icon_theme_def) && is_file($icon_theme_def . $icon_name)) {
+        return $icon_theme_def . $icon_name;
+        
     // Icon not found, return the SQM default icon
     // Icon not found, return the SQM default icon
-    // TODO: allow admins to change the default icon theme in conf.pl
     } elseif (is_file(SM_PATH . 'images/themes/default/'.$icon_name)) {
     } elseif (is_file(SM_PATH . 'images/themes/default/'.$icon_name)) {
         return SM_PATH . 'images/themes/default/'.$icon_name;
         return SM_PATH . 'images/themes/default/'.$icon_name;
     } 
     }