You are here

function _ip_geoloc_plugin_style_decorate in IP Geolocation Views & Maps 7

Same name and namespace in other branches
  1. 8 src/Plugin/views/style/ip_geoloc_plugin_style.inc \_ip_geoloc_plugin_style_decorate()
1 call to _ip_geoloc_plugin_style_decorate()
ip_geoloc_plugin_style_extract_locations in views/ip_geoloc_plugin_style.inc
Extract an array of locations from the supplied views_plugin_style.

File

views/ip_geoloc_plugin_style.inc, line 1210
ip_geoloc_plugin_style.inc

Code

function _ip_geoloc_plugin_style_decorate(&$location, $row, $tooltip_field, $tag_field) {
  if ($tooltip_field) {
    $tooltip = $tooltip_field
      ->theme($row);
    $location->marker_tooltip = strip_tags(_ip_geoloc_plugin_style_add_label($tooltip_field, $tooltip));
  }
  if ($tag_field) {
    $tag = $tag_field
      ->theme($row);
    $location->marker_tag = _ip_geoloc_plugin_style_add_label_and_styling($tag_field, $tag);
  }
  if (isset($row->id)) {

    // CiviCRM [#2549825]
    $location->id = $row->id;
  }
  elseif (isset($row->nid)) {
    $location->id = $row->nid;
  }
  elseif (isset($row->tid)) {
    $location->id = $row->tid;
  }
  elseif (isset($row->uid)) {
    $location->id = $row->uid;
  }
  elseif (isset($row->entity) && is_numeric($row->entity)) {
    $location->id = $row->entity;
  }
  elseif (isset($row->entity->nid) && is_numeric($row->entity->nid)) {
    $location->id = $row->entity->nid;
  }
}