function _weather_format_visibility in Weather 6.5
Same name and namespace in other branches
- 5.6 weather.module \_weather_format_visibility()
- 5 weather.module \_weather_format_visibility()
Convert the visibility
1 call to _weather_format_visibility()
- theme_weather_theming in ./
weather.module - Custom theme function for preprocessing the weather block output
File
- ./
weather.module, line 1776 - Display <acronym title="METeorological Aerodrome Report">METAR</acronym> weather data from anywhere in the world
Code
function _weather_format_visibility($visibility, $unit) {
if ($unit['visibility'] == 'miles') {
$result = t('!visibility mi', array(
'!visibility' => $visibility['miles'],
));
}
else {
// default to metric units
$result = t('!visibility km', array(
'!visibility' => $visibility['kilometers'],
));
}
return preg_replace("/([^ ]*) ([^ ]*)/", '<span style="white-space:nowrap;">\\1 \\2</span>', $result);
}