Browse Source

Moved the stock_genotype theme to the genetic module. Technically it is part of the stock module, but the tables behave similarly to the feature_genotype table and are both superceeded by the nd tables. Since it the themes fit better with the genetic module they have been moved there

spficklin 11 năm trước cách đây
mục cha
commit
9bc1a12eac
2 tập tin đã thay đổi với 17 bổ sung4 xóa
  1. 17 0
      tripal_genetic/tripal_genetic.module
  2. 0 4
      tripal_stock/tripal_stock.module

+ 17 - 0
tripal_genetic/tripal_genetic.module

@@ -41,6 +41,10 @@ function tripal_genetic_theme() {
        'arguments' => array('node' => NULL),
        'template' => 'tripal_feature_genotypes',
     ),
+    'tripal_stock_genotypes' => array(
+       'arguments' => array('node' => NULL),
+       'template' => 'tripal_stock_genotypes',
+    ),
   );
 }
 
@@ -64,5 +68,18 @@ function tripal_genetic_nodeapi(&$node, $op, $teaser, $page) {
           );
         }
       }
+      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),
+          );
+        }
+      }
+      break;
   }
 }

+ 0 - 4
tripal_stock/tripal_stock.module

@@ -280,10 +280,6 @@ function tripal_stock_theme() {
        'arguments' => array('node' => NULL),
        'template' => 'tripal_stock_phenotypes',
     ),
-    'tripal_stock_genotypes' => array(
-       'arguments' => array('node' => NULL),
-       'template' => 'tripal_stock_genotypes',
-    ),
     'tripal_stock_locations' => array(
        'arguments' => array('node' => NULL),
        'template' => 'tripal_stock_locations',