You are here

function device_geolocation_block in Smart IP 6

Same name and namespace in other branches
  1. 6.2 modules/device_geolocation/device_geolocation.module \device_geolocation_block()

Implements hook_block()

File

modules/device_geolocation/device_geolocation.module, line 35
Provides visitor's geographical location using client device location source that implements W3C Geolocation API and Google Geocoding service.

Code

function device_geolocation_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks[0]['info'] = t("Visitor's geolocation");
      $blocks[0]['cache'] = BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE;
      return $blocks;
    case 'view':
      $blocks['subject'] = t('Your Geolocation Details');
      $blocks['content'] = device_geolocation_contents();
      return $blocks;
  }
}