function theme_yr_verdata_temp in Yr Weatherdata 6.2
Same name and namespace in other branches
- 7 yr_verdata.module \theme_yr_verdata_temp()
Function for generating a themed temperature display.
Parameters
$vars: Array with two keys: unit: The unit the temperature is supplied in from yr.no. value: The value of the temperature in the given unit.
Return value
Returns a themed temperature.
2 theme calls to theme_yr_verdata_temp()
- yr_verdata_generate in ./
yr_verdata.module - Function for generating a forecast for a location. This function should only be called after having checked if there is an up-to-date cache available, as this will load and parse an xml-file, possibly getting it from a remote host first, which is…
- yr_verdata_generate_forecastboxes in ./
yr_verdata.module - Function for generating one or more forecast boxes for given periods.
File
- ./
yr_verdata.module, line 790 - yr_verdata.module This file contains the code for getting the forecast from yr.no and displaying it on a Drupal site.
Code
function theme_yr_verdata_temp($vars) {
$temp_unit = variable_get('yr_verdata_temp_unit', 'celsius');
$tu_shorts = _yr_verdata_tu_shorts();
$temp = _yr_verdata_temperature($vars);
$temperature = '<span class="yr-temp ' . $temp['class'] . '">' . $temp[$temp_unit] . '°' . $tu_shorts[$temp_unit] . '</span>';
return $temperature;
}