You are here

function getlocations_get_type_markers in Get Locations 7.2

Function

Return value

Returns

18 calls to getlocations_get_type_markers()
getlocations_entity_type_map in ./getlocations.module
Page callback: displays a map.
getlocations_fields_field_formatter_settings_form in modules/getlocations_fields/getlocations_fields.module
Implements hook_field_formatter_settings_form(). Returns form elements for a formatter's settings.
getlocations_fields_field_formatter_settings_summary in modules/getlocations_fields/getlocations_fields.module
Implements hook_field_formatter_settings_summary(). Returns a short summary for the current formatter settings of an instance.
getlocations_leaflet_defaults in modules/getlocations_leaflet/getlocations_leaflet.module
getlocations_leaflet_entity_type_map in modules/getlocations_leaflet/getlocations_leaflet.module

... See full list

File

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

Code

function getlocations_get_type_markers($all_entity_types = '') {
  $getlocations_markers = variable_get('getlocations_markers', array());
  if (empty($all_entity_types)) {
    $all_entity_types = getlocations_get_all_entity_types();
  }
  else {
    $all_entity_types = array(
      $all_entity_types,
    );
  }
  $data = array();
  if ($module = getlocations_get_current_supported_module()) {
    foreach ($all_entity_types as $entity_type) {
      $query = db_select('field_config', 'f');
      $query
        ->fields('i', array(
        'bundle',
        'field_name',
      ));
      $query
        ->join('field_config_instance', 'i', 'f.id=i.field_id');
      $query
        ->condition('f.module', $module)
        ->condition('i.entity_type', $entity_type)
        ->condition('f.active', 1);
      $rows = $query
        ->execute();
      foreach ($rows as $row) {
        $entity_get_info = entity_get_info($entity_type);
        if (isset($entity_get_info['bundles'][$row->bundle]['label'])) {
          $data[$entity_type][$row->bundle][$row->field_name]['bundle_label'] = $entity_get_info['bundles'][$row->bundle]['label'];
        }
      }
    }
  }
  return $data;
}