tripal_feature_kegg_terms.tpl.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. $feature = $variables['node']->feature;
  3. $results = $feature->tripal_analysis_kegg->results;
  4. if($feature->cvname != 'gene' and count($results) > 0){
  5. $i = 0;
  6. foreach($results as $analysis_id => $analysisprops){
  7. $analysis = $analysisprops['analysis'];
  8. $terms = $analysisprops['terms'];
  9. ?>
  10. <div id="tripal_feature-kegg_results_<?php print $i?>-box" class="tripal_analysis_kegg-box tripal-info-box">
  11. <div class="tripal_feature-info-box-title tripal-info-box-title">KEGG Report <?php print preg_replace("/^(\d+-\d+-\d+) .*/","$1",$analysis->timeexecuted); ?></div>
  12. <div class="tripal_feature-info-box-desc tripal-info-box-desc"><?php
  13. if($analysis->nid){ ?>
  14. Analysis name: <a href="<?php print url('node/'.$analysis->nid) ?>"><?php print $analysis->name?></a><?php
  15. } else { ?>
  16. Analysis name: <?php print $analysis->name;
  17. } ?><br>
  18. Date Performed: <?php print preg_replace("/^(\d+-\d+-\d+) .*/","$1",$analysis->timeexecuted); ?>
  19. </div>
  20. <div class="tripal_feature-kegg_results_subtitle">Annotated Terms</div>
  21. <table id="tripal_feature-kegg_summary-<?php $i ?>-table" class="tripal_analysis_kegg-summary-table tripal-table tripal-table-horz">
  22. <?php
  23. $j=0;
  24. foreach($terms as $term){
  25. $ipr_id = $term[0];
  26. $ipr_name = $term[1];
  27. $class = 'tripal_feature-table-odd-row tripal-table-odd-row';
  28. if($j % 2 == 0 ){
  29. $class = 'tripal_feature-table-even-row tripal-table-even-row';
  30. }?>
  31. <tr class="<?php print $class ?>">
  32. <td><?php print $term ?></td>
  33. </tr>
  34. <?php
  35. $j++;
  36. } ?>
  37. </table>
  38. </div> <?php
  39. $i++;
  40. } // end for each analysis
  41. } // end if
  42. ?>