node-chado_feature.tpl.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <?php
  2. /*
  3. * Copyright 2009 Clemson University
  4. */
  5. ?>
  6. <?php if ($picture) {
  7. print $picture;
  8. }?>
  9. <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
  10. <?php if ($page == 0) { ?><h2 class="nodeTitle"><a href="<?php print $node_url?>"><?php print $title?></a>
  11. <?php global $base_url;
  12. if ($sticky) { print '<img src="'.base_path(). drupal_get_path('theme','sanqreal').'/img/sticky.gif" alt="sticky icon" class="sticky" />'; } ?>
  13. </h2><?php }; ?>
  14. <?php if (!$teaser): ?>
  15. <?php if ($submitted): ?>
  16. <div class="metanode"><p><?php print t('') .'<span class="author">'. theme('username', $node).'</span>' . t(' - Posted on ') . '<span class="date">'.format_date($node->created, 'custom', "d F Y").'</span>'; ?></p></div>
  17. <?php endif; ?>
  18. <!-- theme_tripal_feature_feature_id -->
  19. <!--<div id="feature_notice"><img src="sites/all/modules/tripal_analysis_blast/images/info-128x128.png"><br><i>Feature information and annotations have moved. See below</i></div>-->
  20. <div id="feature-view">
  21. <?php
  22. $aprefix = variable_get('chado_feature_accession_prefix','ID');
  23. $feature = $node->feature;
  24. if($feature->is_obsolete == 't'){
  25. drupal_set_message(t('This feature is obsolete and no longer used in analysis, but is here for reference.'));
  26. }?>
  27. <table class="tripal_table_vert">
  28. <tr><th>Name</th><td><?php print $feature->featurename; ?></td></tr>
  29. <tr><th>Accession</th><td><?php print variable_get('chado_feature_accession_prefix','ID'); print $feature->feature_id; ?></td></tr>
  30. <tr><th valign="top">Sequence</th><td><pre><?php print ereg_replace("(.{50})","\\1<br>",$feature->residues); ?></pre></td></tr>
  31. <tr><th>Length</th><td><?php print $feature->seqlen ?></td></tr>
  32. <tr><th>Type</th><td><?php print $feature->cvname; ?></td>
  33. </tr>
  34. <?php $org_url = url("node/$org_nid")?>
  35. <tr>
  36. <th>Organism</th>
  37. <td>
  38. <?php if ($org_nid) {?>
  39. <a href="<?php print $org_url?>"><?php print $feature->common_name?></a>
  40. <?php
  41. } else {
  42. if ($feature->common_name) {
  43. print $feature->common_name;
  44. } else {
  45. // This sql is for the preview to show organism common_name
  46. $sql = "SELECT common_name FROM organism WHERE organism_id = $node->organism_id";
  47. $previous_db = db_set_active('chado');
  48. $org_commonname = db_result(db_query($sql));
  49. print $org_commonname;
  50. db_set_active($previous_db);
  51. }
  52. }
  53. ?>
  54. </td>
  55. </tr>
  56. <!-- Add library information which this feature belongs to-->
  57. <?php if ($node->lib_additions) { ?>
  58. <tr><th>Library</th><td>
  59. <?php
  60. $libraries = $node->lib_additions;
  61. foreach ($libraries as $lib_url => $lib_name) {
  62. // Check if library exists as a node in drupal
  63. if ($lib_url) {
  64. ?>
  65. <a href="<?php print $lib_url?>"><?php print $lib_name?></a><BR>
  66. <?php
  67. } else {
  68. print $lib_name;
  69. }
  70. }
  71. ?>
  72. </td></tr>
  73. <?php } ?>
  74. <!-- End of library addition -->
  75. <!-- theme_tripal_feature_feature_synonyms -->
  76. <?php
  77. $synonyms = $node->synonyms;
  78. if(count($synonyms) > 0){
  79. ?>
  80. <tr><th>Synonyms</th><td>
  81. <?php
  82. // iterate through each synonym
  83. if (is_array($synonyms)) {
  84. foreach ($synonyms as $result){
  85. print $result->name."<br>";
  86. }
  87. } else {
  88. print $synonyms;
  89. }
  90. ?>
  91. </td></tr>
  92. <?php } ?>
  93. <!-- End of theme_tripal_feature_feature_synonyms -->
  94. </table>
  95. </div>
  96. <!-- End of theme_tripal_feature_feature_id -->
  97. <?php endif; ?>
  98. <div class="content">
  99. <?php if (!$teaser): ?>
  100. <!-- Control link for the expandableBoxes -->
  101. <br><a id="tripal_expandableBox_toggle_button" onClick="toggleExpandableBoxes()">[-] Collapse All</a><br><br>
  102. <!-- End of Control link for the expandableBoxes -->
  103. <!-- theme_tripal_feature_feature_references -->
  104. <?php
  105. $references = $node->references;
  106. if(count($references) > 0){
  107. ?>
  108. <div id="feature-references" class="tripal_feature-info-box">
  109. <div class="tripal_expandableBox"><h3>References</h3></div>
  110. <div class="tripal_expandableBoxContent">
  111. <table>
  112. <tr>
  113. <th>Dababase</th>
  114. <th>Accession</th>
  115. </tr>
  116. <?php
  117. foreach ($references as $result){
  118. ?>
  119. <tr>
  120. <td><?php print $result->db_name?></td>
  121. <td><?php if($result->urlprefix){ ?><a href="<?php print $result->urlprefix.$result->accession?>"><?php print $result->accession?></a><?php } else { print $result->accession; } ?></td>
  122. </tr>
  123. <?php } ?>
  124. </table></div></div>
  125. <?php } ?>
  126. <!-- End of theme_tripal_feature_feature_references -->
  127. <?php endif; ?>
  128. <?php print $content?>
  129. </div>
  130. <?php if (!$teaser): ?>
  131. <?php if ($links) { ?><div class="links"><?php print $links?></div><?php }; ?>
  132. <?php endif; ?>
  133. <?php if ($teaser): ?>
  134. <?php if ($links) { ?><div class="linksteaser"><div class="links"><?php print $links?></div></div><?php }; ?>
  135. <?php endif; ?>
  136. <?php if (!$teaser): ?>
  137. <?php if ($terms) { ?><div class="taxonomy"><span><?php print t('tags') ?></span> <?php print $terms?></div><?php } ?>
  138. <?php endif; ?>
  139. </div>