Browse Source

Switch #markup to #theme & #node in hook_node_view() to ensure that pages are not rendered ahead of time allowing modules to modify the panes being rendered

Lacey Sanderson 10 years ago
parent
commit
6a812e5652

+ 12 - 9
tripal_analysis/includes/tripal_analysis.chado_node.inc

@@ -648,20 +648,23 @@ function tripal_analysis_node_view($node, $view_mode, $langcode) {
       // Show feature browser and counts
       if ($view_mode == 'full') {
         $node->content['tripal_analysis_base'] = array(
-          '#markup' => theme('tripal_analysis_base', array('node' => $node)),
+          '#theme' => 'tripal_analysis_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_analysis_properties'] = array(
-          '#markup' => theme('tripal_analysis_properties', array('node' => $node)),
+          '#theme' => 'tripal_analysis_properties',
+          '#node' => $node,
           '#tripal_toc_id'    => 'properties',
           '#tripal_toc_title' => 'Properties',
         );
       }
       if ($view_mode == 'teaser') {
         $node->content['tripal_analysis_teaser'] = array(
-          '#markup' => theme('tripal_analysis_teaser', array('node' => $node)),
+          '#theme' => 'tripal_analysis_teaser',
+          '#node' => $node,
         );
       }
       break;
@@ -679,7 +682,7 @@ function tripal_analysis_node_presave($node) {
   $program = '';
   $programversion = '';
   $sourcename = '';
-  
+
   // This step is for setting the title for the Drupal node.  This title
   // is permanent and thus is created to be unique.  Title changes provided
   // by tokens are generated on the fly dynamically, but the node title
@@ -731,15 +734,15 @@ function tripal_analysis_node_insert($node) {
 
   switch ($node->type) {
     case 'chado_analysis':
-      
+
       // We still don't have a fully loaded node object in this hook. Therefore,
       // we need to simulate one so that the right values are available for
       // the URL to be determined.
-      $analysis_id = chado_get_id_from_nid('analysis', $node->nid);      
+      $analysis_id = chado_get_id_from_nid('analysis', $node->nid);
       $values = array('analysis_id' => $analysis_id);
       $analysis = chado_generate_var('analysis', $values);
       $node->analysis = $analysis;
-      
+
       // Now get the title
       $node->title = chado_get_node_title($node);
 
@@ -760,10 +763,10 @@ function tripal_analysis_node_update($node) {
 
   switch ($node->type) {
     case 'chado_analysis':
-      
+
       // Now get the title
       $node->title = chado_get_node_title($node);
- 
+
       // Now use the API to set the path.
       chado_set_node_url($node);
 

+ 6 - 3
tripal_bulk_loader/includes/tripal_bulk_loader.chado_node.inc

@@ -381,14 +381,16 @@ function tripal_bulk_loader_node_view($node, $view_mode, $langcode) {
         $node->content['#tripal_generic_node_template'] = TRUE;
 
         $node->content['tripal_bulk_loader_base'] = array(
-          '#markup' => theme('tripal_bulk_loader_base', array('node' => $node)),
+          '#theme' => 'tripal_bulk_loader_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#tripal_template_show' => FALSE,
           '#weight' => -100,
         );
         $node->content['tripal_bulk_loader_fields'] = array(
-          '#markup' => theme('tripal_bulk_loader_fields', array('node' => $node)),
+          '#theme' => 'tripal_bulk_loader_fields',
+          '#node' => $node,
           '#tripal_toc_id'    => 'fields',
           '#tripal_toc_title' => 'Data Fields',
           '#tripal_template_show' => FALSE,
@@ -396,7 +398,8 @@ function tripal_bulk_loader_node_view($node, $view_mode, $langcode) {
       }
       if ($view_mode == 'teaser') {
         $node->content['tripal_bulk_loader_teaser'] = array(
-          '#markup' => theme('tripal_bulk_loader_teaser', array('node' => $node)),
+          '#theme' => 'tripal_bulk_loader_teaser',
+          '#node' => $node,
         );
       }
       break;

+ 10 - 5
tripal_contact/includes/tripal_contact.chado_node.inc

@@ -595,30 +595,35 @@ function tripal_contact_node_view($node, $view_mode, $langcode) {
       // Show feature browser and counts
       if ($view_mode == 'full') {
         $node->content['tripal_contact_base'] = array(
-          '#markup' => theme('tripal_contact_base', array('node' => $node)),
+          '#theme' => 'tripal_contact_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_contact_properties'] = array(
-          '#markup' => theme('tripal_contact_properties', array('node' => $node)),
+          '#theme' => 'tripal_contact_properties',
+          '#node' => $node,
           '#tripal_toc_id'    => 'properties',
           '#tripal_toc_title' => 'Properties',
         );
         $node->content['tripal_contact_publications'] = array(
-          '#markup' => theme('tripal_contact_publications', array('node' => $node)),
+          '#theme' => 'tripal_contact_publications',
+          '#node' => $node,
           '#tripal_toc_id'    => 'publications',
           '#tripal_toc_title' => 'Publications',
         );
         $node->content['tripal_contact_relationships'] = array(
-          '#markup' => theme('tripal_contact_relationships', array('node' => $node)),
+          '#theme' => 'tripal_contact_relationships',
+          '#node' => $node,
           '#tripal_toc_id'    => 'relationships',
           '#tripal_toc_title' => 'Relationships',
         );
       }
       if ($view_mode == 'teaser') {
         $node->content['tripal_contact_teaser'] = array(
-          '#markup' => theme('tripal_contact_teaser', array('node' => $node)),
+          '#theme' => 'tripal_contact_teaser',
+          '#node' => $node,
         );
       }
       break;

+ 13 - 7
tripal_example/includes/tripal_example.chado_node.inc

@@ -597,7 +597,7 @@ function tripal_example_node_presave($node) {
 
   // EXPLANATION: This node is useful for
   // making changes to the node prior to it being saved to the database.
-  // One useful case for this is to set the title of a node using values 
+  // One useful case for this is to set the title of a node using values
   // supplied by the user.
   //
   // This function is not required. You probably won't need it if you
@@ -758,7 +758,8 @@ function tripal_example_node_view($node, $view_mode, $langcode) {
         // base template (or Overview) to ensure that it appears at the top of
         // the list. Otherwise items are sorted alphabetically.
         $node->content['tripal_example_base'] = array(
-          '#markup' => theme('tripal_example_base', array('node' => $node)),
+          '#theme' => 'tripal_example_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
@@ -766,17 +767,20 @@ function tripal_example_node_view($node, $view_mode, $langcode) {
         // we can add other templates as well for properties, publications,
         // dbxrefs, etc...
         $node->content['tripal_example_properties'] = array(
-          '#markup' => theme('tripal_example_properties', array('node' => $node)),
+          '#theme' => 'tripal_example_properties',
+          '#node' => $node,
           '#tripal_toc_id'    => 'properties',
           '#tripal_toc_title' => 'Properties',
         );
         $node->content['tripal_example_references'] = array(
-          '#markup' => theme('tripal_example_references', array('node' => $node)),
+          '#theme' => 'tripal_example_references',
+          '#node' => $node,
           '#tripal_toc_id'    => 'references',
           '#tripal_toc_title' => 'Cross References',
         );
         $node->content['tripal_example_relationships'] = array(
-          '#markup' => theme('tripal_example_relationships', array('node' => $node)),
+          '#theme' => 'tripal_example_relationships',
+          '#node' => $node,
           '#tripal_toc_id'    => 'relationships',
           '#tripal_toc_title' => 'Relationships',
         );
@@ -791,7 +795,8 @@ function tripal_example_node_view($node, $view_mode, $langcode) {
       if ($view_mode == 'teaser') {
         // The teaser is also a required template
         $node->content['tripal_example_teaser'] = array(
-          '#value' => theme('tripal_example_teaser', array('node' => $node)),
+          '#theme' => 'tripal_example_teaser',
+          '#node' => $node,
         );
       }
       break;
@@ -800,7 +805,8 @@ function tripal_example_node_view($node, $view_mode, $langcode) {
     case 'chado_organism':
       if ($view_mode == 'full') {
         $node->content['tripal_organism_examples'] = array(
-          '#markup' => theme('tripal_organism_examples', array('node' => $node)),
+          '#theme' => 'tripal_organism_examples',
+          '#node' => $node,
           '#tripal_toc_id'    => 'examples',
           '#tripal_toc_title' => 'Examples',
         );

+ 26 - 13
tripal_feature/includes/tripal_feature.chado_node.inc

@@ -833,60 +833,71 @@ function tripal_feature_node_view($node, $view_mode, $langcode) {
       // Show feature browser and counts
       if ($view_mode == 'full') {
         $node->content['tripal_feature_alignments'] = array(
-          '#markup' => theme('tripal_feature_alignments', array('node' => $node)),
+          '#theme' => 'tripal_feature_alignments',
+          '#node' => $node,
           '#tripal_toc_id'    => 'alignments',
           '#tripal_toc_title' => 'Alignments',
         );
         $node->content['tripal_feature_analyses'] = array(
-          '#markup' => theme('tripal_feature_analyses', array('node' => $node)),
+          '#theme' => 'tripal_feature_analyses',
+          '#node' => $node,
           '#tripal_toc_id'    => 'analyses',
           '#tripal_toc_title' => 'Analyses',
         );
         $node->content['tripal_feature_base'] = array(
-          '#markup' => theme('tripal_feature_base', array('node' => $node)),
+          '#theme' => 'tripal_feature_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_feature_properties'] = array(
-          '#markup' => theme('tripal_feature_properties', array('node' => $node)),
+          '#theme' => 'tripal_feature_properties',
+          '#node' => $node,
           '#tripal_toc_id'    => 'properties',
           '#tripal_toc_title' => 'Properties',
         );
         $node->content['tripal_feature_publications'] = array(
-          '#markup' => theme('tripal_feature_publications', array('node' => $node)),
+          '#theme' => 'tripal_feature_publications',
+          '#node' => $node,
           '#tripal_toc_id'    => 'publications',
           '#tripal_toc_title' => 'Publications',
         );
         $node->content['tripal_feature_references'] = array(
-          '#markup' => theme('tripal_feature_references', array('node' => $node)),
+          '#theme' => 'tripal_feature_references',
+          '#node' => $node,
           '#tripal_toc_id'    => 'references',
           '#tripal_toc_title' => 'Cross References',
         );
         $node->content['tripal_feature_relationships'] = array(
-          '#markup' => theme('tripal_feature_relationships', array('node' => $node)),
+          '#theme' => 'tripal_feature_relationships',
+          '#node' => $node,
           '#tripal_toc_id'    => 'relationships',
           '#tripal_toc_title' => 'Relationships',
         );
         $node->content['tripal_feature_seqence'] = array(
-          '#markup' => theme('tripal_feature_sequence', array('node' => $node)),
+          '#theme' => 'tripal_feature_sequence',
+          '#node' => $node,
           '#tripal_toc_id'    => 'sequences',
           '#tripal_toc_title' => 'Sequences',
         );
         $node->content['tripal_feature_synonyms'] = array(
-          '#markup' => theme('tripal_feature_synonyms', array('node' => $node)),
+          '#theme' => 'tripal_feature_synonyms',
+          '#node' => $node,
           '#tripal_toc_id'    => 'synonyms',
           '#tripal_toc_title' => 'Synonyms',
         );
         $node->content['tripal_feature_terms'] = array(
-          '#markup' => theme('tripal_feature_terms', array('node' => $node)),
+          '#theme' => 'tripal_feature_terms',
+          '#node' => $node,
           '#tripal_toc_id'    => 'terms',
           '#tripal_toc_title' => 'Annotated Terms',
         );
       }
       if ($view_mode == 'teaser') {
         $node->content['tripal_feature_teaser'] = array(
-          '#markup' => theme('tripal_feature_teaser', array('node' => $node)),
+          '#theme' => 'tripal_feature_teaser',
+          '#node' => $node,
         );
       }
       break;
@@ -894,12 +905,14 @@ function tripal_feature_node_view($node, $view_mode, $langcode) {
       // Show feature browser and counts
       if ($view_mode == 'full') {
         $node->content['tripal_organism_feature_counts'] = array(
-          '#markup' => theme('tripal_organism_feature_counts', array('node' => $node)),
+          '#theme' => 'tripal_organism_feature_counts',
+          '#node' => $node,
           '#tripal_toc_id'    => 'feature_counts',
           '#tripal_toc_title' => 'Feature Summary',
         );
         $node->content['tripal_organism_feature_browser'] = array(
-          '#markup' => theme('tripal_organism_feature_browser', array('node' => $node)),
+          '#theme' => 'tripal_organism_feature_browser',
+          '#node' => $node,
           '#tripal_toc_id'    => 'feature_browser',
           '#tripal_toc_title' => 'Feature Browser',
         );

+ 17 - 10
tripal_featuremap/includes/tripal_featuremap.chado_node.inc

@@ -502,42 +502,49 @@ function tripal_featuremap_node_view($node, $view_mode, $langcode) {
       // Show feature browser and counts
       if ($view_mode == 'full') {
         $node->content['tripal_featuremap_base'] = array(
-          '#markup' => theme('tripal_featuremap_base', array('node' => $node)),
+          '#node' => 'tripal_featuremap_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_featuremap_featurepos'] = array(
-          '#markup' => theme('tripal_featuremap_featurepos', array('node' => $node)),
+          '#node' => 'tripal_featuremap_featurepos',
+          '#node' => $node,
           '#tripal_toc_id'    => 'featurepos',
           '#tripal_toc_title' => 'Map Features',
         );
         $node->content['tripal_featuremap_properties'] = array(
-          '#markup' => theme('tripal_featuremap_properties', array('node' => $node)),
+          '#node' => 'tripal_featuremap_properties',
+          '#node' => $node,
           '#tripal_toc_id'    => 'properties',
           '#tripal_toc_title' => 'Properties',
         );
         $node->content['tripal_featuremap_publication'] = array(
-          '#markup' => theme('tripal_featuremap_publication', array('node' => $node)),
+          '#node' => 'tripal_featuremap_publication',
+          '#node' => $node,
           '#tripal_toc_id'    => 'publications',
           '#tripal_toc_title' => 'Publications',
         );
         $node->content['tripal_featuremap_references'] = array(
-          '#markup' => theme('tripal_featuremap_references', array('node' => $node)),
+          '#node' => 'tripal_featuremap_references',
+          '#node' => $node,
           '#tripal_toc_id'    => 'references',
           '#tripal_toc_title' => 'Cross References',
         );
       }
       if ($view_mode == 'teaser') {
         $node->content['tripal_featuremap_teaser'] = array(
-          '#markup' => theme('tripal_featuremap_teaser', array('node' => $node)),
+          '#node' => 'tripal_featuremap_teaser',
+          '#node' => $node,
         );
       }
       break;
     case 'chado_feature':
       if ($view_mode == 'full') {
         $node->content['tripal_feature_featurepos'] = array(
-          '#markup' => theme('tripal_feature_featurepos', array('node' => $node)),
+          '#node' => 'tripal_feature_featurepos',
+          '#node' => $node,
           '#tripal_toc_id'    => 'featurepos',
           '#tripal_toc_title' => 'Maps',
         );
@@ -556,9 +563,9 @@ function tripal_featuremap_node_insert($node) {
 
   switch ($node->type) {
     case 'chado_featuremap':
-      
+
       // get the feature details from chado
-      $featuremap_id = chado_get_id_from_nid('featuremap', $node->nid);      
+      $featuremap_id = chado_get_id_from_nid('featuremap', $node->nid);
       $values = array('featuremap_id' => $featuremap_id);
       $featuremap = chado_generate_var('featuremap', $values);
       $node->featuremap = $featuremap;
@@ -583,7 +590,7 @@ function tripal_featuremap_node_update($node) {
 
   switch ($node->type) {
     case 'chado_featuremap':
-      
+
       // Now get the title
       $node->title = chado_get_node_title($node);
 

+ 23 - 13
tripal_library/includes/tripal_library.chado_node.inc

@@ -125,9 +125,9 @@ function chado_library_form($node, &$form_state) {
   $lt_cv = tripal_get_default_cv("library", "type_id");
   $types = tripal_get_cvterm_default_select_options('library', 'type_id', 'library types');
   $types[0] = 'Select a Type';
-  $lt_message = tripal_set_message("To add additional items to the library type drop down list, 
-     add a term to the " . 
-     l($lt_cv->name . " controlled vocabulary", 
+  $lt_message = tripal_set_message("To add additional items to the library type drop down list,
+     add a term to the " .
+     l($lt_cv->name . " controlled vocabulary",
        "admin/tripal/chado/tripal_cv/cv/" . $lt_cv->cv_id . "/cvterm/add",
        array('attributes' => array('target' => '_blank'))
       ),
@@ -516,52 +516,61 @@ function tripal_library_node_view($node, $view_mode, $langcode) {
     case 'chado_library':
       if ($view_mode == 'full') {
         $node->content['tripal_library_base'] = array(
-          '#markup' => theme('tripal_library_base', array('node' => $node)),
+          '#theme' => 'tripal_library_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_library_features'] = array(
-          '#markup' => theme('tripal_library_features', array('node' => $node)),
+          '#theme' => 'tripal_library_features',
+          '#node' => $node,
           '#tripal_toc_id'    => 'features',
           '#tripal_toc_title' => 'Features',
         );
         $node->content['tripal_library_properties'] = array(
-          '#markup' => theme('tripal_library_properties', array('node' => $node)),
+          '#theme' => 'tripal_library_properties',
+          '#node' => $node,
           '#tripal_toc_id'    => 'properties',
           '#tripal_toc_title' => 'Properties',
         );
         $node->content['tripal_library_publications'] = array(
-          '#markup' => theme('tripal_library_publications', array('node' => $node)),
+          '#theme' => 'tripal_library_publications',
+          '#node' => $node,
           '#tripal_toc_id'    => 'publications',
           '#tripal_toc_title' => 'Publications',
         );
         $node->content['tripal_library_references'] = array(
-          '#markup' => theme('tripal_library_references', array('node' => $node)),
+          '#theme' => 'tripal_library_references',
+          '#node' => $node,
           '#tripal_toc_id'    => 'references',
           '#tripal_toc_title' => 'Cross References',
         );
         $node->content['tripal_library_synonyms'] = array(
-          '#markup' => theme('tripal_library_synonyms', array('node' => $node)),
+          '#theme' => 'tripal_library_synonyms',
+          '#node' => $node,
           '#tripal_toc_id'    => 'synonyms',
           '#tripal_toc_title' => 'Synonyms',
         );
         $node->content['tripal_library_terms'] = array(
-          '#markup' => theme('tripal_library_terms', array('node' => $node)),
+          '#theme' => 'tripal_library_terms',
+          '#node' => $node,
           '#tripal_toc_id'    => 'terms',
           '#tripal_toc_title' => 'Annotated Terms',
         );
       }
       if ($view_mode == 'teaser') {
         $node->content['tripal_library_teaser'] = array(
-          '#markup' => theme('tripal_library_teaser', array('node' => $node)),
+          '#theme' => 'tripal_library_teaser',
+          '#node' => $node,
         );
       }
       break;
     case 'chado_organism':
       if ($view_mode == 'full') {
         $node->content['tripal_organism_libraries'] = array(
-          '#markup' => theme('tripal_organism_libraries', array('node' => $node)),
+          '#theme' => 'tripal_organism_libraries',
+          '#node' => $node,
           '#tripal_toc_id'    => 'libraries',
           '#tripal_toc_title' => 'Libraries',
         );
@@ -570,7 +579,8 @@ function tripal_library_node_view($node, $view_mode, $langcode) {
     case 'chado_feature':
       if ($view_mode == 'full') {
         $node->content['tripal_feature_libraries'] = array(
-          '#markup' => theme('tripal_feature_libraries', array('node' => $node)),
+          '#theme' => 'tripal_feature_libraries',
+          '#node' => $node,
           '#tripal_toc_id'    => 'libraries',
           '#tripal_toc_title' => 'Libraries',
         );

+ 15 - 11
tripal_organism/includes/tripal_organism.chado_node.inc

@@ -171,7 +171,7 @@ function chado_organism_form($node, $form_state) {
     '#title' => t('Description'),
     '#default_value' => $description,
   );
-  
+
   $form['organism_image']= array(
     '#type' => 'managed_file',
     '#title' => t('Organism Image'),
@@ -380,7 +380,7 @@ function chado_organism_update($node) {
   );
   $org_status = chado_update_record('organism', $match, $values);
   chado_organism_add_image($node);
-  
+
   // * Properties Form *
   $details = array(
     'property_table' => 'organismprop',   // the name of the prop table
@@ -401,13 +401,13 @@ function chado_organism_update($node) {
 
 /**
  * Adds the image to the organism node and cleans up any old images.
- * 
+ *
  * @param $node
  *   The node object.
  */
 function chado_organism_add_image($node) {
-  
-  // If there is already an organism image, then remove it it if 
+
+  // If there is already an organism image, then remove it it if
   // no other modules are using it
   $fid = db_select('file_usage', 'fu')
     ->fields('fu', array('fid'))
@@ -550,25 +550,29 @@ function tripal_organism_node_view($node, $view_mode, $langcode) {
       // Show feature browser and counts
       if ($view_mode == 'full') {
         $node->content['tripal_organism_base'] = array(
-          '#markup'  => theme('tripal_organism_base', array('node' => $node)),
+          '#theme' => 'tripal_organism_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_organism_properties'] = array(
-          '#markup'  => theme('tripal_organism_properties', array('node' => $node)),
+          '#theme' => 'tripal_organism_properties',
+          '#node' => $node,
           '#tripal_toc_id'    => 'properties',
           '#tripal_toc_title' => 'Properties',
         );
         $node->content['tripal_organism_references'] = array(
-          '#markup'  => theme('tripal_organism_references', array('node' => $node)),
+          '#theme' => 'tripal_organism_references',
+          '#node' => $node,
           '#tripal_toc_id'    => 'references',
           '#tripal_toc_title' => 'Cross References',
         );
       }
       if ($view_mode == 'teaser') {
         $node->content['tripal_organism_teaser'] = array(
-          '#markup' => theme('tripal_organism_teaser', array('node' => $node)),
+          '#theme' => 'tripal_organism_teaser',
+          '#node' => $node,
         );
       }
       break;
@@ -585,7 +589,7 @@ function tripal_organism_node_insert($node) {
 
   switch ($node->type) {
     case 'chado_organism':
-      
+
       // find the organism and add in the details
       $organism_id = chado_get_id_from_nid('organism', $node->nid);
       $values = array('organism_id' => $organism_id);
@@ -612,7 +616,7 @@ function tripal_organism_node_update($node) {
 
   switch ($node->type) {
     case 'chado_organism':
-      
+
       // Now get the title.
       $node->title = chado_get_node_title($node);
 

+ 12 - 6
tripal_project/includes/tripal_project.chado_node.inc

@@ -486,35 +486,41 @@ function tripal_project_node_view($node, $view_mode, $langcode) {
       // Show feature browser and counts
       if ($view_mode == 'full') {
         $node->content['tripal_project_base'] = array(
-          '#markup' => theme('tripal_project_base', array('node' => $node)),
+          '#theme' => 'tripal_project_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_project_contact'] = array(
-          '#markup' => theme('tripal_project_contact', array('node' => $node)),
+          '#theme' => 'tripal_project_contact',
+          '#node' => $node,
           '#tripal_toc_id'    => 'contacts',
           '#tripal_toc_title' => 'Contacts',
         );
         $node->content['tripal_project_properties'] = array(
-          '#markup' => theme('tripal_project_properties', array('node' => $node)),
+          '#theme' => 'tripal_project_properties',
+          '#node' => $node,
           '#tripal_toc_id'    => 'properties',
           '#tripal_toc_title' => 'Properties',
         );
         $node->content['tripal_project_publications'] = array(
-          '#markup' => theme('tripal_project_publications', array('node' => $node)),
+          '#theme' => 'tripal_project_publications',
+          '#node' => $node,
           '#tripal_toc_id'    => 'publications',
           '#tripal_toc_title' => 'Publications',
         );
         $node->content['tripal_project_relationships'] = array(
-          '#markup' => theme('tripal_project_relationships', array('node' => $node)),
+          '#theme' => 'tripal_project_relationships',
+          '#node' => $node,
           '#tripal_toc_id'    => 'relationships',
           '#tripal_toc_title' => 'Relationships',
         );
       }
       if ($view_mode == 'teaser') {
         $node->content['tripal_project_teaser'] = array(
-          '#markup' => theme('tripal_project_teaser', array('node' => $node)),
+          '#theme' => 'tripal_project_teaser',
+          '#node' => $node,
         );
       }
       break;

+ 22 - 11
tripal_pub/includes/tripal_pub.chado_node.inc

@@ -1042,60 +1042,71 @@ function tripal_pub_node_view($node, $view_mode, $langcode) {
       // Show feature browser and counts
       if ($view_mode == 'full') {
         $node->content['tripal_pub_authors'] = array(
-          '#markup' => theme('tripal_pub_authors', array('node' => $node)),
+          '#theme' => 'tripal_pub_authors',
+          '#node' => $node,
           '#tripal_toc_id'    => 'authors',
           '#tripal_toc_title' => 'Author Details',
         );
         $node->content['tripal_pub_base'] = array(
-          '#markup' => theme('tripal_pub_base', array('node' => $node)),
+          '#theme' => 'tripal_pub_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_pub_featuremaps'] = array(
-          '#markup' => theme('tripal_pub_featuremaps', array('node' => $node)),
+          '#theme' => 'tripal_pub_featuremaps',
+          '#node' => $node,
           '#tripal_toc_id'    => 'featuremaps',
           '#tripal_toc_title' => 'Maps',
         );
         $node->content['tripal_pub_features'] = array(
-          '#markup' => theme('tripal_pub_features', array('node' => $node)),
+          '#theme' => 'tripal_pub_features',
+          '#node' => $node,
           '#tripal_toc_id'    => 'features',
           '#tripal_toc_title' => 'Features',
         );
         $node->content['tripal_pub_libraries'] = array(
-          '#markup' => theme('tripal_pub_libraries', array('node' => $node)),
+          '#theme' => 'tripal_pub_libraries',
+          '#node' => $node,
           '#tripal_toc_id'    => 'libraries',
           '#tripal_toc_title' => 'Libraries',
         );
         $node->content['tripal_pub_projects'] = array(
-          '#markup' => theme('tripal_pub_projects', array('node' => $node)),
+          '#theme' => 'tripal_pub_projects',
+          '#node' => $node,
           '#tripal_toc_id'    => 'projects',
           '#tripal_toc_title' => 'Projects',
         );
         $node->content['tripal_pub_properties'] = array(
-          '#markup' => theme('tripal_pub_properties', array('node' => $node)),
+          '#theme' => 'tripal_pub_properties',
+          '#node' => $node,
           '#tripal_toc_id'    => 'properties',
           '#tripal_toc_title' => 'Properties',
         );
         $node->content['tripal_pub_references'] = array(
-          '#markup' => theme('tripal_pub_references', array('node' => $node)),
+          '#theme' => 'tripal_pub_references',
+          '#node' => $node,
           '#tripal_toc_id'    => 'references',
           '#tripal_toc_title' => 'Cross References',
         );
         $node->content['tripal_pub_relationships'] = array(
-          '#markup' => theme('tripal_pub_relationships', array('node' => $node)),
+          '#theme' => 'tripal_pub_relationships',
+          '#node' => $node,
           '#tripal_toc_id'    => 'relationships',
           '#tripal_toc_title' => 'Relationships',
         );
         $node->content['tripal_pub_stocks'] = array(
-          '#markup' => theme('tripal_pub_stocks', array('node' => $node)),
+          '#theme' => 'tripal_pub_stocks',
+          '#node' => $node,
           '#tripal_toc_id'    => 'stocks',
           '#tripal_toc_title' => 'Stocks',
         );
       }
       if ($view_mode == 'teaser') {
         $node->content['tripal_pub_teaser'] = array(
-          '#markup' => theme('tripal_pub_teaser', array('node' => $node)),
+          '#theme' => 'tripal_pub_teaser',
+          '#node' => $node,
         );
       }
       break;

+ 26 - 17
tripal_stock/includes/tripal_stock.chado_node.inc

@@ -235,14 +235,14 @@ function chado_stock_form($node, $form_state) {
   $form['database_reference'] = array(
     '#type' => 'fieldset',
     '#title' => t('Stock Database Reference'),
-    '#description' => t('If this site is not the primary location for information 
+    '#description' => t('If this site is not the primary location for information
         about this stock, please provide the name of the database, the accession
         and an optional description using the fields below. If the database
-        is not present in the list, then please ') . 
+        is not present in the list, then please ') .
         l(t('add the database '), 'admin/tripal/chado/tripal_db/add', array('attributes' => array('target' => '_blank'))) .
-        t('then refresh this page.'), 
+        t('then refresh this page.'),
   );
-  
+
   $db_options = tripal_get_db_select_options();
   $form['database_reference']['database'] = array(
     '#type' => 'select',
@@ -264,7 +264,7 @@ function chado_stock_form($node, $form_state) {
     '#title' => t('Description of Database Reference'),
     '#default_value' => $dbxref_description,
     '#description' => t('Optionally enter a description about the database accession.')
-    
+
   );
 
 
@@ -441,7 +441,7 @@ function chado_stock_insert($node) {
   $node->uniquename   = trim($node->uniquename);
   $node->sname        = trim($node->sname);
   $node->accession    = trim($node->accession);
-  
+
   $stock_id = '';
 
   // if there is an stock_id in the $node object then this must be a sync so
@@ -521,7 +521,7 @@ function chado_stock_insert($node) {
   else {
     $stock_id = $node->stock_id;
   }
-  
+
   // Make sure the entry for this stock doesn't already exist in the
   // chado_stock table if it doesn't exist then we want to add it.
   $check_org_id = chado_get_id_from_nid('stock', $node->nid);
@@ -730,7 +730,7 @@ function tripal_stock_node_presave($node) {
 
   switch ($node->type) {
     // This step is for setting the title for the Drupal node.  This title
-    // is permanent and thus is created to be unique.  Title changes provided 
+    // is permanent and thus is created to be unique.  Title changes provided
     // by tokens are generated on the fly dynamically, but the node title
     // seen in the content listing needs to be set here. Do not call
     // the chado_get_node_title() function here to set the title as the node
@@ -776,52 +776,61 @@ function tripal_stock_node_view($node, $view_mode, $langcode) {
     case 'chado_stock':
       if ($view_mode == 'full') {
         $node->content['tripal_stock_base'] = array(
-          '#markup' => theme('tripal_stock_base', array('node' => $node)),
+          '#theme' => 'tripal_stock_base',
+          '#node' => $node,
           '#tripal_toc_id'    => 'base',
           '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_stock_collections'] = array(
-          '#markup' => theme('tripal_stock_collections', array('node' => $node)),
+          '#theme' => 'tripal_stock_collections',
+          '#node' => $node,
           '#tripal_toc_id'    => 'collections',
           '#tripal_toc_title' => 'Stock Collections',
         );
         $node->content['tripal_stock_properties'] = array(
-          '#markup' => theme('tripal_stock_properties', array('node' => $node)),
+          '#theme' => 'tripal_stock_properties',
+          '#node' => $node,
           '#tripal_toc_id'    => 'properties',
           '#tripal_toc_title' => 'Properties',
         );
         $node->content['tripal_stock_references'] = array(
-          '#markup' => theme('tripal_stock_references', array('node' => $node)),
+          '#theme' => 'tripal_stock_references',
+          '#node' => $node,
           '#tripal_toc_id'    => 'references',
           '#tripal_toc_title' => 'Cross References',
         );
         $node->content['tripal_stock_relationships'] = array(
-          '#markup' => theme('tripal_stock_relationships', array('node' => $node)),
+          '#theme' => 'tripal_stock_relationships',
+          '#node' => $node,
           '#tripal_toc_id'    => 'relationships',
           '#tripal_toc_title' => 'Relationships',
         );
         $node->content['tripal_stock_synonyms'] = array(
-          '#markup' => theme('tripal_stock_synonyms', array('node' => $node)),
+          '#theme' => 'tripal_stock_synonyms',
+          '#node' => $node,
           '#tripal_toc_id'    => 'synonyms',
           '#tripal_toc_title' => 'Synonyms',
         );
         $node->content['tripal_stock_publications'] = array(
-          '#markup' => theme('tripal_stock_publications', array('node' => $node)),
+          '#theme' => 'tripal_stock_publications',
+          '#node' => $node,
           '#tripal_toc_id'    => 'publications',
           '#tripal_toc_title' => 'Publications',
         );
       }
       if ($view_mode == 'teaser') {
         $node->content['tripal_stock_teaser'] = array(
-          '#markup' => theme('tripal_stock_teaser', array('node' => $node)),
+          '#theme' => 'tripal_stock_teaser',
+          '#node' => $node,
         );
       }
       break;
     case 'chado_organism':
       if ($view_mode == 'full') {
         $node->content['tripal_organism_stocks'] = array(
-          '#markup' => theme('tripal_organism_stocks', array('node' => $node)),
+          '#theme' => 'tripal_organism_stocks',
+          '#node' => $node,
           '#tripal_toc_id'    => 'stocks',
           '#tripal_toc_title' => 'Stocks',
         );