You are here

function theme_yr_verdata_radar in Yr Weatherdata 7

Same name and namespace in other branches
  1. 6.2 yr_verdata.module \theme_yr_verdata_radar()

Theme function for displaying the radarimage 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.

Parameters

$radar: An array with the processed radar information for this location.

Return value

Returns themed output with a radarimage for this location, linking to the radarimage page at yr.no.

See also

http://api.yr.no/weatherapi/radar/1.2/documentation

File

./yr_verdata.module, line 864
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_radar($radar) {
  $image = theme('image', array(
    'path' => $radar['url'],
    'alt' => $radar['text'],
    'title' => $radar['text'],
  ));
  $output = array();
  $output['header'] = array(
    '#markup' => '<h3>' . $radar['text'] . '</h3>',
  );
  $output['image'] = array(
    '#markup' => l($image, $radar['link'], array(
      'html' => TRUE,
      'attributes' => array(
        'rel' => 'nofollow',
      ),
    )),
  );
  return drupal_render($output);
}