From 9d26d0fa4d09bdd8289e7592d477628099c6cafa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Oct 2015 21:13:28 +0200 Subject: [PATCH] Restore compatibility with old version --- htdocs/core/class/html.form.class.php | 11 ++++++----- htdocs/user/class/user.class.php | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7b472b2a163..bc26812bd29 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5255,9 +5255,10 @@ class Form * @param int $caneditfield Add edit fields * @param string $cssclass CSS name to use on img for photo * @param int $genericifundef Use a generic image if no image avaiable + * @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', $genericifundef=0) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0,$addlinktofullsize=1) { global $conf,$langs; @@ -5303,15 +5304,15 @@ class Form $cache='0'; if ($file && file_exists($dir."/".$file)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else if ($altfile && file_exists($dir."/".$altfile)) { - $ret.=''; + if ($addlinktofullsize) $ret.=''; $ret.='Photo alt'; - $ret.=''; + if ($addlinktofullsize) $ret.=''; } else { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 2addea47f87..ae985b22be5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1922,7 +1922,7 @@ class User extends CommonObject $paddafterimage=''; if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"'; if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'
'; - else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto').'
'; + else $picto='
'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto',0,0).'
'; $result.=$picto; } if (abs($withpictoimg) != 2)