node-chado_feature.tpl.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <?php if ($picture) {
  2. print $picture;
  3. $feature = $node->feature;
  4. $accession = $node->accession;
  5. $organism = $node->organism;
  6. }?>
  7. <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
  8. <?php if ($page == 0) { ?><h2 class="nodeTitle"><a href="<?php print $node_url?>"><?php print $title?></a>
  9. <?php global $base_url;
  10. if ($sticky) { print '<img src="'.base_path(). drupal_get_path('theme','sanqreal').'/img/sticky.gif" alt="sticky icon" class="sticky" />'; } ?>
  11. </h2><?php }; ?>
  12. <?php if (!$teaser): ?>
  13. <?php if ($submitted): ?>
  14. <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>
  15. <?php endif; ?>
  16. <!-- theme_tripal_feature_feature_id -->
  17. <!--<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>-->
  18. <div id="feature-view">
  19. <?php
  20. if($feature->is_obsolete == 't'){
  21. drupal_set_message(t('This feature is obsolete and no longer used in analysis, but is here for reference.'));
  22. }?>
  23. <table class="tripal_table_vert">
  24. <tr><th>Name</th><td><?php print $feature->featurename; ?></td></tr>
  25. <tr><th nowrap>Unique Name</th><td><?php print $feature->uniquename; ?></td></tr>
  26. <tr><th>Internal ID</th><td><?php print $accession; ?></td></tr>
  27. <tr><th>Length</th><td><?php print $feature->seqlen ?></td></tr>
  28. <tr><th>Type</th><td><?php print $feature->cvname; ?></td>
  29. </tr>
  30. <tr><th>Organism</th><td>
  31. <?php
  32. if ($node->org_nid) {
  33. print"<a href=\"". url("node/$node->org_nid") ."\">$organism->genus $organism->species ($organism->common_name)</a>";
  34. } else {
  35. print"$organism->genus $organism->species ($organism->common_name)";
  36. }
  37. ?>
  38. </td>
  39. </tr>
  40. <!-- Add library information which this feature belongs to-->
  41. <?php if ($node->lib_additions) { ?>
  42. <tr><th>Library</th><td>
  43. <?php
  44. $libraries = $node->lib_additions;
  45. foreach ($libraries as $lib_url => $lib_name) {
  46. // Check if library exists as a node in drupal
  47. if ($lib_url) {
  48. ?>
  49. <a href="<?php print $lib_url?>"><?php print $lib_name?></a><BR>
  50. <?php
  51. } else {
  52. print $lib_name;
  53. }
  54. }
  55. ?>
  56. </td></tr>
  57. <?php } ?>
  58. <!-- End of library addition -->
  59. <!-- theme_tripal_feature_feature_synonyms -->
  60. <?php
  61. $synonyms = $node->synonyms;
  62. if(count($synonyms) > 0){
  63. ?>
  64. <tr><th>Synonyms</th><td>
  65. <?php
  66. // iterate through each synonym
  67. if (is_array($synonyms)) {
  68. foreach ($synonyms as $result){
  69. print $result->name."<br>";
  70. }
  71. } else {
  72. print $synonyms;
  73. }
  74. ?>
  75. </td></tr>
  76. <?php } ?>
  77. <!-- End of theme_tripal_feature_feature_synonyms -->
  78. </table>
  79. </div>
  80. <!-- End of theme_tripal_feature_feature_id -->
  81. <?php endif; ?>
  82. <div class="content">
  83. <?php if (!$teaser): ?>
  84. <!-- Control link for the expandableBoxes -->
  85. <br><a id="tripal_expandableBox_toggle_button" onClick="toggleExpandableBoxes()">[-] Collapse All</a><br><br>
  86. <!-- End of Control link for the expandableBoxes -->
  87. <!-- Start of sequences -->
  88. <div id="feature-sequence" class="tripal_feature-info-box">
  89. <div class="tripal_expandableBox"><h3>Sequence</h3></div>
  90. <div class="tripal_expandableBoxContent">
  91. <?php print ucfirst($feature->cvname); ?> sequence
  92. <pre><?php print ereg_replace("(.{100})","\\1<br>",$feature->residues); ?></pre>
  93. <?php
  94. if(count($orelationships) > 0){
  95. foreach ($orelationships as $result){
  96. print "<br>" . ucfirst($result->subject_type) . " sequence";
  97. print "<pre>" . ereg_replace("(.{100})","\\1<br>",$result->subject_residues) . "</pre>";
  98. }
  99. }
  100. ?>
  101. </div></div>
  102. <!-- End of sequences -->
  103. <!-- Start of 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. <!-- Start of theme_tripal_feature_feature_relationships -->
  128. <?php
  129. $orelationships = $node->orelationships;
  130. if(count($orelationships) > 0 or count($srelationships) > 0){
  131. print "<div id=\"feature-relationships\" class=\"tripal_feature-info-box\">";
  132. print "<div class=\"tripal_expandableBox\"><h3>Relationships</h3></div>";
  133. print "<div class=\"tripal_expandableBoxContent\">";
  134. if(count($orelationships) > 0){
  135. foreach ($orelationships as $result){
  136. if(isset($result->subject_nid)){
  137. print "<a href=\"" . url("node/$result->subject_nid") . "\">$result->subject_name ($result->subject_type)</a> ";
  138. } else {
  139. print "$result->subject_name ($result->subject_type) ";
  140. }
  141. print "<b>$result->rel_type</b> ";
  142. if(isset($result->object_nid)){
  143. print "<a href=\"" . url("node/$result->object_nid") . "\">$result->object_name ($result->object_type)</a> ";
  144. } else {
  145. print "$result->object_name ($result->object_type) ";
  146. }
  147. print"<br>";
  148. }
  149. }
  150. if(count($srelationships) > 0){
  151. foreach ($srelationships as $result){
  152. if(isset($result->subject_nid)){
  153. print "<a href=\"" . url("node/$result->subject_nid") . "\">$result->subject_name ($result->subject_type)</a> ";
  154. } else {
  155. print "$result->subject_name ($result->subject_type) ";
  156. }
  157. print "<b>$result->rel_type</b> ";
  158. if(isset($result->object_nid)){
  159. print "<a href=\"" . url("node/$result->object_nid") . "\">$result->object_name ($result->object_type)</a> ";
  160. } else {
  161. print "$result->object_name ($result->object_type) ";
  162. }
  163. print"<br>";
  164. }
  165. }
  166. print "</div></div>";
  167. }
  168. ?>
  169. <!-- End of theme_tripal_feature_feature_relationships -->
  170. <?php endif; ?>
  171. <?php print $content?>
  172. </div>
  173. <?php if (!$teaser): ?>
  174. <?php if ($links) { ?><div class="links"><?php print $links?></div><?php }; ?>
  175. <?php endif; ?>
  176. <?php if ($teaser): ?>
  177. <?php if ($links) { ?><div class="linksteaser"><div class="links"><?php print $links?></div></div><?php }; ?>
  178. <?php endif; ?>
  179. <?php if (!$teaser): ?>
  180. <?php if ($terms) { ?><div class="taxonomy"><span><?php print t('tags') ?></span> <?php print $terms?></div><?php } ?>
  181. <?php endif; ?>
  182. </div>