You are here

function getlocations_get_term_marker in Get Locations 7.2

Same name and namespace in other branches
  1. 7 getlocations.module \getlocations_get_term_marker()

Function

Return value

Returns

3 calls to getlocations_get_term_marker()
getlocations_leaflet_entity_type_map in modules/getlocations_leaflet/getlocations_leaflet.module
getlocations_mapquest_entity_type_map in modules/getlocations_mapquest/getlocations_mapquest.module
Function
getlocations_search_load_all_locations in modules/getlocations_search/getlocations_search.module

File

./getlocations.module, line 6262
getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_get_term_marker($nid, $marker) {
  $getlocations_defaults = getlocations_defaults();

  // term markers
  $getlocations_term_marker = variable_get('getlocations_term_marker', array(
    'enable' => 0,
    'vids' => 0,
    'max_depth' => '',
  ));
  if ($getlocations_term_marker['enable'] && $getlocations_term_marker['vids']) {
    $vids = $getlocations_term_marker['vids'];
    foreach ($vids as $vid) {
      $results = db_query('SELECT i.tid FROM {taxonomy_index} i JOIN {taxonomy_term_data} d ON i.tid=d.tid WHERE i.nid = :nid AND d.vid =:vid', array(
        ':nid' => $nid,
        ':vid' => $vid,
      ));
      $record = $results
        ->fetchObject();
      if ($record) {
        $marker = isset($getlocations_term_marker['vid'][$vid]['term'][$record->tid]['map_marker']) ? $getlocations_term_marker['vid'][$vid]['term'][$record->tid]['map_marker'] : $getlocations_defaults['term_map_marker'];
      }
    }
  }
  return $marker;
}