You are here

private function ip_geoloc_plugin_style_leaflet::_get_zoom_titles in IP Geolocation Views & Maps 7

1 call to ip_geoloc_plugin_style_leaflet::_get_zoom_titles()
ip_geoloc_plugin_style_leaflet::_add_cluster_differentiator in views/ip_geoloc_plugin_style_leaflet.inc

File

views/ip_geoloc_plugin_style_leaflet.inc, line 1611

Class

ip_geoloc_plugin_style_leaflet

Code

private function _get_zoom_titles($field_type, $label, $region_depth) {
  $titles = array();
  if ($field_type === 'addressfield') {
    $titles[] = t('Zoom range for country');
    $titles[] = t('Zoom range for administrative area (state, district, county)');
    $titles[] = t('Zoom range for locality (city, town, village)');
    $titles[] = t('Zoom range for post code (ZIP)');
    return $titles;
  }
  $pos_colon = strrpos($label, ':');
  $label = drupal_substr($label, $pos_colon > 0 ? $pos_colon + 1 : 0);
  if ($field_type === 'taxonomy_term_reference') {
    for ($level = 1; $level <= $region_depth; $level++) {
      $titles[] = t('Zoom range for %field level @level', array(
        '%field' => $label,
        '@level' => $level,
      ));
    }
  }
  else {
    $titles[] = t('Zoom range for %field', array(
      '%field' => $label,
    ));
  }
  return $titles;
}