function location_addanother_node_view in Location 7.5
Same name and namespace in other branches
- 7.3 contrib/location_addanother/location_addanother.module \location_addanother_node_view()
Implements hook_node_view().
File
- contrib/
location_addanother/ location_addanother.module, line 12 - "Add location from node view" functionality. Split from main location.module in version 3.
Code
function location_addanother_node_view($node, $view_mode) {
if (variable_get('location_addanother_' . $node->type, 0) && count($node->locations) < variable_get('location_maxnum_' . $node->type, 0) && $view_mode == 'full' && node_access('update', $node)) {
$addanother_form = drupal_get_form('location_addanother_form', $node);
$node->content['location_addanother'] = array(
'#type' => 'markup',
'#markup' => drupal_render($addanother_form),
);
}
}