tripal_phylogeny.taxonomy.inc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Generates a page that contains the taxonomy view.
  4. */
  5. function tripal_phylogeny_taxonomy_view() {
  6. $values = [
  7. 'type_id' => [
  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. [
  20. '@menu' => url('admin/structure/menu/manage/navigation'),
  21. '@taxloader' => url('admin/tripal/loaders/ncbi_taxonomy_loader'
  22. ),
  23. ]
  24. );
  25. $admin_message = tripal_set_message($message, TRIPAL_INFO, ['return_html' => TRUE]);
  26. $phylotree = chado_generate_var('phylotree', $values);
  27. if ($phylotree) {
  28. $node = new stdClass();
  29. $node->phylotree = $phylotree;
  30. $html = theme('tripal_phylogeny_taxonomic_tree', ['node' => $node]) .
  31. $admin_message;
  32. return $html;
  33. }
  34. return [
  35. '#type' => 'markup',
  36. '#markup' => t('This site has not yet prepared the taxonomy for viewing.') . $admin_message,
  37. ];
  38. }