function tripal_featuremap_node_insert

2.x tripal_featuremap.chado_node.inc tripal_featuremap_node_insert($node)
3.x tripal_featuremap.chado_node.inc tripal_featuremap_node_insert($node)

Implements hook_node_insert(). Acts on all content types.

Related topics

File

legacy/tripal_featuremap/includes/tripal_featuremap.chado_node.inc, line 570
Hooks implementing the feature map node content type

Code

function tripal_featuremap_node_insert($node) {

  switch ($node->type) {
    case 'chado_featuremap':

      // get the feature details from chado
      $featuremap_id = chado_get_id_from_nid('featuremap', $node->nid);
      $values = array('featuremap_id' => $featuremap_id);
      $featuremap = chado_generate_var('featuremap', $values);
      $node->featuremap = $featuremap;

      // Now get the title
      $node->title = chado_get_node_title($node);

      // Now use the API to set the path.
      chado_set_node_url($node);

      break;
  }
}