From 0a3b7e79940bbffe556946d0198aab863a8944f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Mar 2013 20:43:28 +0100 Subject: [PATCH] New: Be able to get path of image without tag img --- htdocs/core/lib/functions.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 835e5a36ee1..edc39c6d164 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1640,10 +1640,11 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) * @param string $options Add more attribute on img tag (For example 'style="float: right"') * @param int $pictoisfullpath If 1, image path is a full path + * @param int $srconly Return only content of the src attribute of img. * @return string Return img tag * @see #img_object, #img_picto_common */ -function img_picto($alt, $picto, $options = '', $pictoisfullpath = false) +function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srconly=0) { global $conf; @@ -1678,7 +1679,8 @@ function img_picto($alt, $picto, $options = '', $pictoisfullpath = false) $fullpathpicto = $url.'/'.$path.'/img/'.$picto; } - return ''.dol_escape_htmltag($alt).''; + if ($srconly) return $fullpathpicto; + else return ''.dol_escape_htmltag($alt).''; } /**