function tripal_phylogeny_node_insert

2.x tripal_phylogeny.chado_node.inc tripal_phylogeny_node_insert($node)
3.x tripal_phylogeny.chado_node.inc tripal_phylogeny_node_insert($node)

Implements hook_node_insert(). Acts on all content types.

Related topics

File

tripal_phylogeny/includes/tripal_phylogeny.chado_node.inc, line 436
Implements the phylotree node content type

Code

function tripal_phylogeny_node_insert($node) {

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

      $phylotree_id = chado_get_id_from_nid('phylotree', $node->nid);
      $values = array('phylotree_id' => $phylotree_id);
      $phylotree = chado_generate_var('phylotree', $values);
      $phylotree = chado_expand_var($phylotree, 'field', 'phylotree.comment');
      $node->phylotree = $phylotree;

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

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

      break;
  }
}