tripal_chado.taxonomy.inc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Generates a page that contains the taxonomy view.
  4. */
  5. function tripal_phylogeny_taxonomy_view() {
  6. $values = array(
  7. 'type_id' => array(
  8. 'name' => 'taxonomy',
  9. ),
  10. );
  11. $message = t('Site administrators: This page is meant to provide
  12. a heirarchical taxonomic tree for all of the organism present
  13. in this site. This may not be useful if you only have a few
  14. species. If so, you can turn off this page by disabling this page on
  15. the site\'s <a href="@menu">Navigation Menu</a>. Otherwise, to generate the taxonomy go to this site\'s
  16. <a href="@taxloader">NCBI taxonomy loader</a> to import the taxonomy information from NCBI.
  17. <br><br>Note: If you add new species to this site, you should rerun the
  18. NCBI taxonomy loader to update the view</p>',
  19. array(
  20. '@menu' => url('admin/structure/menu/manage/navigation'),
  21. '@taxloader' => url('admin/tripal/loaders/chado_taxonomy'
  22. ))
  23. );
  24. $admin_message = tripal_set_message($message, TRIPAL_INFO, array('return_html' => TRUE));
  25. $content['admin_message'] = array(
  26. '#type' => 'markup',
  27. '#markup' => t('This site has not yet prepared the taxonomy for viewing.') . $admin_message,
  28. );
  29. $phylotree = chado_generate_var('phylotree', $values);
  30. if ($phylotree) {
  31. $node = new stdClass();
  32. $node->phylotree = $phylotree;
  33. $phylotree = chado_expand_var($phylotree,'field','phylotree.comment');
  34. module_load_include('inc', 'tripal_chado', 'includes/tripal_chado.phylotree');
  35. tripal_phylogeny_prepare_tree_viewer($phylotree);
  36. if ($phylotree->type_id->name == "taxonomy" and $phylotree->has_nodes) {
  37. $content['comment'] = array(
  38. '#type' => 'markup',
  39. '#markup' =>$phylotree->comment
  40. );
  41. $ajax_loader = url(drupal_get_path('module', 'tripal') . '/theme/images/ajax-loader.gif');
  42. $content['phylogram'] = array(
  43. '#type' => 'markup',
  44. '#markup' => '
  45. <div id="phylogram">
  46. <img src="' . $ajax_loader . '" class="phylogram-ajax-loader"/>
  47. </div>
  48. '
  49. );
  50. }
  51. }
  52. return $content;
  53. }