You are here

function getlocations_get_term_marker in Get Locations 7

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

Function

Return value

Returns

8 calls to getlocations_get_term_marker()
getlocations_fields_field_formatter_view in modules/getlocations_fields/getlocations_fields.module
Implements hook_field_formatter_view(). Build a renderable array for a field value.
getlocations_leaflet_entity_type_map in modules/getlocations_leaflet/getlocations_leaflet.module
Function
getlocations_mapquest_entity_type_map in modules/getlocations_mapquest/getlocations_mapquest.module
Function
getlocations_nodemap in ./getlocations.module
Page callback: displays a map.
getlocations_search_info_sql in modules/getlocations_search/getlocations_search.module

... See full list

File

./getlocations.module, line 6572
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;
}