Răsfoiți Sursa

Fixed bug in analysis template where the base template wasn't in the hook_theme of the module and also a bug in the template file that kept it from having the variable

spficklin 12 ani în urmă
părinte
comite
95f8e5c7b8
1 a modificat fișierele cu 35 adăugiri și 2 ștergeri
  1. 35 2
      tripal_analysis/tripal_analysis.module

+ 35 - 2
tripal_analysis/tripal_analysis.module

@@ -813,11 +813,44 @@ function tripal_analysis_perm() {
  */
 function tripal_analysis_theme() {
   return array(
-      'tripal_analysis_analysis_page' => array(
+    'tripal_analysis_analysis_page' => array(
          'arguments' => array('analyses'),
-      ),
+    ),
+    'tripal_analysis_base' => array(
+       'arguments' => array('node' => NULL),
+       'template' => 'tripal_analysis_base',
+    ),
   );
 }
+/**
+ *
+ *
+ * @ingroup tripal_feature
+ */
+function tripal_analysis_block($op = 'list', $delta = 0, $edit=array()) {
+  switch ($op) {
+    case 'list':
+      $blocks['base']['info'] = t('Tripal Analysis Details');
+      $blocks['base']['cache'] = BLOCK_NO_CACHE;
+      return $blocks;
+
+  case 'view':
+    if (user_access('access chado_analysis content') and arg(0) == 'node' and is_numeric(arg(1))) {
+      $nid = arg(1);
+      $node = node_load($nid);
+
+      $block = array();
+      switch ($delta) {       
+        case 'base':
+          $block['subject'] = t('Analysis Details');
+          $block['content'] = theme('tripal_analysis_base', $node);
+          break;
+        default :
+      }
+      return $block;
+    }
+  }
+}
 
 /**
  * This function uses analysis_id's of all drupal analysis nodes as input and