diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 0a744a047a5..82a56a60f11 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -261,24 +261,24 @@ $text=''; $options='height="60px"'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 534b4f31d86..ce566e6f9eb 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2170,6 +2170,27 @@ function img_object($titlealt, $picto, $options = '', $pictoisfullpath = false) return img_picto($titlealt, 'object_'.$picto, $options, $pictoisfullpath); } +/** + * Show weather picto + * + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @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 $options Add more attribute on img tag + * @param int $pictoisfullpath If 1, image path is a full path + * @return string Return img tag + * @see #img_object, #img_picto + */ +function img_weather($titlealt, $picto, $options = '', $pictoisfullpath = 0) +{ + global $conf; + + if (! preg_match('/(\.png|\.gif)$/i', $picto)) $picto .= '.png'; + + $path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto; + + return img_picto($titlealt, $path, $options, 1); +} + /** * Show picto (generic function) * diff --git a/htdocs/index.php b/htdocs/index.php index 0bb3b41ffb2..af3636f2b99 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -618,10 +618,10 @@ function showWeather($totallate,$text,$options) $level2=$offset+2*$factor; if (! empty($conf->global->MAIN_METEO_LEVEL2)) $level2=$conf->global->MAIN_METEO_LEVEL2; $level3=$offset+3*$factor; if (! empty($conf->global->MAIN_METEO_LEVEL3)) $level3=$conf->global->MAIN_METEO_LEVEL3; - if ($totallate <= $level0) $out.=img_picto_common($text,'weather/weather-clear.png',$options); - if ($totallate > $level0 && $totallate <= $level1) $out.=img_picto_common($text,'weather/weather-few-clouds.png',$options); - if ($totallate > $level1 && $totallate <= $level2) $out.=img_picto_common($text,'weather/weather-clouds.png',$options); - if ($totallate > $level2 && $totallate <= $level3) $out.=img_picto_common($text,'weather/weather-many-clouds.png',$options); - if ($totallate > $level3) $out.=img_picto_common($text,'weather/weather-storm.png',$options); + if ($totallate <= $level0) $out.=img_weather($text,'weather-clear.png',$options); + if ($totallate > $level0 && $totallate <= $level1) $out.=img_weather($text,'weather-few-clouds.png',$options); + if ($totallate > $level1 && $totallate <= $level2) $out.=img_weather($text,'weather-clouds.png',$options); + if ($totallate > $level2 && $totallate <= $level3) $out.=img_weather($text,'weather-many-clouds.png',$options); + if ($totallate > $level3) $out.=img_weather($text,'weather-storm.png',$options); return $out; } diff --git a/htdocs/theme/common/weather/index.html b/htdocs/theme/eldy/img/weather/index.html similarity index 100% rename from htdocs/theme/common/weather/index.html rename to htdocs/theme/eldy/img/weather/index.html diff --git a/htdocs/theme/common/weather/weather-clear-night.png b/htdocs/theme/eldy/img/weather/weather-clear-night.png similarity index 100% rename from htdocs/theme/common/weather/weather-clear-night.png rename to htdocs/theme/eldy/img/weather/weather-clear-night.png diff --git a/htdocs/theme/common/weather/weather-clear.png b/htdocs/theme/eldy/img/weather/weather-clear.png similarity index 100% rename from htdocs/theme/common/weather/weather-clear.png rename to htdocs/theme/eldy/img/weather/weather-clear.png diff --git a/htdocs/theme/common/weather/weather-clouds-night.png b/htdocs/theme/eldy/img/weather/weather-clouds-night.png similarity index 100% rename from htdocs/theme/common/weather/weather-clouds-night.png rename to htdocs/theme/eldy/img/weather/weather-clouds-night.png diff --git a/htdocs/theme/common/weather/weather-clouds.png b/htdocs/theme/eldy/img/weather/weather-clouds.png similarity index 100% rename from htdocs/theme/common/weather/weather-clouds.png rename to htdocs/theme/eldy/img/weather/weather-clouds.png diff --git a/htdocs/theme/common/weather/weather-few-clouds-night.png b/htdocs/theme/eldy/img/weather/weather-few-clouds-night.png similarity index 100% rename from htdocs/theme/common/weather/weather-few-clouds-night.png rename to htdocs/theme/eldy/img/weather/weather-few-clouds-night.png diff --git a/htdocs/theme/common/weather/weather-few-clouds.png b/htdocs/theme/eldy/img/weather/weather-few-clouds.png similarity index 100% rename from htdocs/theme/common/weather/weather-few-clouds.png rename to htdocs/theme/eldy/img/weather/weather-few-clouds.png diff --git a/htdocs/theme/common/weather/weather-freezing-rain.png b/htdocs/theme/eldy/img/weather/weather-freezing-rain.png similarity index 100% rename from htdocs/theme/common/weather/weather-freezing-rain.png rename to htdocs/theme/eldy/img/weather/weather-freezing-rain.png diff --git a/htdocs/theme/common/weather/weather-hail.png b/htdocs/theme/eldy/img/weather/weather-hail.png similarity index 100% rename from htdocs/theme/common/weather/weather-hail.png rename to htdocs/theme/eldy/img/weather/weather-hail.png diff --git a/htdocs/theme/common/weather/weather-many-clouds.png b/htdocs/theme/eldy/img/weather/weather-many-clouds.png similarity index 100% rename from htdocs/theme/common/weather/weather-many-clouds.png rename to htdocs/theme/eldy/img/weather/weather-many-clouds.png diff --git a/htdocs/theme/common/weather/weather-mist.png b/htdocs/theme/eldy/img/weather/weather-mist.png similarity index 100% rename from htdocs/theme/common/weather/weather-mist.png rename to htdocs/theme/eldy/img/weather/weather-mist.png diff --git a/htdocs/theme/common/weather/weather-showers-day.png b/htdocs/theme/eldy/img/weather/weather-showers-day.png similarity index 100% rename from htdocs/theme/common/weather/weather-showers-day.png rename to htdocs/theme/eldy/img/weather/weather-showers-day.png diff --git a/htdocs/theme/common/weather/weather-showers-night.png b/htdocs/theme/eldy/img/weather/weather-showers-night.png similarity index 100% rename from htdocs/theme/common/weather/weather-showers-night.png rename to htdocs/theme/eldy/img/weather/weather-showers-night.png diff --git a/htdocs/theme/common/weather/weather-showers-scattered-day.png b/htdocs/theme/eldy/img/weather/weather-showers-scattered-day.png similarity index 100% rename from htdocs/theme/common/weather/weather-showers-scattered-day.png rename to htdocs/theme/eldy/img/weather/weather-showers-scattered-day.png diff --git a/htdocs/theme/common/weather/weather-showers-scattered-night.png b/htdocs/theme/eldy/img/weather/weather-showers-scattered-night.png similarity index 100% rename from htdocs/theme/common/weather/weather-showers-scattered-night.png rename to htdocs/theme/eldy/img/weather/weather-showers-scattered-night.png diff --git a/htdocs/theme/common/weather/weather-showers-scattered.png b/htdocs/theme/eldy/img/weather/weather-showers-scattered.png similarity index 100% rename from htdocs/theme/common/weather/weather-showers-scattered.png rename to htdocs/theme/eldy/img/weather/weather-showers-scattered.png diff --git a/htdocs/theme/common/weather/weather-showers.png b/htdocs/theme/eldy/img/weather/weather-showers.png similarity index 100% rename from htdocs/theme/common/weather/weather-showers.png rename to htdocs/theme/eldy/img/weather/weather-showers.png diff --git a/htdocs/theme/common/weather/weather-snow-rain.png b/htdocs/theme/eldy/img/weather/weather-snow-rain.png similarity index 100% rename from htdocs/theme/common/weather/weather-snow-rain.png rename to htdocs/theme/eldy/img/weather/weather-snow-rain.png diff --git a/htdocs/theme/common/weather/weather-snow-scattered-day.png b/htdocs/theme/eldy/img/weather/weather-snow-scattered-day.png similarity index 100% rename from htdocs/theme/common/weather/weather-snow-scattered-day.png rename to htdocs/theme/eldy/img/weather/weather-snow-scattered-day.png diff --git a/htdocs/theme/common/weather/weather-snow-scattered-night.png b/htdocs/theme/eldy/img/weather/weather-snow-scattered-night.png similarity index 100% rename from htdocs/theme/common/weather/weather-snow-scattered-night.png rename to htdocs/theme/eldy/img/weather/weather-snow-scattered-night.png diff --git a/htdocs/theme/common/weather/weather-snow-scattered.png b/htdocs/theme/eldy/img/weather/weather-snow-scattered.png similarity index 100% rename from htdocs/theme/common/weather/weather-snow-scattered.png rename to htdocs/theme/eldy/img/weather/weather-snow-scattered.png diff --git a/htdocs/theme/common/weather/weather-snow.png b/htdocs/theme/eldy/img/weather/weather-snow.png similarity index 100% rename from htdocs/theme/common/weather/weather-snow.png rename to htdocs/theme/eldy/img/weather/weather-snow.png diff --git a/htdocs/theme/common/weather/weather-storm-day.png b/htdocs/theme/eldy/img/weather/weather-storm-day.png similarity index 100% rename from htdocs/theme/common/weather/weather-storm-day.png rename to htdocs/theme/eldy/img/weather/weather-storm-day.png diff --git a/htdocs/theme/common/weather/weather-storm-night.png b/htdocs/theme/eldy/img/weather/weather-storm-night.png similarity index 100% rename from htdocs/theme/common/weather/weather-storm-night.png rename to htdocs/theme/eldy/img/weather/weather-storm-night.png diff --git a/htdocs/theme/common/weather/weather-storm.png b/htdocs/theme/eldy/img/weather/weather-storm.png similarity index 100% rename from htdocs/theme/common/weather/weather-storm.png rename to htdocs/theme/eldy/img/weather/weather-storm.png diff --git a/htdocs/theme/md/img/weather/index.html b/htdocs/theme/md/img/weather/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/md/img/weather/weather-clear-night.png b/htdocs/theme/md/img/weather/weather-clear-night.png new file mode 100644 index 00000000000..9407b2b4f01 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-clear-night.png differ diff --git a/htdocs/theme/md/img/weather/weather-clear.png b/htdocs/theme/md/img/weather/weather-clear.png new file mode 100644 index 00000000000..8b5c71297be Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-clear.png differ diff --git a/htdocs/theme/md/img/weather/weather-clouds-night.png b/htdocs/theme/md/img/weather/weather-clouds-night.png new file mode 100644 index 00000000000..85dc1b8db34 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-clouds-night.png differ diff --git a/htdocs/theme/md/img/weather/weather-clouds.png b/htdocs/theme/md/img/weather/weather-clouds.png new file mode 100644 index 00000000000..e9156874f0b Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-clouds.png differ diff --git a/htdocs/theme/md/img/weather/weather-few-clouds-night.png b/htdocs/theme/md/img/weather/weather-few-clouds-night.png new file mode 100644 index 00000000000..1bf2322a35b Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-few-clouds-night.png differ diff --git a/htdocs/theme/md/img/weather/weather-few-clouds.png b/htdocs/theme/md/img/weather/weather-few-clouds.png new file mode 100644 index 00000000000..2818985f477 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-few-clouds.png differ diff --git a/htdocs/theme/md/img/weather/weather-freezing-rain.png b/htdocs/theme/md/img/weather/weather-freezing-rain.png new file mode 100644 index 00000000000..87eceb70117 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-freezing-rain.png differ diff --git a/htdocs/theme/md/img/weather/weather-hail.png b/htdocs/theme/md/img/weather/weather-hail.png new file mode 100644 index 00000000000..e3529c231f7 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-hail.png differ diff --git a/htdocs/theme/md/img/weather/weather-many-clouds.png b/htdocs/theme/md/img/weather/weather-many-clouds.png new file mode 100644 index 00000000000..53e1db6fb32 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-many-clouds.png differ diff --git a/htdocs/theme/md/img/weather/weather-mist.png b/htdocs/theme/md/img/weather/weather-mist.png new file mode 100644 index 00000000000..5428e115956 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-mist.png differ diff --git a/htdocs/theme/md/img/weather/weather-showers-day.png b/htdocs/theme/md/img/weather/weather-showers-day.png new file mode 100644 index 00000000000..1c53bf3e1b1 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-showers-day.png differ diff --git a/htdocs/theme/md/img/weather/weather-showers-night.png b/htdocs/theme/md/img/weather/weather-showers-night.png new file mode 100644 index 00000000000..2a794fbc482 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-showers-night.png differ diff --git a/htdocs/theme/md/img/weather/weather-showers-scattered-day.png b/htdocs/theme/md/img/weather/weather-showers-scattered-day.png new file mode 100644 index 00000000000..96a574f6805 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-showers-scattered-day.png differ diff --git a/htdocs/theme/md/img/weather/weather-showers-scattered-night.png b/htdocs/theme/md/img/weather/weather-showers-scattered-night.png new file mode 100644 index 00000000000..2cf3dd242e0 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-showers-scattered-night.png differ diff --git a/htdocs/theme/md/img/weather/weather-showers-scattered.png b/htdocs/theme/md/img/weather/weather-showers-scattered.png new file mode 100644 index 00000000000..f66251cb034 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-showers-scattered.png differ diff --git a/htdocs/theme/md/img/weather/weather-showers.png b/htdocs/theme/md/img/weather/weather-showers.png new file mode 100644 index 00000000000..8e7eb470bdd Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-showers.png differ diff --git a/htdocs/theme/md/img/weather/weather-snow-rain.png b/htdocs/theme/md/img/weather/weather-snow-rain.png new file mode 100644 index 00000000000..a17abce95ab Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-snow-rain.png differ diff --git a/htdocs/theme/md/img/weather/weather-snow-scattered-day.png b/htdocs/theme/md/img/weather/weather-snow-scattered-day.png new file mode 100644 index 00000000000..af7c14b7a86 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-snow-scattered-day.png differ diff --git a/htdocs/theme/md/img/weather/weather-snow-scattered-night.png b/htdocs/theme/md/img/weather/weather-snow-scattered-night.png new file mode 100644 index 00000000000..e77c698d6ed Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-snow-scattered-night.png differ diff --git a/htdocs/theme/md/img/weather/weather-snow-scattered.png b/htdocs/theme/md/img/weather/weather-snow-scattered.png new file mode 100644 index 00000000000..bbe45aafb0e Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-snow-scattered.png differ diff --git a/htdocs/theme/md/img/weather/weather-snow.png b/htdocs/theme/md/img/weather/weather-snow.png new file mode 100644 index 00000000000..9221ad9dbce Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-snow.png differ diff --git a/htdocs/theme/md/img/weather/weather-storm-day.png b/htdocs/theme/md/img/weather/weather-storm-day.png new file mode 100644 index 00000000000..f744587bcf6 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-storm-day.png differ diff --git a/htdocs/theme/md/img/weather/weather-storm-night.png b/htdocs/theme/md/img/weather/weather-storm-night.png new file mode 100644 index 00000000000..98f8f31e524 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-storm-night.png differ diff --git a/htdocs/theme/md/img/weather/weather-storm.png b/htdocs/theme/md/img/weather/weather-storm.png new file mode 100644 index 00000000000..2b0defa75b2 Binary files /dev/null and b/htdocs/theme/md/img/weather/weather-storm.png differ
'; -print img_picto_common($text,'weather/weather-clear.png',$options); +print img_weather($text,'weather-clear.png',$options); print '= '.$level0.'         '; -print img_picto_common($text,'weather/weather-few-clouds.png',$options); +print img_weather($text,'weather-few-clouds.png',$options); print '<= '.$level1.'         '; -print img_picto_common($text,'weather/weather-clouds.png',$options); +print img_weather($text,'weather-clouds.png',$options); print '<= '.$level2.'
'; -print img_picto_common($text,'weather/weather-many-clouds.png',$options); +print img_weather($text,'weather-many-clouds.png',$options); print '<= '.$level3.'         '; -print img_picto_common($text,'weather/weather-storm.png',$options); +print img_weather($text,'weather-storm.png',$options); print '> '.$level3.'