Fix icon render.

1.10.x
Julio 10 years ago
parent bc736858a5
commit 7dd9ca2e1c
  1. 15
      main/inc/lib/display.lib.php
  2. 1
      main/inc/lib/usermanager.lib.php

@ -738,15 +738,15 @@ class Display
$alternateWebCssPath = api_get_path(WEB_CSS_PATH); $alternateWebCssPath = api_get_path(WEB_CSS_PATH);
$image = trim($image); $image = trim($image);
$size_extra = '';
if (isset($size)) { if (isset($size)) {
$size = intval($size); $size = intval($size);
$size_extra = $size . '/';
} else { } else {
$size = ICON_SIZE_SMALL; $size = ICON_SIZE_SMALL;
} }
$size_extra = $size . '/';
// Checking the img/ folder // Checking the img/ folder
$icon = $w_code_path.'img/'.$image; $icon = $w_code_path.'img/'.$image;
@ -761,6 +761,11 @@ class Display
//Checking the main/img/icons/XXX/ folder //Checking the main/img/icons/XXX/ folder
$icon = $w_code_path.'img/icons/'.$size_extra.$image; $icon = $w_code_path.'img/icons/'.$size_extra.$image;
} }
} else {
if (is_file($code_path.'img/icons/'.$size_extra.$image)) {
// Checking the main/img/icons/XXX/ folder
$icon = $w_code_path.'img/icons/'.$size_extra.$image;
}
} }
// Special code to enable SVG - refs #7359 - Needs more work // Special code to enable SVG - refs #7359 - Needs more work
@ -768,7 +773,7 @@ class Display
// it checks if there is an SVG version. If so, it uses it. // it checks if there is an SVG version. If so, it uses it.
// When moving this to production, the return_icon() calls should // When moving this to production, the return_icon() calls should
// ask for the SVG version directly // ask for the SVG version directly
$testServer = api_get_setting('server_type'); /*$testServer = api_get_setting('server_type');
if ($testServer == 'test' && $return_only_path == false) { if ($testServer == 'test' && $return_only_path == false) {
$svgImage = substr($image, 0, -3) . 'svg'; $svgImage = substr($image, 0, -3) . 'svg';
if (is_file($code_path . $theme . 'svg/' . $svgImage)) { if (is_file($code_path . $theme . 'svg/' . $svgImage)) {
@ -783,7 +788,7 @@ class Display
if (empty($additional_attributes['width'])) { if (empty($additional_attributes['width'])) {
$additional_attributes['width'] = $size; $additional_attributes['width'] = $size;
} }
} }*/
$icon = api_get_cdn_path($icon); $icon = api_get_cdn_path($icon);
@ -793,7 +798,7 @@ class Display
} }
$img = self::img($icon, $alt_text, $additional_attributes); $img = self::img($icon, $alt_text, $additional_attributes);
if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) { if (SHOW_TEXT_NEAR_ICONS == true && !empty($alt_text)) {
if ($show_text) { if ($show_text) {
$img = "$img $alt_text"; $img = "$img $alt_text";
} }

@ -1507,6 +1507,7 @@ class UserManager
} }
$gravatarEnabled = api_get_setting('gravatar_enabled'); $gravatarEnabled = api_get_setting('gravatar_enabled');
$anonymousPath = Display::returnIconPath('unknown.png', $pictureAnonymousSize); $anonymousPath = Display::returnIconPath('unknown.png', $pictureAnonymousSize);
if ($pictureWebFile == 'unknown.jpg' || empty($pictureWebFile)) { if ($pictureWebFile == 'unknown.jpg' || empty($pictureWebFile)) {

Loading…
Cancel
Save