tripal_phylogeny_base.tpl.php

  1. 2.x tripal_phylogeny/theme/templates/tripal_phylogeny_base.tpl.php
  2. 3.x legacy/tripal_phylogeny/theme/templates/tripal_phylogeny_base.tpl.php
1 theme call to tripal_phylogeny_base.tpl.php
tripal_phylogeny_node_view in tripal_phylogeny/includes/tripal_phylogeny.chado_node.inc
Implements hook_node_view(). Acts on all content types

File

tripal_phylogeny/theme/templates/tripal_phylogeny_base.tpl.php
View source
  1. <?php
  2. $phylotree = $variables['node']->phylotree;
  3. $phylotree = chado_expand_var($phylotree,'field','phylotree.comment'); ?>
  4. <div class="tripal_phylogeny-data-block-desc tripal-data-block-desc"> <?php
  5. // the $headers array is an array of fields to use as the colum headers.
  6. // additional documentation can be found here
  7. // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
  8. // This table for the analysis has a vertical header (down the first column)
  9. // so we do not provide headers here, but specify them in the $rows array below.
  10. $headers = array();
  11. // the $rows array contains an array of rows where each row is an array
  12. // of values for each column of the table in that row. Additional documentation
  13. // can be found here:
  14. // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
  15. $rows = array();
  16. // Name row
  17. $rows[] = array(
  18. array(
  19. 'data' => 'Tree Name',
  20. 'header' => TRUE,
  21. ),
  22. $phylotree->name
  23. );
  24. $leaf_type = 'N/A';
  25. if ($phylotree->type_id) {
  26. $leaf_type = $phylotree->type_id->name;
  27. }
  28. $rows[] = array(
  29. array(
  30. 'data' => 'Leaf type',
  31. 'header' => TRUE,
  32. ),
  33. $leaf_type
  34. );
  35. $description = 'N/A';
  36. if ($phylotree->comment) {
  37. $description = $phylotree->comment;
  38. }
  39. $rows[] = array(
  40. array(
  41. 'data' => 'Description',
  42. 'header' => TRUE,
  43. ),
  44. $description
  45. );
  46. // the $table array contains the headers and rows array as well as other
  47. // options for controlling the display of the table. Additional
  48. // documentation can be found here:
  49. // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
  50. $table = array(
  51. 'header' => $headers,
  52. 'rows' => $rows,
  53. 'attributes' => array(
  54. 'id' => 'tripal_phylogeny-table-base',
  55. 'class' => 'tripal-data-table'
  56. ),
  57. 'sticky' => FALSE,
  58. 'caption' => '',
  59. 'colgroups' => array(),
  60. 'empty' => '',
  61. );
  62. // once we have our table array structure defined, we call Drupal's theme_table()
  63. // function to generate the table.
  64. print theme_table($table);