function yr_verdata_forecastbox in Yr Weatherdata 6.2
Same name and namespace in other branches
- 7 yr_verdata.module \yr_verdata_forecastbox()
Function for generating the html tags for one box with forecast for a period.
Parameters
$item: The period item with all required and pre-processed forecast data.
Return value
Returns an array to be used in a render array for output.
2 calls to yr_verdata_forecastbox()
- theme_yr_verdata_forecast in ./
yr_verdata.module - Theme function for displaying the forecast for a location on that location's main forecast page. Caching is done for the whole page, so we don't need to do it here.
- theme_yr_verdata_information in ./
yr_verdata.module - Theme function for displaying the location information about a location on that location's main forecast page. Caching is done for the whole page, so we don't need to do it here.
File
- ./
yr_verdata.module, line 635 - yr_verdata.module This file contains the code for getting the forecast from yr.no and displaying it on a Drupal site.
Code
function yr_verdata_forecastbox($item) {
$output = '<div class="yr-forecast-box">';
$output .= '<p class="yr-period-time">' . $item['time'] . '</p>';
$output .= '<div class="yr-period-forecast">';
$output .= '<p class="yr-symbols">';
$output .= '<span class="yr-symbol">' . $item['symbol'] . '</span>';
$output .= '<span class="yr-wind">' . $item['wind'] . '</span>';
$output .= $item['temp'];
$output .= '</p>';
$output .= '<p class="yr-precip">' . $item['precip'] . '</p>';
$output .= '<p class="yr-pressure">' . $item['pressure'] . '</p>';
$output .= '</div>';
$output .= '</div>';
return $output;
}