function wunderground_weather_block_view in Wunderground weather 7
Implements hook_block_view().
File
- ./
wunderground_weather.module, line 174 - Wunderground weather module to display weather forecasts and current weather conditions in blocks.
Code
function wunderground_weather_block_view($delta) {
$block = array();
for ($f = 1; $f <= variable_get('wunderground_weather_block_forecast_amount', '1'); $f++) {
if ($delta == 'wunderground_weather_forecast_' . $f) {
$block['subject'] = t('Weather forecast !amount', array(
'!amount' => $f,
));
$block['content'] = wunderground_weather_get_forecast($f);
}
}
for ($t = 1; $t <= variable_get('wunderground_weather_block_current_amount', '1'); $t++) {
if ($delta == 'wunderground_weather_current_' . $t) {
$block['subject'] = t('Current weather !amount', array(
'!amount' => $t,
));
$block['content'] = wunderground_weather_get_current($t);
}
}
return $block;
}