FIX The thumb of user into top menu was using the image in full size.
This make a large download at each page call. We must use the mini thumbs.
This commit is contained in:
parent
b49d63c12f
commit
d7761ece58
@ -5258,7 +5258,7 @@ class Form
|
||||
* @param int $addlinktofullsize Add link to fullsize image
|
||||
* @return string HTML code to output photo
|
||||
*/
|
||||
static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='',$addlinktofullsize=1)
|
||||
static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@ -5294,7 +5294,6 @@ class Form
|
||||
$dir=$conf->user->dir_output;
|
||||
if (! empty($object->photo))
|
||||
{
|
||||
//var_dump(getImageFileNameForSize($object->photo, '_mini'));
|
||||
if ($imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini');
|
||||
else if ($imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small');
|
||||
else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
|
||||
|
||||
@ -1825,14 +1825,15 @@ class User extends CommonObject
|
||||
* @param int $width Width of image
|
||||
* @param int $height Height of image
|
||||
* @param string $cssclass Force a css class
|
||||
* @param string $imagesize 'mini', 'small' or '' (original)
|
||||
* @return string String with URL link
|
||||
*/
|
||||
function getPhotoUrl($width, $height, $cssclass='')
|
||||
function getPhotoUrl($width, $height, $cssclass='', $imagesize='')
|
||||
{
|
||||
$result='';
|
||||
|
||||
$result.='<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">';
|
||||
$result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass);
|
||||
$result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize);
|
||||
$result.='</a>';
|
||||
|
||||
return $result;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user