From 4137e92430ff224d2215dab4c0ad3345205bb283 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 15 Sep 2020 03:42:35 +0200 Subject: [PATCH 1/2] Time to enable fontawesome icons on weather feature --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/theme/eldy/info-box.inc.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 18e6d4eb73d..9fd75917372 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3268,7 +3268,7 @@ function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $mo if (is_numeric($picto)) { $leveltopicto = array(0=>'weather-clear.png', 1=>'weather-few-clouds.png', 2=>'weather-clouds.png', 3=>'weather-many-clouds.png', 4=>'weather-storm.png'); - //return ''; + return ''; $picto = $leveltopicto[$picto]; } elseif (!preg_match('/(\.png|\.gif)$/i', $picto)) $picto .= '.png'; diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 8146bb2c563..4bc6a6595fc 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -379,19 +379,19 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO = } .fa-weather-level0:before{ content: "\f185"; - color : #cccccc; + color : #ffbf00; } .fa-weather-level1:before{ content: "\f6c4"; - color : #cccccc; + color : #b0b0b0; } .fa-weather-level2:before{ content: "\f0c2"; - color : #cccccc; + color : #9b9b9b; } .fa-weather-level3:before{ content: "\f740"; - color : #cccccc; + color : #888888; } .fa-weather-level4:before{ content: "\f0e7"; From 3fd041e861dcbcc65f6c35eccd6512f155b96011 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Sep 2020 11:28:49 +0200 Subject: [PATCH 2/2] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9fd75917372..7f32a9e0c31 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3265,12 +3265,13 @@ function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $mo { global $conf; - if (is_numeric($picto)) - { - $leveltopicto = array(0=>'weather-clear.png', 1=>'weather-few-clouds.png', 2=>'weather-clouds.png', 3=>'weather-many-clouds.png', 4=>'weather-storm.png'); + if (is_numeric($picto)) { + //$leveltopicto = array(0=>'weather-clear.png', 1=>'weather-few-clouds.png', 2=>'weather-clouds.png', 3=>'weather-many-clouds.png', 4=>'weather-storm.png'); + //$picto = $leveltopicto[$picto]; return ''; - $picto = $leveltopicto[$picto]; - } elseif (!preg_match('/(\.png|\.gif)$/i', $picto)) $picto .= '.png'; + } elseif (!preg_match('/(\.png|\.gif)$/i', $picto)) { + $picto .= '.png'; + } $path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto;