tripal_feature_featureloc_sequences.tpl.php 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. // get the featurelocs for this feature. If the variable is not already
  3. // expanded then do so
  4. $feature = $variables['node']->feature;
  5. $featurelocs = $feature->featureloc;
  6. if(!$featurelocs){
  7. // expand the feature object to include the featureloc records. there are
  8. // two foreign key relationships with featureloc and feature (srcefeature_id and
  9. // feature_id). This will expand both
  10. $feature = tripal_core_expand_chado_vars($feature,'table','featureloc');
  11. }
  12. // get the featurelocs. if only one featureloc exists then we want to convert
  13. // the object into an array, otherwise the value is an array
  14. $ffeaturelocs = $feature->featureloc->feature_id;
  15. if (!$ffeaturelocs) {
  16. $ffeaturelocs = array();
  17. } elseif (!is_array($ffeaturelocs)) {
  18. $ffeaturelocs = array($ffeaturelocs);
  19. }
  20. $featureloc_sequences = tripal_feature_load_featureloc_sequences ($feature->feature_id,$ffeaturelocs);
  21. if(count($featureloc_sequences) > 0){
  22. foreach($featureloc_sequences as $src => $attrs){ ?>
  23. <div id="tripal_feature-<?php print $attrs['type']?>-box" class="tripal_feature-info-box tripal-info-box">
  24. <div class="tripal_feature-info-box-title tripal-info-box-title"><?php print $attrs['type']?> Colored Sequence</div>
  25. <div class="tripal_feature-info-box-desc tripal-info-box-desc"></div>
  26. <?php print $attrs['formatted_seq'] ?>
  27. </div>
  28. <?php }
  29. }?>