You are here

function _weather_format_visibility in Weather 5

Same name and namespace in other branches
  1. 5.6 weather.module \_weather_format_visibility()
  2. 6.5 weather.module \_weather_format_visibility()

Convert the visibility

1 call to _weather_format_visibility()
theme_weather in ./weather.module
Custom theme function for the weather block output

File

./weather.module, line 848
Display <acronym title="METeorological Aerodrome Report">METAR</acronym> weather data from anywhere in the world

Code

function _weather_format_visibility($visibility, $unit) {
  if (!isset($visibility['kilometers'])) {
    return t('No data');
  }
  if ($unit == 'imperial') {
    return t('!visibility miles', array(
      '!visibility' => $visibility['miles'],
    ));
  }
  else {

    // default to metric units
    return t('!visibility kilometers', array(
      '!visibility' => $visibility['kilometers'],
    ));
  }
}