function location_addanother_form_submit in Location 6.3
Same name and namespace in other branches
- 5.3 contrib/location_addanother/location_addanother.module \location_addanother_form_submit()
- 7.5 contrib/location_addanother/location_addanother.module \location_addanother_form_submit()
- 7.3 contrib/location_addanother/location_addanother.module \location_addanother_form_submit()
- 7.4 contrib/location_addanother/location_addanother.module \location_addanother_form_submit()
Submission function for "add another location" form.
File
- contrib/
location_addanother/ location_addanother.module, line 82 - "Add location from node view" functionality. Split from main location.module in version 3.
Code
function location_addanother_form_submit($form, &$form_state) {
$location = $form_state['values']['location'];
$node = node_load($location['nid']);
$locations = $node->locations;
unset($location['nid']);
$locations[] = $location;
location_save_locations($locations, array(
'nid' => $node->nid,
'vid' => $node->vid,
));
return 'node/' . $node->nid;
}