tripal_feature_synonyms.tpl.php 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. $feature = $variables['node']->feature;
  3. // expand the feature object to include the synonyms from the feature_synonym
  4. // table in chado.
  5. $options = array('return_array' => 1);
  6. $feature = tripal_core_expand_chado_vars($feature, 'table', 'feature_synonym', $options);
  7. $synonyms = $feature->feature_synonym;
  8. if(count($synonyms) > 0){ ?>
  9. <div id="tripal_feature-synonyms-box" class="tripal_feature-info-box tripal-info-box">
  10. <div class="tripal_feature-info-box-title tripal-info-box-title">Synonyms</div>
  11. <div class="tripal_feature-info-box-desc tripal-info-box-desc">The feature '<?php print $feature->name ?>' has the following synonyms</div>
  12. <table id="tripal_feature-synonyms-table" class="tripal_feature-table tripal-table tripal-table-horz">
  13. <tr>
  14. <th>Synonym</th>
  15. </tr> <?php
  16. $i = 0;
  17. foreach ($synonyms as $feature_synonym){
  18. $class = 'tripal-table-odd-row';
  19. if($i % 2 == 0 ){
  20. $class = 'tripal-table-even-row';
  21. } ?>
  22. <tr class="<?php print $class ?>">
  23. <td><?php print $feature_synonym->synonym_id->name?></td>
  24. </tr> <?php
  25. $i++;
  26. } ?>
  27. </table>
  28. </div><?php
  29. }