You are here

function smart_ip_views_bridge_handler_field_country::render in Smart IP 6

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

File

modules/smart_ip_views_bridge/views/smart_ip_views_bridge_handler_field_country.inc, line 35
Contains the 'smart_ip_views_bridge_handler_field_country' field handler.

Class

smart_ip_views_bridge_handler_field_country
Field handler to display visitor's country.

Code

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