tripal_feature_synonyms.tpl.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. $feature = $variables['node']->feature;
  3. // get the references. if only one reference exists then we want to convert
  4. // the object into an array, otherwise the value is an array
  5. $synonyms = $feature->feature_synonym;
  6. if (!$synonyms) {
  7. $synonyms = array();
  8. } elseif (!is_array($synonyms)) {
  9. $synonyms = array($synonyms);
  10. }
  11. ?>
  12. <div id="tripal_feature-synonyms-box" class="tripal_feature-info-box tripal-info-box">
  13. <div class="tripal_feature-info-box-title tripal-info-box-title">Synonyms</div>
  14. <div class="tripal_feature-info-box-desc tripal-info-box-desc">The feature '<?php print $feature->name ?>' has the following synonyms</div>
  15. <?php if(count($synonyms) > 0){ ?>
  16. <table id="tripal_feature-synonyms-table" class="tripal_feature-table tripal-table tripal-table-horz">
  17. <tr>
  18. <th>Synonym</th>
  19. </tr>
  20. <?php
  21. $i = 0;
  22. foreach ($synonyms as $feature_synonym){
  23. $class = 'tripal-table-odd-row';
  24. if($i % 2 == 0 ){
  25. $class = 'tripal-table-even-row';
  26. }
  27. ?>
  28. <tr class="<?php print $class ?>">
  29. <td><?php print $feature_synonym->synonym_id->name?></td>
  30. </tr>
  31. <?php
  32. $i++;
  33. } ?>
  34. </table>
  35. <?php } else { ?>
  36. <div class="tripal-no-results">There are no synonyms for this feature</div>
  37. <?php }?>
  38. </div>