You are here

function getlocations_location_taxonomize_get_fields in Get Locations 7.2

Same name and namespace in other branches
  1. 7 modules/getlocations_location_taxonomize/getlocations_location_taxonomize.inc \getlocations_location_taxonomize_get_fields()

Returns the Getlocations Fields fields that can be used for the Location Vocabulary

Parameters

$assoc - whether to return an associative array (TRUE) or just an: indexed array (FALSE)

$labels - whether to return the labels of fields as array values:

1 call to getlocations_location_taxonomize_get_fields()
_getlocations_location_taxonomize_variables in modules/getlocations_location_taxonomize/getlocations_location_taxonomize.inc
Keeps a list of all the variables maintained by this module, with their default values.

File

modules/getlocations_location_taxonomize/getlocations_location_taxonomize.inc, line 39
getlocations_location_taxonomize.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_location_taxonomize_get_fields($assoc = TRUE, $labels = FALSE) {
  $getlocations_fields_defaults = getlocations_fields_defaults();
  $fields = $getlocations_fields_defaults['columns'];

  // define the fields we support and their order
  $supported = array(
    'name',
    'street',
    'city',
    'province',
    'postal_code',
    'country',
  );
  $return = array();

  // remove unsupported fields
  foreach ($supported as $field) {
    if ($assoc) {
      if ($labels) {
        $return[$field] = $fields[$field];
      }
      else {
        $return[$field] = $field;
      }
    }
    else {
      $return[] = $field;
    }
  }
  return array_reverse($return);
}