You are here

function smart_ip_views_bridge_handler_field_region::render in Smart IP 7.2

Same name and namespace in other branches
  1. 6.2 modules/smart_ip_views_bridge/views/smart_ip_views_bridge_handler_field_region.inc \smart_ip_views_bridge_handler_field_region::render()
  2. 6 modules/smart_ip_views_bridge/views/smart_ip_views_bridge_handler_field_region.inc \smart_ip_views_bridge_handler_field_region::render()

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

modules/smart_ip_views_bridge/views/smart_ip_views_bridge_handler_field_region.inc, line 38
Contains the 'smart_ip_views_bridge_handler_field_region' field handler.

Class

smart_ip_views_bridge_handler_field_region
Field handler to display visitor's region.

Code

function render($values) {
  $smart_ip_session = smart_ip_session_get('smart_ip');
  $region = '';
  $region_code = '';
  if (!empty($smart_ip_session['location']['region'])) {
    $region = $smart_ip_session['location']['region'];
  }
  if (!empty($smart_ip_session['location']['region_code'])) {
    $region_code = $smart_ip_session['location']['region_code'];
  }
  if ($this->options['style'] == 'name') {
    return $region;
  }
  else {
    return $region_code;
  }
}