forked from Wavyzz/dolibarr
NEW Gain space by moving the meteo on title line
This commit is contained in:
@@ -2969,6 +2969,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
$picto .= '.png';
|
||||
}
|
||||
$fullpathpicto = $picto;
|
||||
$reg=array();
|
||||
if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) {
|
||||
$morecss .= ($morecss ? ' ' : '') . $reg[1];
|
||||
$moreatt = str_replace('class="'.$reg[1].'"', '', $moreatt);
|
||||
}
|
||||
} else {
|
||||
$pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
|
||||
|
||||
@@ -3152,7 +3157,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
return $fullpathpicto;
|
||||
}
|
||||
// tag title is used for tooltip on <a>, tag alt can be used with very simple text on image for blind people
|
||||
return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($titlealt))?'':' title="'.dol_escape_htmltag($titlealt).'"').($moreatt?' '.$moreatt:' class="inline-block'.($morecss?' '.$morecss:'').'"').'>'; // Alt is used for accessibility, title for popup
|
||||
return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.(($notitle || empty($titlealt))?'':' title="'.dol_escape_htmltag($titlealt).'"').($moreatt?' '.$moreatt.($morecss?' class="'.$morecss.'"':''):' class="inline-block'.($morecss?' '.$morecss:'').'"').'>'; // Alt is used for accessibility, title for popup
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3180,10 +3185,11 @@ function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false,
|
||||
* @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
|
||||
* @param string $moreatt Add more attribute on img tag
|
||||
* @param int $pictoisfullpath If 1, image path is a full path
|
||||
* @param string $morecss More CSS
|
||||
* @return string Return img tag
|
||||
* @see #img_object, #img_picto
|
||||
*/
|
||||
function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0)
|
||||
function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $morecss = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -3191,7 +3197,7 @@ function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0)
|
||||
|
||||
$path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto;
|
||||
|
||||
return img_picto($titlealt, $path, $moreatt, 1);
|
||||
return img_picto($titlealt, $path, $moreatt, 1, 0, 0, '', $morecss);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user