X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=templates%2Futil_global.php;h=56c832c20c4c9a0b0fb751fc25f63f3258f1316c;hb=1ce4618201e0e72e5c15be37d25ad3900c8247ca;hp=9969c2f66a34fb8130d206111537959dd53fe1a4;hpb=74db4ed2c6385a69757dd1abde054bd22e696628;p=squirrelmail.git diff --git a/templates/util_global.php b/templates/util_global.php index 9969c2f6..56c832c2 100644 --- a/templates/util_global.php +++ b/templates/util_global.php @@ -61,7 +61,7 @@ function getIcon($icon_theme_path, $icon_name, $text_icon, $alt_text='', $w=NULL * @since 1.5.2 */ function getIconPath ($icon_theme_path, $icon_name) { - global $icon_theme_def; + global $fallback_icon_theme_path; if (is_null($icon_theme_path)) return NULL; @@ -70,9 +70,9 @@ function getIconPath ($icon_theme_path, $icon_name) { if (is_file($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, check for the admin-specified fallback + } elseif (!is_null($fallback_icon_theme_path) && is_file($fallback_icon_theme_path . $icon_name)) { + return $fallback_icon_theme_path . $icon_name; // Icon not found, return the SQM default icon } elseif (is_file(SM_PATH . 'images/themes/default/'.$icon_name)) { @@ -91,5 +91,19 @@ function getIconPath ($icon_theme_path, $icon_name) { function displayErrors () { global $oErrorHandler; - $oErrorHandler->displayErrors(); + if ($oErrorHandler) { + $oErrorHandler->displayErrors(); + } +} + +/** + * Make the internal show_readable_size() function available to templates. + * + * @param int size to be converted to human-readable + * @return string human-readable form + * @since 1.5.2 + **/ +function humanReadableSize ($size) { + return show_readable_size($size); } +