Merge pull request #4617 from aspangaro/develop-p5
New: Weather icons depends of the theme
@ -261,24 +261,24 @@ $text=''; $options='height="60px"';
|
||||
print '<table>';
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print img_picto_common($text,'weather/weather-clear.png',$options);
|
||||
print img_weather($text,'weather-clear.png',$options);
|
||||
print '</td><td>= '.$level0.'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td>';
|
||||
print img_picto_common($text,'weather/weather-few-clouds.png',$options);
|
||||
print img_weather($text,'weather-few-clouds.png',$options);
|
||||
print '</td><td><= '.$level1.'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td>';
|
||||
print img_picto_common($text,'weather/weather-clouds.png',$options);
|
||||
print img_weather($text,'weather-clouds.png',$options);
|
||||
print '</td><td><= '.$level2.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>';
|
||||
print img_picto_common($text,'weather/weather-many-clouds.png',$options);
|
||||
print img_weather($text,'weather-many-clouds.png',$options);
|
||||
print '</td><td><= '.$level3.'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td>';
|
||||
print img_picto_common($text,'weather/weather-storm.png',$options);
|
||||
print img_weather($text,'weather-storm.png',$options);
|
||||
print '</td><td>> '.$level3.'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
|
||||
@ -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)
|
||||
*
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
0
htdocs/theme/md/img/weather/index.html
Normal file
BIN
htdocs/theme/md/img/weather/weather-clear-night.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
htdocs/theme/md/img/weather/weather-clear.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
htdocs/theme/md/img/weather/weather-clouds-night.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
htdocs/theme/md/img/weather/weather-clouds.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
htdocs/theme/md/img/weather/weather-few-clouds-night.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
htdocs/theme/md/img/weather/weather-few-clouds.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
htdocs/theme/md/img/weather/weather-freezing-rain.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
htdocs/theme/md/img/weather/weather-hail.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
htdocs/theme/md/img/weather/weather-many-clouds.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
htdocs/theme/md/img/weather/weather-mist.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
htdocs/theme/md/img/weather/weather-showers-day.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
htdocs/theme/md/img/weather/weather-showers-night.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
htdocs/theme/md/img/weather/weather-showers-scattered-day.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
htdocs/theme/md/img/weather/weather-showers-scattered-night.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
htdocs/theme/md/img/weather/weather-showers-scattered.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
htdocs/theme/md/img/weather/weather-showers.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
htdocs/theme/md/img/weather/weather-snow-rain.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
htdocs/theme/md/img/weather/weather-snow-scattered-day.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
htdocs/theme/md/img/weather/weather-snow-scattered-night.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
htdocs/theme/md/img/weather/weather-snow-scattered.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
htdocs/theme/md/img/weather/weather-snow.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
htdocs/theme/md/img/weather/weather-storm-day.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
htdocs/theme/md/img/weather/weather-storm-night.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
htdocs/theme/md/img/weather/weather-storm.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |