function theme_location_cck_formatter_all in Location 6.3
Same name and namespace in other branches
- 7.4 contrib/location_cck/location_cck.module \theme_location_cck_formatter_all()
Return both an address and a map for an individual item.
File
- contrib/
location_cck/ location_cck.module, line 345 - Defines location field type.
Code
function theme_location_cck_formatter_all($element) {
$content = '';
$field = content_fields($element['#field_name'], $element['#type_name']);
$hide = isset($field['location_settings']['display']['hide']) ? array_keys(array_filter($field['location_settings']['display']['hide'])) : array();
$location = $element['#item'];
if (!empty($location['cck_preview_in_progress'])) {
// Our canary field is in place, we are in a node preview.
$fields = array();
// If the location isn't "empty", then theme it based on the current state
// of the item.
if (!location_is_empty($location, $fields)) {
$content = theme('location', $location, $hide);
}
}
else {
if (isset($location['lid']) && $location['lid']) {
// "normal" viewing.
// Location is already cached by CCK, so no need to load it.
$content = theme('location', $location, $hide);
}
}
$content .= theme_location_cck_field_map(array(
$location,
), $field);
return $content;
}