Sfoglia il codice sorgente

Converted genetic and phenotype modules

spficklin 11 anni fa
parent
commit
22595904a1

+ 3 - 3
tripal_genetic/tripal_genetic.info

@@ -1,9 +1,9 @@
 name = Tripal Genetic
-description = A module for interfacing the GMOD chado database with Drupal, providing viewing of Genetic data
-core = 6.x
+description = A module for interfacing the GMOD chado database with Drupal, providing viewing of genetic data
+core = 7.x
 project = tripal_genetic
 package = Tripal
-version = 6.x-1.1
+version = 7.x-2.0-beta1
 dependencies[] = tripal_core
 dependencies[] = tripal_cv
 dependencies[] = tripal_feature

+ 26 - 26
tripal_genetic/tripal_genetic.module

@@ -53,33 +53,33 @@ function tripal_genetic_theme() {
  *
  * @ingroup tripal_genetic
  */
-function tripal_genetic_nodeapi(&$node, $op, $teaser, $page) {
-  switch ($op) {
-    case 'view':
-      if ($node->type == 'chado_feature') {
-        // the tripal_natural_diversity module provides a tripal_feature_nd_genotype
-        // template.  The only difference between them is the addition of
-        // project information by this ND module's template.  Therefore,
-        // if the tripal_natural_diversity content is present then don't add the
-        // template from this module as the ND module would superceed this.
-        if (!array_key_exists('tripal_feature_nd_genotypes', $node->content)) {
-          $node->content['tripal_feature_genotypes'] = array(
-            '#value' => theme('tripal_feature_genotypes', $node),
-          );
-        }
+function tripal_genetic_node_view(&$node, $view_mode, $langcode) {
+  if ($node->type == 'chado_feature') {
+    // the tripal_natural_diversity module provides a tripal_feature_nd_genotype
+    // template.  The only difference between them is the addition of
+    // project information by this ND module's template.  Therefore,
+    // if the tripal_natural_diversity content is present then don't add the
+    // template from this module as the ND module would superceed this.
+    if ($view_mode == 'full') {
+      if (!array_key_exists('tripal_feature_nd_genotypes', $node->content)) {
+        $node->content['tripal_feature_genotypes'] = array(
+          '#value' => theme('tripal_feature_genotypes', $node),
+        );
       }
-      if ($node->type == 'chado_stock') {
-        // the tripal_natural_diversity module provides a tripal_stock_nd_genotype
-        // template.  The only difference between them is the addition of
-        // project information by this ND module's template.  Therefore,
-        // if the tripal_natural_diversity content is present then don't add the
-        // template from this module as the ND module would superceed this.
-        if (!array_key_exists('tripal_stock_nd_genotypes', $node->content)) {
-          $node->content['tripal_stock_genotypes'] = array(
-            '#value' => theme('tripal_stock_genotypes', $node),
-          );
-        }
+    }
+  }
+  if ($node->type == 'chado_stock') {
+    // the tripal_natural_diversity module provides a tripal_stock_nd_genotype
+    // template.  The only difference between them is the addition of
+    // project information by this ND module's template.  Therefore,
+    // if the tripal_natural_diversity content is present then don't add the
+    // template from this module as the ND module would superceed this.
+    if ($view_mode == 'full') {
+      if (!array_key_exists('tripal_stock_nd_genotypes', $node->content)) {
+        $node->content['tripal_stock_genotypes'] = array(
+          '#value' => theme('tripal_stock_genotypes', $node),
+        );
       }
-      break;
+    }
   }
 }

+ 3 - 3
tripal_phenotype/tripal_phenotype.info

@@ -1,9 +1,9 @@
 name = Tripal Phenotype
-description = A module for interfacing the GMOD chado database with Drupal, providing viewing of Phenotype Data
-core = 6.x
+description = A module for interfacing the GMOD chado database with Drupal providing viewing of phenotype data
+core = 7.x
 project = tripal_phenotype
 package = Tripal
-version = 6.x-1.1
+version = 7.x-2.0-beta1
 dependencies[] = tripal_core
 dependencies[] = tripal_cv
 dependencies[] = tripal_feature