You are here

function location_addanother_nodeapi in Location 5.3

Same name and namespace in other branches
  1. 6.3 contrib/location_addanother/location_addanother.module \location_addanother_nodeapi()
  2. 7.4 contrib/location_addanother/location_addanother.module \location_addanother_nodeapi()

Implementation of hook_nodeapi().

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_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
  switch ($op) {
    case 'view':
      if (variable_get('location_addanother_' . $node->type, 0) && count($node->locations) < variable_get('location_maxnum_' . $node->type, 0) && !$teaser && node_access('update', $node)) {
        $node->content['location_addanother'] = array(
          '#type' => 'markup',
          '#value' => drupal_get_form('location_addanother_form', $node),
        );
      }
      break;
  }
}