You are here

function template_preprocess_locations in Location 7.5

Same name and namespace in other branches
  1. 5.3 location.module \template_preprocess_locations()
  2. 6.3 location.module \template_preprocess_locations()
  3. 7.3 location.module \template_preprocess_locations()
  4. 7.4 location.module \template_preprocess_locations()

Theme preprocess function for theming a group of locations.

File

./location.module, line 1705
Location module main routines. An implementation of a universal API for location manipulation. Provides functions for postal_code proximity searching, deep-linking into online mapping services. Currently, some options are configured through an…

Code

function template_preprocess_locations(&$variables) {
  if (isset($variables['locations']) && is_array($variables['locations'])) {
    $locs = $variables['locations'];
  }
  else {

    // The locations weren't valid -- Use an empty array instead to avoid warnings.
    $locs = array();
  }
  $variables['locations'] = array();
  $variables['rawlocs'] = $locs;
  foreach ($locs as $location) {
    $variables['locations'][] = theme('location', array(
      'location' => $location,
      'hide' => $variables['hide'],
    ));
  }
}