function template_preprocess_locations in Location 5.3
Same name and namespace in other branches
- 6.3 location.module \template_preprocess_locations()
- 7.5 location.module \template_preprocess_locations()
- 7.3 location.module \template_preprocess_locations()
- 7.4 location.module \template_preprocess_locations()
Theme preprocess function for theming a group of locations.
File
- ./
location.module, line 1500 - 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', $location, $variables['hide']);
}
}