Browse Source

Converted all tripal_generate_chado_var and tripal_expand_chado_vars to new API functions

Stephen Ficklin 11 years ago
parent
commit
3147fcb63a
68 changed files with 152 additions and 152 deletions
  1. 1 1
      tripal_analysis/theme/templates/tripal_analysis_base.tpl.php
  2. 1 1
      tripal_analysis/theme/templates/tripal_analysis_properties.tpl.php
  3. 1 1
      tripal_analysis/theme/templates/tripal_analysis_teaser.tpl.php
  4. 2 2
      tripal_contact/theme/templates/tripal_contact_properties.tpl.php
  5. 4 4
      tripal_contact/theme/templates/tripal_contact_publications.tpl.php
  6. 3 3
      tripal_contact/theme/templates/tripal_contact_relationships.tpl.php
  7. 1 1
      tripal_core/api/tripal_core.chado_general.api.inc
  8. 1 1
      tripal_example/includes/tripal_example.chado_node.inc
  9. 1 1
      tripal_example/theme/templates/tripal_example_properties.tpl.php
  10. 7 7
      tripal_example/theme/templates/tripal_example_relationships.tpl.php
  11. 2 2
      tripal_feature/theme/templates/tripal_feature_alignments.tpl.php
  12. 1 1
      tripal_feature/theme/templates/tripal_feature_analyses.tpl.php
  13. 2 2
      tripal_feature/theme/templates/tripal_feature_properties.tpl.php
  14. 4 4
      tripal_feature/theme/templates/tripal_feature_publications.tpl.php
  15. 1 1
      tripal_feature/theme/templates/tripal_feature_references.tpl.php
  16. 3 3
      tripal_feature/theme/templates/tripal_feature_relationships.tpl.php
  17. 3 3
      tripal_feature/theme/templates/tripal_feature_sequence.tpl.php
  18. 1 1
      tripal_feature/theme/templates/tripal_feature_synonyms.tpl.php
  19. 1 1
      tripal_feature/theme/templates/tripal_feature_terms.tpl.php
  20. 1 1
      tripal_feature/theme/templates/tripal_organism_feature_browser.tpl.php
  21. 1 1
      tripal_feature/theme/tripal_feature.theme.inc
  22. 2 2
      tripal_featuremap/theme/templates/tripal_feature_featurepos.tpl.php
  23. 1 1
      tripal_featuremap/theme/templates/tripal_featuremap_base.tpl.php
  24. 2 2
      tripal_featuremap/theme/templates/tripal_featuremap_featurepos.tpl.php
  25. 2 2
      tripal_featuremap/theme/templates/tripal_featuremap_properties.tpl.php
  26. 4 4
      tripal_featuremap/theme/templates/tripal_featuremap_publication.tpl.php
  27. 1 1
      tripal_featuremap/theme/templates/tripal_featuremap_references.tpl.php
  28. 1 1
      tripal_featuremap/theme/templates/tripal_featuremap_teaser.tpl.php
  29. 3 3
      tripal_genetic/theme/templates/tripal_feature_genotypes.tpl.php
  30. 3 3
      tripal_genetic/theme/templates/tripal_stock_genotypes.tpl.php
  31. 1 1
      tripal_library/theme/templates/tripal_feature_libraries.tpl.php
  32. 1 1
      tripal_library/theme/templates/tripal_library_features.tpl.php
  33. 2 2
      tripal_library/theme/templates/tripal_library_properties.tpl.php
  34. 4 4
      tripal_library/theme/templates/tripal_library_publications.tpl.php
  35. 1 1
      tripal_library/theme/templates/tripal_library_references.tpl.php
  36. 1 1
      tripal_library/theme/templates/tripal_library_synonyms.tpl.php
  37. 1 1
      tripal_library/theme/templates/tripal_library_terms.tpl.php
  38. 1 1
      tripal_library/theme/templates/tripal_organism_libraries.tpl.php
  39. 5 5
      tripal_natural_diversity/theme/templates/tripal_feature_nd_genotypes.tpl.php
  40. 3 3
      tripal_natural_diversity/theme/templates/tripal_stock_nd_genotypes.tpl.php
  41. 1 1
      tripal_natural_diversity/theme/templates/tripal_stock_nd_phenotypes.tpl.php
  42. 2 2
      tripal_organism/theme/templates/tripal_organism_properties.tpl.php
  43. 1 1
      tripal_organism/theme/templates/tripal_organism_references.tpl.php
  44. 4 4
      tripal_phenotype/theme/templates/tripal_feature_phenotypes.tpl.php
  45. 3 3
      tripal_project/theme/templates/tripal_project_contact.tpl.php
  46. 2 2
      tripal_project/theme/templates/tripal_project_properties.tpl.php
  47. 4 4
      tripal_project/theme/templates/tripal_project_publications.tpl.php
  48. 3 3
      tripal_project/theme/templates/tripal_project_relationships.tpl.php
  49. 4 4
      tripal_pub/theme/templates/tripal_pub_authors.tpl.php
  50. 11 11
      tripal_pub/theme/templates/tripal_pub_base.tpl.php
  51. 1 1
      tripal_pub/theme/templates/tripal_pub_featuremaps.tpl.php
  52. 1 1
      tripal_pub/theme/templates/tripal_pub_features.tpl.php
  53. 1 1
      tripal_pub/theme/templates/tripal_pub_libraries.tpl.php
  54. 1 1
      tripal_pub/theme/templates/tripal_pub_projects.tpl.php
  55. 2 2
      tripal_pub/theme/templates/tripal_pub_properties.tpl.php
  56. 1 1
      tripal_pub/theme/templates/tripal_pub_references.tpl.php
  57. 7 7
      tripal_pub/theme/templates/tripal_pub_relationships.tpl.php
  58. 1 1
      tripal_pub/theme/templates/tripal_pub_stocks.tpl.php
  59. 4 4
      tripal_pub/theme/templates/tripal_pub_teaser.tpl.php
  60. 1 1
      tripal_stock/theme/templates/tripal_organism_stocks.tpl.php
  61. 2 2
      tripal_stock/theme/templates/tripal_stock_base.tpl.php
  62. 1 1
      tripal_stock/theme/templates/tripal_stock_collections.tpl.php
  63. 3 3
      tripal_stock/theme/templates/tripal_stock_properties.tpl.php
  64. 4 4
      tripal_stock/theme/templates/tripal_stock_publications.tpl.php
  65. 1 1
      tripal_stock/theme/templates/tripal_stock_references.tpl.php
  66. 3 3
      tripal_stock/theme/templates/tripal_stock_relationships.tpl.php
  67. 1 1
      tripal_stock/theme/templates/tripal_stock_synonyms.tpl.php
  68. 1 1
      tripal_stock/theme/templates/tripal_stock_teaser.tpl.php

+ 1 - 1
tripal_analysis/theme/templates/tripal_analysis_base.tpl.php

@@ -1,6 +1,6 @@
 <?php
 $analysis = $variables['node']->analysis;
-$analysis = tripal_core_expand_chado_vars($analysis,'field','analysis.description'); ?>
+$analysis = chado_expand_var($analysis,'field','analysis.description'); ?>
 
 <div class="tripal__analysis-data-block-desc tripal-data-block-desc"></div><?php 
   

+ 1 - 1
tripal_analysis/theme/templates/tripal_analysis_properties.tpl.php

@@ -2,7 +2,7 @@
 
 // get the analysis object and expand it to include the records from the analysisprop table
 $analysis = $variables['node']->analysis;
-$analysis = tripal_core_expand_chado_vars($analysis,'table', 'analysisprop', array('return_array' => 1));
+$analysis = chado_expand_var($analysis,'table', 'analysisprop', array('return_array' => 1));
 $properties = $analysis->analysisprop;
 
 if (count($properties) > 0) { ?>

+ 1 - 1
tripal_analysis/theme/templates/tripal_analysis_teaser.tpl.php

@@ -1,7 +1,7 @@
 <?php
 $node = $variables['node'];
 $analysis = $variables['node']->analysis;
-$analysis = tripal_core_expand_chado_vars($analysis,'field','analysis.description'); ?>
+$analysis = chado_expand_var($analysis,'field','analysis.description'); ?>
 
 <div class="tripal_analysis_blast-teaser tripal-teaser"> 
   <div class="tripal-analysis-blast-teaser-title tripal-teaser-title"><?php 

+ 2 - 2
tripal_contact/theme/templates/tripal_contact_properties.tpl.php

@@ -2,7 +2,7 @@
 
 // expand the contact to include the properties.
 $contact = $variables['node']->contact;
-$contact = tripal_core_expand_chado_vars($contact,'table', 'contactprop', array('return_array' => 1));
+$contact = chado_expand_var($contact,'table', 'contactprop', array('return_array' => 1));
 $contactprops = $contact->contactprop;
 
 // put the properties in an array so we can remove the contact_description property
@@ -12,7 +12,7 @@ if ($contactprops) {
     // we want to keep all properties but the contact_description as that
     // property is shown on the base template page.
     if($property->type_id->name != 'contact_description') {
-      $property = tripal_core_expand_chado_vars($property,'field','contactprop.value');
+      $property = chado_expand_var($property,'field','contactprop.value');
       $properties[] = $property;
     }
   }

+ 4 - 4
tripal_contact/theme/templates/tripal_contact_publications.tpl.php

@@ -3,7 +3,7 @@ $contact = $variables['node']->contact;
 
 // expand contact to include pubs 
 $options = array('return_array' => 1);
-$contact = tripal_core_expand_chado_vars($contact, 'table', 'pubauthor_contact', $options);
+$contact = chado_expand_var($contact, 'table', 'pubauthor_contact', $options);
 $pubauthor_contacts = $contact->pubauthor_contact; 
 
 
@@ -23,7 +23,7 @@ if (count($pubauthor_contacts) > 0) { ?>
   
   foreach ($pubauthor_contacts as $pubauthor_contact) {
     $pub = $pubauthor_contact->pubauthor_id->pub_id;
-    $pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.title');
+    $pub = chado_expand_var($pub, 'field', 'pub.title');
     $citation = $pub->title;  // use the title as the default citation
     
     // get the citation for this pub if it exists
@@ -34,9 +34,9 @@ if (count($pubauthor_contacts) > 0) { ?>
       ),
     );
     $options = array('return_array' => 1);
-    $citation_prop = tripal_core_generate_chado_var('pubprop', $values, $options); 
+    $citation_prop = chado_generate_var('pubprop', $values, $options); 
     if (count($citation_prop) == 1) {
-      $citation_prop = tripal_core_expand_chado_vars($citation_prop, 'field', 'pubprop.value');
+      $citation_prop = chado_expand_var($citation_prop, 'field', 'pubprop.value');
       $citation = $citation_prop[0]->value;
     }
     

+ 3 - 3
tripal_contact/theme/templates/tripal_contact_relationships.tpl.php

@@ -1,12 +1,12 @@
 <?php
 /* Typically in a Tripal template, the data needed is retrieved using a call to
- * tripal_core_expand_chado_vars function.  For example, to retrieve all 
+ * chado_expand_var function.  For example, to retrieve all 
  * of the contact relationships for this node, the following function call would be made:
  * 
- *   $contact = tripal_core_expand_chado_vars($contact,'table','contact_relationship');
+ *   $contact = chado_expand_var($contact,'table','contact_relationship');
  * 
  * However, this function call can be extremely slow when there are numerous relationships.
- * This is because the tripal_core_expand_chado_vars function is recursive and expands 
+ * This is because the chado_expand_var function is recursive and expands 
  * all data following the foreign key relationships tree.  Therefore, to speed retrieval
  * of data, a special variable is provided to this template:
  * 

+ 1 - 1
tripal_core/api/tripal_core.chado_general.api.inc

@@ -18,7 +18,7 @@ require_once 'tripal_core.schema_v1.11.api.inc';
  * for inserts and updates.
  *
  * Also, a set of functions is provided for creating template variables.  First,
- * is the tripal_core_generate_chado_vars which is used to select one ore more
+ * is the chado_generate_var which is used to select one ore more
  * records from a table and return an array with foreign key relationships fully
  * populated.  For example, if selecting a feature, the organism_id and type_id
  * would be present in the returned array as a nested array with their respective

+ 1 - 1
tripal_example/includes/tripal_example.chado_node.inc

@@ -566,7 +566,7 @@ function chado_example_load($nodes) {
     $example = chado_generate_var('example', $values);
 
     // for fields in the table that are of type 'text' you may want to include those
-    // by default, the tripal_core_generate_chado_var does not include text fields as
+    // by default, the chado_generate_var does not include text fields as
     // they may be very large and including a large text field can slow the page load.
     // If you know a text field will never be large and it is important for the
     // other functions that will see the node to have access to a field you can

+ 1 - 1
tripal_example/theme/templates/tripal_example_properties.tpl.php

@@ -6,7 +6,7 @@ $options = array(
   'return_array' => 1,
   'order_by' => array('rank' => 'ASC'),
 );
-$example = tripal_core_expand_chado_vars($example,'table', 'exampleprop', $options);
+$example = chado_expand_var($example,'table', 'exampleprop', $options);
 $exampleprops = $example->exampleprop;
 $properties = array();
 

+ 7 - 7
tripal_example/theme/templates/tripal_example_relationships.tpl.php

@@ -1,12 +1,12 @@
 <?php
 /* Typically in a Tripal template, the data needed is retrieved using a call to
- * tripal_core_expand_chado_vars function.  For example, to retrieve all 
+ * chado_expand_var function.  For example, to retrieve all 
  * of the example relationships for this node, the following function call would be made:
  * 
- *   $example = tripal_core_expand_chado_vars($example,'table','example_relationship');
+ *   $example = chado_expand_var($example,'table','example_relationship');
  * 
  * However, this function call can be extremely slow when there are numerous relationships.
- * This is because the tripal_core_expand_chado_vars function is recursive and expands 
+ * This is because the chado_expand_var function is recursive and expands 
  * all data following the foreign key relationships tree.  Therefore, to speed retrieval
  * of data, a special variable is provided to this template:
  * 
@@ -55,8 +55,8 @@ if (count($object_rels) > 0 or count($subject_rels) > 0) { ?>
             'name' => 'Citation',
           ),
         );
-        $citation = tripal_core_generate_chado_var('exampleprop', $values);
-        $citation = tripal_core_expand_chado_vars($citation, 'field', 'exampleprop.value');
+        $citation = chado_generate_var('exampleprop', $values);
+        $citation = chado_expand_var($citation, 'field', 'exampleprop.value');
         
         $rows[] = array(
           $title . '<br>' . htmlspecialchars($citation->value),
@@ -116,8 +116,8 @@ if (count($object_rels) > 0 or count($subject_rels) > 0) { ?>
             'name' => 'Citation',
           ),
         );
-        $citation = tripal_core_generate_chado_var('exampleprop', $values);
-        $citation = tripal_core_expand_chado_vars($citation, 'field', 'exampleprop.value');
+        $citation = chado_generate_var('exampleprop', $values);
+        $citation = chado_expand_var($citation, 'field', 'exampleprop.value');
         
         $rows[] = array(
           $title . '<br>' . htmlspecialchars($citation->value),

+ 2 - 2
tripal_feature/theme/templates/tripal_feature_alignments.tpl.php

@@ -1,10 +1,10 @@
 <?php
 /*
 * Typically in a Tripal template, the data needed is retrieved using a call to
-* tripal_core_expand_chado_vars function.  For example, to retrieve all 
+* chado_expand_var function.  For example, to retrieve all 
 * of the feature alignments for this node, the following function call would be made:
 * 
-*   $feature = tripal_core_expand_chado_vars($feature,'table','featureloc');
+*   $feature = chado_expand_var($feature,'table','featureloc');
 *   
 * However, this will return all records from the featureloc table without any context.
 * To help provide context, a special variable is provided to this template named

+ 1 - 1
tripal_feature/theme/templates/tripal_feature_analyses.tpl.php

@@ -1,7 +1,7 @@
 <?php
 $feature = $variables['node']->feature;
 $options = array('return_array' => 1);
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'analysisfeature', $options);
+$feature = chado_expand_var($feature, 'table', 'analysisfeature', $options);
 $analyses = $feature->analysisfeature;
 
 // don't show this page if there are no analyses

+ 2 - 2
tripal_feature/theme/templates/tripal_feature_properties.tpl.php

@@ -2,7 +2,7 @@
 
 $feature = $variables['node']->feature;
 $options = array('return_array' => 1);
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'featureprop', $options);
+$feature = chado_expand_var($feature, 'table', 'featureprop', $options);
 $properties = $feature->featureprop;
 
 if(count($properties) > 0){ 
@@ -19,7 +19,7 @@ if(count($properties) > 0){
   $rows = array();
   
   foreach ($properties as $property){
-    $property = tripal_core_expand_chado_vars($property,'field','featureprop.value');
+    $property = chado_expand_var($property,'field','featureprop.value');
     $rows[] = array(
       array(
         'data' => ucfirst(preg_replace('/_/', ' ', $property->type_id->name)),

+ 4 - 4
tripal_feature/theme/templates/tripal_feature_publications.tpl.php

@@ -3,7 +3,7 @@ $feature = $variables['node']->feature;
 
 // expand feature to include pubs 
 $options = array('return_array' => 1);
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'feature_pub', $options);
+$feature = chado_expand_var($feature, 'table', 'feature_pub', $options);
 $feature_pubs = $feature->feature_pub; 
 
 
@@ -23,7 +23,7 @@ if (count($feature_pubs) > 0) { ?>
   
   foreach ($feature_pubs as $feature_pub) {
     $pub = $feature_pub->pub_id;
-    $pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.title');
+    $pub = chado_expand_var($pub, 'field', 'pub.title');
     $citation = $pub->title;  // use the title as the default citation
     
     // get the citation for this pub if it exists
@@ -34,9 +34,9 @@ if (count($feature_pubs) > 0) { ?>
       ),
     );
     $options = array('return_array' => 1);
-    $citation_prop = tripal_core_generate_chado_var('pubprop', $values, $options); 
+    $citation_prop = chado_generate_var('pubprop', $values, $options); 
     if (count($citation_prop) == 1) {
-      $citation_prop = tripal_core_expand_chado_vars($citation_prop, 'field', 'pubprop.value');
+      $citation_prop = chado_expand_var($citation_prop, 'field', 'pubprop.value');
       $citation = $citation_prop[0]->value;
     }
     

+ 1 - 1
tripal_feature/theme/templates/tripal_feature_references.tpl.php

@@ -10,7 +10,7 @@ if ($feature->dbxref_id) {
 
 // Second, expand the feature object to include the records from the feature_dbxref table
 $options = array('return_array' => 1);
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'feature_dbxref', $options);
+$feature = chado_expand_var($feature, 'table', 'feature_dbxref', $options);
 $feature_dbxrefs = $feature->feature_dbxref;
 if (count($feature_dbxrefs) > 0 ) {
   foreach ($feature_dbxrefs as $feature_dbxref) {    

+ 3 - 3
tripal_feature/theme/templates/tripal_feature_relationships.tpl.php

@@ -1,12 +1,12 @@
 <?php
 /* Typically in a Tripal template, the data needed is retrieved using a call to
- * tripal_core_expand_chado_vars function.  For example, to retrieve all 
+ * chado_expand_var function.  For example, to retrieve all 
  * of the feature relationships for this node, the following function call would be made:
  * 
- *   $feature = tripal_core_expand_chado_vars($feature,'table','feature_relationship');
+ *   $feature = chado_expand_var($feature,'table','feature_relationship');
  * 
  * However, this function call can be extremely slow when there are numerous relationships.
- * This is because the tripal_core_expand_chado_vars function is recursive and expands 
+ * This is because the chado_expand_var function is recursive and expands 
  * all data following the foreign key relationships tree.  Therefore, to speed retrieval
  * of data, a special variable is provided to this template:
  * 

+ 3 - 3
tripal_feature/theme/templates/tripal_feature_sequence.tpl.php

@@ -5,11 +5,11 @@
  * This template will show both or one or the other depending on the data available.
  * 
  * For retreiving the sequence from an alignment we would typically make a call to
- * tripal_core_expand_chado_vars function.  For example, to retrieve all
+ * chado_expand_var function.  For example, to retrieve all
  * of the featurelocs in order to get the sequences needed for this template, the
  * following function call would be made:
  *
- *   $feature = tripal_core_expand_chado_vars($feature,'table','featureloc');
+ *   $feature = chado_expand_var($feature,'table','featureloc');
  *
  * Then all of the sequences would need to be retreived from the alignments and
  * formatted for display below.  However, to simplify this template, this has already
@@ -30,7 +30,7 @@ if(strcmp($feature->type_id->name,'scaffold') !=0 and
    strcmp($feature->type_id->name,'chromosome') !=0 and
    strcmp($feature->type_id->name,'supercontig') !=0 and
    strcmp($feature->type_id->name,'pseudomolecule') !=0) {
-  $feature = tripal_core_expand_chado_vars($feature,'field','feature.residues');
+  $feature = chado_expand_var($feature,'field','feature.residues');
   $residues = $feature->residues;
 } 
 

+ 1 - 1
tripal_feature/theme/templates/tripal_feature_synonyms.tpl.php

@@ -4,7 +4,7 @@ $feature = $variables['node']->feature;
 // expand the feature object to include the synonyms from the feature_synonym 
 // table in chado.
 $options = array('return_array' => 1);
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'feature_synonym', $options);
+$feature = chado_expand_var($feature, 'table', 'feature_synonym', $options);
 $synonyms = $feature->feature_synonym;
 
 if(count($synonyms) > 0){ ?>

+ 1 - 1
tripal_feature/theme/templates/tripal_feature_terms.tpl.php

@@ -3,7 +3,7 @@
 $feature = $variables['node']->feature;
 
 $options = array('return_array' => 1);
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'feature_cvterm', $options);
+$feature = chado_expand_var($feature, 'table', 'feature_cvterm', $options);
 $terms = $feature->feature_cvterm;
 
 // order the terms by CV

+ 1 - 1
tripal_feature/theme/templates/tripal_organism_feature_browser.tpl.php

@@ -43,7 +43,7 @@ foreach ($results as $result) {
       'type_id' => 1
     )
   );
-  $features[] = tripal_core_generate_chado_var('feature', $values, $options);
+  $features[] = chado_generate_var('feature', $values, $options);
 }
 
 if (count($features) > 0) { ?>

+ 1 - 1
tripal_feature/theme/tripal_feature.theme.inc

@@ -182,7 +182,7 @@ function tripal_feature_preprocess_tripal_organism_feature_counts(&$variables, $
 }
 
 /**
- * Using the tripal_core_expand_chado_vars function to retrieve a set
+ * Using the chado_expand_var function to retrieve a set
  * of relationships can be very slow, especialy if there are many relationships
  * This function is intended to help speed up the retrieval of relationships
  * by only retrieving the base information for the relationship and returning

+ 2 - 2
tripal_featuremap/theme/templates/tripal_feature_featurepos.tpl.php

@@ -27,7 +27,7 @@ $options = array(
   ),
 );
 
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'featurepos', $options);
+$feature = chado_expand_var($feature, 'table', 'featurepos', $options);
 
 // because the featurepos table has  FK relationships with map_feature_id and feature_id with the feature table 
 // the function call above will try to expand both and will create an array of matches for each FK.
@@ -64,7 +64,7 @@ if(count($map_positions) > 0){ ?>
         'type_id' => 1,            
       ),
     );
-    $position = tripal_core_expand_chado_vars($position, 'table', 'featureposprop', $options);
+    $position = chado_expand_var($position, 'table', 'featureposprop', $options);
     $featureposprop = $position->featureposprop;
     $start = '';
     $stop = '';

+ 1 - 1
tripal_featuremap/theme/templates/tripal_featuremap_base.tpl.php

@@ -3,7 +3,7 @@
 $featuremap  = $variables['node']->featuremap;
 
 // expand the description field
-$featuremap = tripal_core_expand_chado_vars($featuremap, 'field', 'featuremap.description'); ?>
+$featuremap = chado_expand_var($featuremap, 'field', 'featuremap.description'); ?>
 
 <div class="tripal_featuremap-data-block-desc tripal-data-block-desc"></div> <?php 
 

+ 2 - 2
tripal_featuremap/theme/templates/tripal_featuremap_featurepos.tpl.php

@@ -29,7 +29,7 @@ $options = array(
   ),
 );
 
-$featuremap = tripal_core_expand_chado_vars($featuremap, 'table', 'featurepos', $options);
+$featuremap = chado_expand_var($featuremap, 'table', 'featurepos', $options);
 $feature_positions = $featuremap->featurepos;
 
 
@@ -64,7 +64,7 @@ if(count($feature_positions) > 0){ ?>
         'type_id' => 1,            
       ),
     );
-    $position = tripal_core_expand_chado_vars($position, 'table', 'featureposprop', $options);
+    $position = chado_expand_var($position, 'table', 'featureposprop', $options);
     $featureposprop = $position->featureposprop;
     $start = 0;
     $stop = 0;

+ 2 - 2
tripal_featuremap/theme/templates/tripal_featuremap_properties.tpl.php

@@ -2,7 +2,7 @@
 
 $featuremap = $variables['node']->featuremap;
 $options = array('return_array' => 1);
-$featuremap = tripal_core_expand_chado_vars($featuremap, 'table', 'featuremapprop', $options);
+$featuremap = chado_expand_var($featuremap, 'table', 'featuremapprop', $options);
 $properties = $featuremap->featuremapprop;
 
 if(count($properties) > 0){
@@ -18,7 +18,7 @@ if(count($properties) > 0){
   $rows = array();
 
   foreach ($properties as $property){
-    $property = tripal_core_expand_chado_vars($property,'field','featuremapprop.value');
+    $property = chado_expand_var($property,'field','featuremapprop.value');
     $rows[] = array(
       ucfirst(preg_replace('/_/', ' ', $property->type_id->name)),
       urldecode($property->value)

+ 4 - 4
tripal_featuremap/theme/templates/tripal_featuremap_publication.tpl.php

@@ -3,7 +3,7 @@ $featuremap = $variables['node']->featuremap;
 
 // expand featuremap to include pubs 
 $options = array('return_array' => 1);
-$featuremap = tripal_core_expand_chado_vars($featuremap, 'table', 'featuremap_pub', $options);
+$featuremap = chado_expand_var($featuremap, 'table', 'featuremap_pub', $options);
 $featuremap_pubs = $featuremap->featuremap_pub; 
 
 
@@ -23,7 +23,7 @@ if (count($featuremap_pubs) > 0) { ?>
   
   foreach ($featuremap_pubs as $featuremap_pub) {
     $pub = $featuremap_pub->pub_id;
-    $pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.title');
+    $pub = chado_expand_var($pub, 'field', 'pub.title');
     $citation = $pub->title;  // use the title as the default citation
     
     // get the citation for this pub if it exists
@@ -34,9 +34,9 @@ if (count($featuremap_pubs) > 0) { ?>
       ),
     );
     $options = array('return_array' => 1);
-    $citation_prop = tripal_core_generate_chado_var('pubprop', $values, $options); 
+    $citation_prop = chado_generate_var('pubprop', $values, $options); 
     if (count($citation_prop) == 1) {
-      $citation_prop = tripal_core_expand_chado_vars($citation_prop, 'field', 'pubprop.value');
+      $citation_prop = chado_expand_var($citation_prop, 'field', 'pubprop.value');
       $citation = $citation_prop[0]->value;
     }
     

+ 1 - 1
tripal_featuremap/theme/templates/tripal_featuremap_references.tpl.php

@@ -4,7 +4,7 @@ $references = array();
 
 // expand the featuremap object to include the records from the featuremap_dbxref table
 $options = array('return_array' => 1);
-$featuremap = tripal_core_expand_chado_vars($featuremap, 'table', 'featuremap_dbxref', $options);
+$featuremap = chado_expand_var($featuremap, 'table', 'featuremap_dbxref', $options);
 $featuremap_dbxrefs = $featuremap->featuremap_dbxref;
 if (count($featuremap_dbxrefs) > 0 ) {
   foreach ($featuremap_dbxrefs as $featuremap_dbxref) {    

+ 1 - 1
tripal_featuremap/theme/templates/tripal_featuremap_teaser.tpl.php

@@ -1,7 +1,7 @@
 <?php
 $node = $variables['node'];
 $featuremap = $variables['node']->featuremap;
-$featuremap = tripal_core_expand_chado_vars($featuremap,'field','featuremap.description'); ?>
+$featuremap = chado_expand_var($featuremap,'field','featuremap.description'); ?>
 
 <div class="tripal_featuremap-teaser tripal-teaser"> 
   <div class="tripal-featuremap-teaser-title tripal-teaser-title"><?php 

+ 3 - 3
tripal_genetic/theme/templates/tripal_feature_genotypes.tpl.php

@@ -36,7 +36,7 @@ $options = array(
     'element' => $feature_pager_id
   ),
 );
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'feature_genotype', $options); 
+$feature = chado_expand_var($feature, 'table', 'feature_genotype', $options); 
 $feature_genotypes = $feature->feature_genotype->feature_id;
 
 // get the total number of records
@@ -74,7 +74,7 @@ if (count($feature_genotypes) > 0) {?>
     
     // get the genotype properties
     $options = array('return_array' => 1);
-    $genotype = tripal_core_expand_chado_vars($genotype, 'table', 'genotypeprop', $options);
+    $genotype = chado_expand_var($genotype, 'table', 'genotypeprop', $options);
     $properties = $genotype->genotypeprop; 
     $details = '';
     if(count($properties) > 0) {
@@ -93,7 +93,7 @@ if (count($feature_genotypes) > 0) {?>
         )
       ),
     );
-    $genotype = tripal_core_expand_chado_vars($genotype, 'table', 'stock_genotype', $options);
+    $genotype = chado_expand_var($genotype, 'table', 'stock_genotype', $options);
     $stock_genotypes = $genotype->stock_genotype; 
 
     // build the list of germplasm.

+ 3 - 3
tripal_genetic/theme/templates/tripal_stock_genotypes.tpl.php

@@ -29,7 +29,7 @@ $options = array(
     'genotype_id' => 1
   ),
 );
-$stock = tripal_core_expand_chado_vars($stock, 'table', 'stock_genotype', $options); 
+$stock = chado_expand_var($stock, 'table', 'stock_genotype', $options); 
 $stock_genotypes = $stock->stock_genotype;
 
 // get the total number of records
@@ -55,7 +55,7 @@ if (count($stock_genotypes) > 0) {?>
     
     // get the genotype properties
     $options = array('return_array' => 1);
-    $genotype = tripal_core_expand_chado_vars($genotype, 'table', 'genotypeprop', $options);
+    $genotype = chado_expand_var($genotype, 'table', 'genotypeprop', $options);
     $properties = $genotype->genotypeprop; 
     
     // add in markers associated with this genotype if any
@@ -67,7 +67,7 @@ if (count($stock_genotypes) > 0) {?>
         )
       ),
     );
-    $genotype = tripal_core_expand_chado_vars($genotype, 'table', 'feature_genotype', $options);
+    $genotype = chado_expand_var($genotype, 'table', 'feature_genotype', $options);
     $feature_genotypes = $genotype->feature_genotype; 
     
     // show the uniquename for the genotype unless a name exists

+ 1 - 1
tripal_library/theme/templates/tripal_feature_libraries.tpl.php

@@ -4,7 +4,7 @@ $feature = $variables['node']->feature;
 // expand the feature object to include the libraries from the library
 // table in chado.
 $options = array('return_array' => 1);
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'library_feature', $options);
+$feature = chado_expand_var($feature, 'table', 'library_feature', $options);
 $library_features = $feature->library_feature;
 
 

+ 1 - 1
tripal_library/theme/templates/tripal_library_features.tpl.php

@@ -32,7 +32,7 @@ foreach ($results as $library_feature) {
       'type_id' => 1
     )
   );
-  $features[] = tripal_core_generate_chado_var('feature', $values, $options);
+  $features[] = chado_generate_var('feature', $values, $options);
 }
 
 if (count($features) > 0) { ?>

+ 2 - 2
tripal_library/theme/templates/tripal_library_properties.tpl.php

@@ -2,7 +2,7 @@
 
 $library = $variables['node']->library;
 $options = array('return_array' => 1);
-$library = tripal_core_expand_chado_vars($library, 'table', 'libraryprop', $options);
+$library = chado_expand_var($library, 'table', 'libraryprop', $options);
 $props = $library->libraryprop;
 
 // iterate through the properties and remove the 'library_description' as it is
@@ -29,7 +29,7 @@ if(count($properties) > 0){
   $rows = array();
   
   foreach ($properties as $property){
-    $property = tripal_core_expand_chado_vars($property,'field','libraryprop.value');
+    $property = chado_expand_var($property,'field','libraryprop.value');
     $rows[] = array(
       ucfirst(preg_replace('/_/', ' ', $property->type_id->name)),
       urldecode($property->value)

+ 4 - 4
tripal_library/theme/templates/tripal_library_publications.tpl.php

@@ -3,7 +3,7 @@ $library = $variables['node']->library;
 
 // expand library to include pubs 
 $options = array('return_array' => 1);
-$library = tripal_core_expand_chado_vars($library, 'table', 'library_pub', $options);
+$library = chado_expand_var($library, 'table', 'library_pub', $options);
 $library_pubs = $library->library_pub; 
 
 
@@ -23,7 +23,7 @@ if (count($library_pubs) > 0) { ?>
   
   foreach ($library_pubs as $library_pub) {
     $pub = $library_pub->pub_id;
-    $pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.title');
+    $pub = chado_expand_var($pub, 'field', 'pub.title');
     $citation = $pub->title;  // use the title as the default citation
     
     // get the citation for this pub if it exists
@@ -34,9 +34,9 @@ if (count($library_pubs) > 0) { ?>
       ),
     );
     $options = array('return_array' => 1);
-    $citation_prop = tripal_core_generate_chado_var('pubprop', $values, $options); 
+    $citation_prop = chado_generate_var('pubprop', $values, $options); 
     if (count($citation_prop) == 1) {
-      $citation_prop = tripal_core_expand_chado_vars($citation_prop, 'field', 'pubprop.value');
+      $citation_prop = chado_expand_var($citation_prop, 'field', 'pubprop.value');
       $citation = $citation_prop[0]->value;
     }
     

+ 1 - 1
tripal_library/theme/templates/tripal_library_references.tpl.php

@@ -4,7 +4,7 @@ $references = array();
 
 // Second, expand the library object to include the records from the library_dbxref table
 $options = array('return_array' => 1);
-$library = tripal_core_expand_chado_vars($library, 'table', 'library_dbxref', $options);
+$library = chado_expand_var($library, 'table', 'library_dbxref', $options);
 $library_dbxrefs = $library->library_dbxref;
 if (count($library_dbxrefs) > 0 ) {
   foreach ($library_dbxrefs as $library_dbxref) {    

+ 1 - 1
tripal_library/theme/templates/tripal_library_synonyms.tpl.php

@@ -4,7 +4,7 @@ $library = $variables['node']->library;
 // expand the library object to include the synonyms from the library_synonym 
 // table in chado.
 $options = array('return_array' => 1);
-$library = tripal_core_expand_chado_vars($library, 'table', 'library_synonym', $options);
+$library = chado_expand_var($library, 'table', 'library_synonym', $options);
 $synonyms = $library->library_synonym;
 
 if(count($synonyms) > 0){ ?>

+ 1 - 1
tripal_library/theme/templates/tripal_library_terms.tpl.php

@@ -3,7 +3,7 @@
 $library = $variables['node']->library;
 
 $options = array('return_array' => 1);
-$library = tripal_core_expand_chado_vars($library, 'table', 'library_cvterm', $options);
+$library = chado_expand_var($library, 'table', 'library_cvterm', $options);
 $terms = $library->library_cvterm;
 
 // order the terms by CV

+ 1 - 1
tripal_library/theme/templates/tripal_organism_libraries.tpl.php

@@ -4,7 +4,7 @@ $organism = $variables['node']->organism;
 // expand the organism object to include the libraries from the library
 // table in chado.
 $options = array('return_array' => 1);
-$organism = tripal_core_expand_chado_vars($organism, 'table', 'library', $options);
+$organism = chado_expand_var($organism, 'table', 'library', $options);
 $libraries = $organism->library;
 
 

+ 5 - 5
tripal_natural_diversity/theme/templates/tripal_feature_nd_genotypes.tpl.php

@@ -59,7 +59,7 @@ $options = array(
     'element' => $feature_pager_id
   ),
 );
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'feature_genotype', $options);
+$feature = chado_expand_var($feature, 'table', 'feature_genotype', $options);
 $feature_genotypes = $feature->feature_genotype->feature_id;
 
 // get the total number of records
@@ -102,7 +102,7 @@ if (count($feature_genotypes) > 0) { ?>
 
     // build the genotype properties
     $options = array('return_array' => 1);
-    $genotype = tripal_core_expand_chado_vars($genotype, 'table', 'genotypeprop', $options);
+    $genotype = chado_expand_var($genotype, 'table', 'genotypeprop', $options);
     $properties = $genotype->genotypeprop;
     $details = '';
     if(count($properties) > 0) {
@@ -114,7 +114,7 @@ if (count($feature_genotypes) > 0) { ?>
 
     // get the nd_experiment_genotype records and if any
     $values = array('genotype_id' => $genotype->genotype_id);
-    $nd_experiment_genotype = tripal_core_generate_chado_var('nd_experiment_genotype', $values);
+    $nd_experiment_genotype = chado_generate_var('nd_experiment_genotype', $values);
     if ($nd_experiment_genotype) {
       $nd_experiment    = $nd_experiment_genotype->nd_experiment_id;
       $nd_experiment_id = $nd_experiment_genotype->nd_experiment_id->nd_experiment_id;
@@ -129,7 +129,7 @@ if (count($feature_genotypes) > 0) { ?>
           )
         ),
       );
-      $nd_experiment = tripal_core_expand_chado_vars($nd_experiment, 'table', 'nd_experiment_stock', $options);
+      $nd_experiment = chado_expand_var($nd_experiment, 'table', 'nd_experiment_stock', $options);
       $nd_experiment_stocks = $nd_experiment->nd_experiment_stock;
       if (count($nd_experiment_stocks) > 0) {
         $stock_names = '';
@@ -147,7 +147,7 @@ if (count($feature_genotypes) > 0) { ?>
       // expand the nd_experiment object to incldue the nd_experiment_project table
       $values = array('nd_experiment_id' => $nd_experiment_id);
       $options = array('return_array' => 1);
-      $nd_experiment = tripal_core_expand_chado_vars($nd_experiment, 'table', 'nd_experiment_project', $options);
+      $nd_experiment = chado_expand_var($nd_experiment, 'table', 'nd_experiment_project', $options);
       $nd_experiment_projects = $nd_experiment->nd_experiment_project;
       if (count($nd_experiment_projects) > 0) {
         $project_names = '';

+ 3 - 3
tripal_natural_diversity/theme/templates/tripal_stock_nd_genotypes.tpl.php

@@ -138,7 +138,7 @@ if (count($genotypes) > 0) { ?>
 
     // build the genotype properties
     $options = array('return_array' => 1);
-    $genotype = tripal_core_expand_chado_vars($genotype, 'table', 'genotypeprop', $options);
+    $genotype = chado_expand_var($genotype, 'table', 'genotypeprop', $options);
     $properties = $genotype->genotypeprop;
     $details = '';
     if(count($properties) > 0) {
@@ -159,7 +159,7 @@ if (count($genotypes) > 0) { ?>
         )
       ),
     );
-    $genotype = tripal_core_expand_chado_vars($genotype, 'table', 'feature_genotype', $options);
+    $genotype = chado_expand_var($genotype, 'table', 'feature_genotype', $options);
     $feature_genotypes = $genotype->feature_genotype;
     if (count($feature_genotypes) > 0) {
       $feature_names = '';
@@ -177,7 +177,7 @@ if (count($genotypes) > 0) { ?>
     // expand the nd_experiment object to incldue the nd_experiment_project table
     $values = array('nd_experiment_id' => $nd_experiment_id);
     $options = array('return_array' => 1);
-    $nd_experiment = tripal_core_expand_chado_vars($nd_experiment, 'table', 'nd_experiment_project', $options);
+    $nd_experiment = chado_expand_var($nd_experiment, 'table', 'nd_experiment_project', $options);
     $nd_experiment_projects = $nd_experiment->nd_experiment_project;
     if (count($nd_experiment_projects) > 0) {
       $project_names = '';

+ 1 - 1
tripal_natural_diversity/theme/templates/tripal_stock_nd_phenotypes.tpl.php

@@ -137,7 +137,7 @@ if (count($phenotypes) > 0) {?>
     // but the database does not constrain that there only be one project so just in case we get them all
     $projects = array();
     $values = array('nd_experiment_id' => $nd_experiment_stock->nd_experiment_id->nd_experiment_id);
-    $nd_experiment_project = tripal_core_generate_chado_var('nd_experiment_project', $values, $options);
+    $nd_experiment_project = chado_generate_var('nd_experiment_project', $values, $options);
     $nd_experiment_projects = $nd_experiment_project;
     foreach ($nd_experiment_projects as $nd_experiment_project) {
       // we do have a project record, so add it to our $phenotypes array for display below

+ 2 - 2
tripal_organism/theme/templates/tripal_organism_properties.tpl.php

@@ -2,7 +2,7 @@
 
 $organism = $variables['node']->organism;
 $options = array('return_array' => 1);
-$organism = tripal_core_expand_chado_vars($organism, 'table', 'organismprop', $options);
+$organism = chado_expand_var($organism, 'table', 'organismprop', $options);
 $properties = $organism->organismprop;
 
 if(count($properties) > 0){ 
@@ -19,7 +19,7 @@ if(count($properties) > 0){
   $rows = array();
   
   foreach ($properties as $property){
-    $property = tripal_core_expand_chado_vars($property,'field','organismprop.value');
+    $property = chado_expand_var($property,'field','organismprop.value');
     $rows[] = array(
       ucfirst(preg_replace('/_/', ' ', $property->type_id->name)),
       urldecode($property->value)

+ 1 - 1
tripal_organism/theme/templates/tripal_organism_references.tpl.php

@@ -4,7 +4,7 @@ $references = array();
 
 // expand the organism object to include the records from the organism_dbxref table
 $options = array('return_array' => 1);
-$organism = tripal_core_expand_chado_vars($organism, 'table', 'organism_dbxref', $options);
+$organism = chado_expand_var($organism, 'table', 'organism_dbxref', $options);
 $organism_dbxrefs = $organism->organism_dbxref;
 if (count($organism_dbxrefs) > 0 ) {
   foreach ($organism_dbxrefs as $organism_dbxref) {    

+ 4 - 4
tripal_phenotype/theme/templates/tripal_feature_phenotypes.tpl.php

@@ -12,7 +12,7 @@ $options = array(
     )
   )
 );
-$feature = tripal_core_expand_chado_vars($feature, 'table', 'feature_phenotype', $options);
+$feature = chado_expand_var($feature, 'table', 'feature_phenotype', $options);
 $feature_phenotypes = $feature->feature_phenotype;
 
 if(count($feature_phenotypes) > 0){ ?>
@@ -36,9 +36,9 @@ if(count($feature_phenotypes) > 0){ ?>
     
     // expand the text fields
     $options = array('return_array' => 1);
-    $phenotype = tripal_core_expand_chado_vars($phenotype, 'field', 'phenotype.value', $options);
-    $phenotype = tripal_core_expand_chado_vars($phenotype, 'field', 'phenotype.uniquename', $options);
-    $phenotype = tripal_core_expand_chado_vars($phenotype, 'field', 'phenotype.name', $options); 
+    $phenotype = chado_expand_var($phenotype, 'field', 'phenotype.value', $options);
+    $phenotype = chado_expand_var($phenotype, 'field', 'phenotype.uniquename', $options);
+    $phenotype = chado_expand_var($phenotype, 'field', 'phenotype.name', $options); 
     
     // get the phenotype value. If the value is qualitative the cvalue_id will link to a type. 
     // If quantitative we use the value column

+ 3 - 3
tripal_project/theme/templates/tripal_project_contact.tpl.php

@@ -3,7 +3,7 @@ $project = $variables['node']->project;
 
 // expand the project object to include the contacts from the project_contact
 // table in chado.
-$project = tripal_core_expand_chado_vars($project,'table','project_contact', array('return_array' => 1));
+$project = chado_expand_var($project,'table','project_contact', array('return_array' => 1));
 $project_contacts = $project->project_contact;
 
 if (count($project_contacts) > 0) { ?>
@@ -30,10 +30,10 @@ if (count($project_contacts) > 0) { ?>
     // Get some additional details about this contact if they exists.
     $details = '';
     $options = array('return_array' => 1);
-    $contact = tripal_core_expand_chado_vars($contact, 'table', 'contactprop', $options);
+    $contact = chado_expand_var($contact, 'table', 'contactprop', $options);
     $properties = $contact->contactprop;
     $options = array('order_by' => array('rank' => 'ASC'));
-    $properties = tripal_core_expand_chado_vars($properties, 'field', 'contactprop.value', $options);
+    $properties = chado_expand_var($properties, 'field', 'contactprop.value', $options);
     
     if (is_array($properties)) {
       foreach ($properties as $property) {

+ 2 - 2
tripal_project/theme/templates/tripal_project_properties.tpl.php

@@ -2,7 +2,7 @@
 
 // expand the project to include the properties.
 $project = $variables['node']->project;
-$project = tripal_core_expand_chado_vars($project,'table', 'projectprop', array('return_array' => 1));
+$project = chado_expand_var($project,'table', 'projectprop', array('return_array' => 1));
 $projectprops = $project->projectprop;
 
 // put the properties in an array so we can remove the project_description property
@@ -12,7 +12,7 @@ if ($projectprops) {
     // we want to keep all properties but the project_description as that
     // property is shown on the base template page.
     if($property->type_id->name != 'Project Description') {
-      $property = tripal_core_expand_chado_vars($property,'field','projectprop.value');
+      $property = chado_expand_var($property,'field','projectprop.value');
       $properties[] = $property;
     }
   }

+ 4 - 4
tripal_project/theme/templates/tripal_project_publications.tpl.php

@@ -3,7 +3,7 @@ $project = $variables['node']->project;
 
 // expand project to include pubs 
 $options = array('return_array' => 1);
-$project = tripal_core_expand_chado_vars($project, 'table', 'project_pub', $options);
+$project = chado_expand_var($project, 'table', 'project_pub', $options);
 $project_pubs = $project->project_pub; 
 
 
@@ -23,7 +23,7 @@ if (count($project_pubs) > 0) { ?>
   
   foreach ($project_pubs as $project_pub) {
     $pub = $project_pub->pub_id;
-    $pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.title');
+    $pub = chado_expand_var($pub, 'field', 'pub.title');
     $citation = $pub->title;  // use the title as the default citation
     
     // get the citation for this pub if it exists
@@ -34,9 +34,9 @@ if (count($project_pubs) > 0) { ?>
       ),
     );
     $options = array('return_array' => 1);
-    $citation_prop = tripal_core_generate_chado_var('pubprop', $values, $options); 
+    $citation_prop = chado_generate_var('pubprop', $values, $options); 
     if (count($citation_prop) == 1) {
-      $citation_prop = tripal_core_expand_chado_vars($citation_prop, 'field', 'pubprop.value');
+      $citation_prop = chado_expand_var($citation_prop, 'field', 'pubprop.value');
       $citation = $citation_prop[0]->value;
     }
     

+ 3 - 3
tripal_project/theme/templates/tripal_project_relationships.tpl.php

@@ -1,12 +1,12 @@
 <?php
 /* Typically in a Tripal template, the data needed is retrieved using a call to
- * tripal_core_expand_chado_vars function.  For example, to retrieve all 
+ * chado_expand_var function.  For example, to retrieve all 
  * of the project relationships for this node, the following function call would be made:
  * 
- *   $project = tripal_core_expand_chado_vars($project,'table','project_relationship');
+ *   $project = chado_expand_var($project,'table','project_relationship');
  * 
  * However, this function call can be extremely slow when there are numerous relationships.
- * This is because the tripal_core_expand_chado_vars function is recursive and expands 
+ * This is because the chado_expand_var function is recursive and expands 
  * all data following the foreign key relationships tree.  Therefore, to speed retrieval
  * of data, a special variable is provided to this template:
  * 

+ 4 - 4
tripal_pub/theme/templates/tripal_pub_authors.tpl.php

@@ -6,7 +6,7 @@ $options = array(
   'return_array' => 1,
   'order_by' => array('rank' => 'ASC'),
 );
-$pub = tripal_core_expand_chado_vars($pub, 'table', 'pubauthor', $options);
+$pub = chado_expand_var($pub, 'table', 'pubauthor', $options);
 
 // see if we have authors as contacts if so then we'll add this resource
 $authors = $pub->pubauthor;
@@ -22,7 +22,7 @@ if (count($authors) > 0) {
         ),
       ),
     );
-    $author = tripal_core_expand_chado_vars($author, 'table', 'pubauthor_contact', $options);
+    $author = chado_expand_var($author, 'table', 'pubauthor_contact', $options);
     if ($author->pubauthor_contact) {
       $has_contacts = TRUE;
     }
@@ -53,10 +53,10 @@ if ($has_contacts) { ?>
         'type_id' => 1,       
       ),      
     );
-    $contact = tripal_core_expand_chado_vars($contact, 'table', 'contactprop', $options);
+    $contact = chado_expand_var($contact, 'table', 'contactprop', $options);
     $properties = $contact->contactprop;
     $options = array('order_by' => array('rank' => 'ASC'));
-    $properties = tripal_core_expand_chado_vars($properties, 'field', 'contactprop.value', $options); 
+    $properties = chado_expand_var($properties, 'field', 'contactprop.value', $options); 
     
     // link the contact to it's node if one exists
     $contact_name = $author->givennames . " " . $author->surname;

+ 11 - 11
tripal_pub/theme/templates/tripal_pub_base.tpl.php

@@ -15,8 +15,8 @@
 $pub = $variables['node']->pub;
 
 // expand the title
-$pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.title');
-$pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.volumetitle');
+$pub = chado_expand_var($pub, 'field', 'pub.title');
+$pub = chado_expand_var($pub, 'field', 'pub.volumetitle');
 
 // get the citation
 $values = array(
@@ -25,8 +25,8 @@ $values = array(
     'name' => 'Citation',
   ),
 );
-$citation = tripal_core_generate_chado_var('pubprop', $values); 
-$citation = tripal_core_expand_chado_vars($citation, 'field', 'pubprop.value');
+$citation = chado_generate_var('pubprop', $values); 
+$citation = chado_expand_var($citation, 'field', 'pubprop.value');
 
 // get the abstract
 $values = array(
@@ -35,8 +35,8 @@ $values = array(
     'name' => 'Abstract',
   ),
 );
-$abstract = tripal_core_generate_chado_var('pubprop', $values); 
-$abstract = tripal_core_expand_chado_vars($abstract, 'field', 'pubprop.value');
+$abstract = chado_generate_var('pubprop', $values); 
+$abstract = chado_expand_var($abstract, 'field', 'pubprop.value');
 $abstract_text = '';
 if ($abstract) {
   $abstract_text = htmlspecialchars($abstract->value);
@@ -49,8 +49,8 @@ $values = array(
     'name' => 'Authors',
   ),
 );
-$authors = tripal_core_generate_chado_var('pubprop', $values); 
-$authors = tripal_core_expand_chado_vars($authors, 'field', 'pubprop.value');
+$authors = chado_generate_var('pubprop', $values); 
+$authors = chado_expand_var($authors, 'field', 'pubprop.value');
 $authors_list = 'N/A';
 if ($authors) {
   $authors_list = $authors->value;
@@ -58,7 +58,7 @@ if ($authors) {
 
 // get the first database cross-reference with a url
 $options = array('return_array' => 1);
-$pub = tripal_core_expand_chado_vars($pub, 'table', 'pub_dbxref', $options);
+$pub = chado_expand_var($pub, 'table', 'pub_dbxref', $options);
 $dbxref = NULL;
 if ($pub->pub_dbxref) { 
   foreach ($pub->pub_dbxref as $index => $pub_dbxref) {
@@ -77,8 +77,8 @@ $values = array(
   ),
 );
 $options = array('return_array' => 1);
-$urls = tripal_core_generate_chado_var('pubprop', $values, $options); 
-$urls = tripal_core_expand_chado_vars($urls, 'field', 'pubprop.value');
+$urls = chado_generate_var('pubprop', $values, $options); 
+$urls = chado_expand_var($urls, 'field', 'pubprop.value');
 $url = '';
 if (count($urls) > 0) {
   $url = $urls[0]->value; 

+ 1 - 1
tripal_pub/theme/templates/tripal_pub_featuremaps.tpl.php

@@ -20,7 +20,7 @@ $options = array(
   ),
 );
 
-$pub = tripal_core_expand_chado_vars($pub, 'table', 'featuremap_pub', $options);
+$pub = chado_expand_var($pub, 'table', 'featuremap_pub', $options);
 $featuremap_pubs = $pub->featuremap_pub;
 if (count($featuremap_pubs) > 0 ) {
   foreach ($featuremap_pubs as $featuremap_pub) {    

+ 1 - 1
tripal_pub/theme/templates/tripal_pub_features.tpl.php

@@ -20,7 +20,7 @@ $options = array(
   ),
 );
 
-$pub = tripal_core_expand_chado_vars($pub, 'table', 'feature_pub', $options);
+$pub = chado_expand_var($pub, 'table', 'feature_pub', $options);
 $feature_pubs = $pub->feature_pub;
 if (count($feature_pubs) > 0 ) {
   foreach ($feature_pubs as $feature_pub) {    

+ 1 - 1
tripal_pub/theme/templates/tripal_pub_libraries.tpl.php

@@ -20,7 +20,7 @@ $options = array(
   ),
 );
 
-$pub = tripal_core_expand_chado_vars($pub, 'table', 'library_pub', $options);
+$pub = chado_expand_var($pub, 'table', 'library_pub', $options);
 $library_pubs = $pub->library_pub;
 if (count($library_pubs) > 0 ) {
   foreach ($library_pubs as $library_pub) {    

+ 1 - 1
tripal_pub/theme/templates/tripal_pub_projects.tpl.php

@@ -20,7 +20,7 @@ $options = array(
   ),
 );
 
-$pub = tripal_core_expand_chado_vars($pub, 'table', 'project_pub', $options);
+$pub = chado_expand_var($pub, 'table', 'project_pub', $options);
 $project_pubs = $pub->project_pub;
 if (count($project_pubs) > 0 ) {
   foreach ($project_pubs as $project_pub) {    

+ 2 - 2
tripal_pub/theme/templates/tripal_pub_properties.tpl.php

@@ -6,7 +6,7 @@ $options = array(
   'return_array' => 1,
   'order_by' => array('rank' => 'ASC'),
 );
-$pub = tripal_core_expand_chado_vars($pub,'table', 'pubprop', $options);
+$pub = chado_expand_var($pub,'table', 'pubprop', $options);
 $pubprops = $pub->pubprop;
 $properties = array();
 if (is_array($pubprops)) {
@@ -19,7 +19,7 @@ if (is_array($pubprops)) {
         $property->type_id->name == 'Structured Abstract Part')  {
       continue;
     }
-    $property = tripal_core_expand_chado_vars($property,'field','pubprop.value');
+    $property = chado_expand_var($property,'field','pubprop.value');
     $properties[] = $property;
   }
 }

+ 1 - 1
tripal_pub/theme/templates/tripal_pub_references.tpl.php

@@ -4,7 +4,7 @@ $pub = $variables['node']->pub;
 
 // expand the pub object to include the records from the pub_dbxref table
 $options = array('return_array' => 1);
-$pub = tripal_core_expand_chado_vars($pub, 'table', 'pub_dbxref', $options);
+$pub = chado_expand_var($pub, 'table', 'pub_dbxref', $options);
 $pub_dbxrefs = $pub->pub_dbxref;
 
 $references = array();

+ 7 - 7
tripal_pub/theme/templates/tripal_pub_relationships.tpl.php

@@ -1,12 +1,12 @@
 <?php
 /* Typically in a Tripal template, the data needed is retrieved using a call to
- * tripal_core_expand_chado_vars function.  For example, to retrieve all 
+ * chado_expand_var function.  For example, to retrieve all 
  * of the pub relationships for this node, the following function call would be made:
  * 
- *   $pub = tripal_core_expand_chado_vars($pub,'table','pub_relationship');
+ *   $pub = chado_expand_var($pub,'table','pub_relationship');
  * 
  * However, this function call can be extremely slow when there are numerous relationships.
- * This is because the tripal_core_expand_chado_vars function is recursive and expands 
+ * This is because the chado_expand_var function is recursive and expands 
  * all data following the foreign key relationships tree.  Therefore, to speed retrieval
  * of data, a special variable is provided to this template:
  * 
@@ -55,8 +55,8 @@ if (count($object_rels) > 0 or count($subject_rels) > 0) { ?>
             'name' => 'Citation',
           ),
         );
-        $citation = tripal_core_generate_chado_var('pubprop', $values);
-        $citation = tripal_core_expand_chado_vars($citation, 'field', 'pubprop.value');
+        $citation = chado_generate_var('pubprop', $values);
+        $citation = chado_expand_var($citation, 'field', 'pubprop.value');
         
         $rows[] = array(
           $title . '<br>' . htmlspecialchars($citation->value),
@@ -116,8 +116,8 @@ if (count($object_rels) > 0 or count($subject_rels) > 0) { ?>
             'name' => 'Citation',
           ),
         );
-        $citation = tripal_core_generate_chado_var('pubprop', $values);
-        $citation = tripal_core_expand_chado_vars($citation, 'field', 'pubprop.value');
+        $citation = chado_generate_var('pubprop', $values);
+        $citation = chado_expand_var($citation, 'field', 'pubprop.value');
         
         $rows[] = array(
           $title . '<br>' . htmlspecialchars($citation->value),

+ 1 - 1
tripal_pub/theme/templates/tripal_pub_stocks.tpl.php

@@ -20,7 +20,7 @@ $options = array(
   ),
 );
 
-$pub = tripal_core_expand_chado_vars($pub, 'table', 'stock_pub', $options);
+$pub = chado_expand_var($pub, 'table', 'stock_pub', $options);
 $stock_pubs = $pub->stock_pub;
 if (count($stock_pubs) > 0 ) {
   foreach ($stock_pubs as $stock_pub) {    

+ 4 - 4
tripal_pub/theme/templates/tripal_pub_teaser.tpl.php

@@ -9,8 +9,8 @@ $values = array(
     'name' => 'Citation',
   ),
 );
-$citation = tripal_core_generate_chado_var('pubprop', $values); 
-$citation = tripal_core_expand_chado_vars($citation, 'field', 'pubprop.value'); 
+$citation = chado_generate_var('pubprop', $values); 
+$citation = chado_expand_var($citation, 'field', 'pubprop.value'); 
 
 // get the abstract
 $values = array(
@@ -19,8 +19,8 @@ $values = array(
     'name' => 'Abstract',
   ),
 );
-$abstract = tripal_core_generate_chado_var('pubprop', $values); 
-$abstract = tripal_core_expand_chado_vars($abstract, 'field', 'pubprop.value');
+$abstract = chado_generate_var('pubprop', $values); 
+$abstract = chado_expand_var($abstract, 'field', 'pubprop.value');
 $abstract_text = '';
 if ($abstract) {
   $abstract_text = htmlspecialchars($abstract->value);

+ 1 - 1
tripal_stock/theme/templates/tripal_organism_stocks.tpl.php

@@ -19,7 +19,7 @@ $options = array(
   ),
 );
 
-$organism = tripal_core_expand_chado_vars($organism, 'table', 'stock', $options);
+$organism = chado_expand_var($organism, 'table', 'stock', $options);
 $stocks = $organism->stock;
 
 // get the total number of records

+ 2 - 2
tripal_stock/theme/templates/tripal_stock_base.tpl.php

@@ -4,8 +4,8 @@ $organism = $node->stock->organism_id;
 $main_db_reference = $stock->dbxref_id;
 
 // expand the text fields
-$stock = tripal_core_expand_chado_vars($stock, 'field', 'stock.description');
-$stock = tripal_core_expand_chado_vars($stock, 'field', 'stock.uniquename'); ?>
+$stock = chado_expand_var($stock, 'field', 'stock.description');
+$stock = chado_expand_var($stock, 'field', 'stock.uniquename'); ?>
 
 <div class="tripal_stock-data-block-desc tripal-data-block-desc"></div> <?php  
 

+ 1 - 1
tripal_stock/theme/templates/tripal_stock_collections.tpl.php

@@ -3,7 +3,7 @@ $stock = $variables['node']->stock;
 
 // expand the stock object to include the stockcollections associated with this stock
 $options = array('return_array' => 1);
-$stock = tripal_core_expand_chado_vars($stock, 'table', 'stockcollection_stock', $options);
+$stock = chado_expand_var($stock, 'table', 'stockcollection_stock', $options);
 $collections = $stock->stockcollection_stock;
 
 if (count($collections) > 0) {?>

+ 3 - 3
tripal_stock/theme/templates/tripal_stock_properties.tpl.php

@@ -2,7 +2,7 @@
 
 $stock = $variables['node']->stock;
 $options = array('return_array' => 1);
-$stock = tripal_core_expand_chado_vars($stock, 'table', 'stockprop', $options);
+$stock = chado_expand_var($stock, 'table', 'stockprop', $options);
 $stockprops = $stock->stockprop;
 
 // the stock synonyms are stored in the stockprop table because we do not have
@@ -14,7 +14,7 @@ if ($stockprops) {
     // we want to keep all properties but the stock_description as that
     // property is shown on the base template page.
     if($property->type_id->name != 'synonym' and  $property->type_id->name != 'alias') {
-      $property = tripal_core_expand_chado_vars($property,'field','stockprop.value');
+      $property = chado_expand_var($property,'field','stockprop.value');
       $properties[] = $property;
     }
   }
@@ -34,7 +34,7 @@ if(count($properties) > 0){
   $rows = array();
   
   foreach ($properties as $property){
-    $property = tripal_core_expand_chado_vars($property,'field','stockprop.value');
+    $property = chado_expand_var($property,'field','stockprop.value');
     $rows[] = array(
       array('data' => ucfirst(preg_replace('/_/', ' ', $property->type_id->name)), 'width' => '20%'),
       urldecode($property->value)

+ 4 - 4
tripal_stock/theme/templates/tripal_stock_publications.tpl.php

@@ -3,7 +3,7 @@ $stock = $variables['node']->stock;
 
 // expand stock to include pubs 
 $options = array('return_array' => 1);
-$stock = tripal_core_expand_chado_vars($stock, 'table', 'stock_pub', $options);
+$stock = chado_expand_var($stock, 'table', 'stock_pub', $options);
 $stock_pubs = $stock->stock_pub; 
 
 
@@ -23,7 +23,7 @@ if (count($stock_pubs) > 0) { ?>
   
   foreach ($stock_pubs as $stock_pub) {
     $pub = $stock_pub->pub_id;
-    $pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.title');
+    $pub = chado_expand_var($pub, 'field', 'pub.title');
     $citation = $pub->title;  // use the title as the default citation
     
     // get the citation for this pub if it exists
@@ -34,9 +34,9 @@ if (count($stock_pubs) > 0) { ?>
       ),
     );
     $options = array('return_array' => 1);
-    $citation_prop = tripal_core_generate_chado_var('pubprop', $values, $options); 
+    $citation_prop = chado_generate_var('pubprop', $values, $options); 
     if (count($citation_prop) == 1) {
-      $citation_prop = tripal_core_expand_chado_vars($citation_prop, 'field', 'pubprop.value');
+      $citation_prop = chado_expand_var($citation_prop, 'field', 'pubprop.value');
       $citation = $citation_prop[0]->value;
     }
     

+ 1 - 1
tripal_stock/theme/templates/tripal_stock_references.tpl.php

@@ -10,7 +10,7 @@ if ($stock->dbxref_id) {
 
 // Second, expand the stock object to include the records from the stock_dbxref table
 $options = array('return_array' => 1);
-$stock = tripal_core_expand_chado_vars($stock, 'table', 'stock_dbxref', $options);
+$stock = chado_expand_var($stock, 'table', 'stock_dbxref', $options);
 $stock_dbxrefs = $stock->stock_dbxref;
 if (count($stock_dbxrefs) > 0 ) {
   foreach ($stock_dbxrefs as $stock_dbxref) {    

+ 3 - 3
tripal_stock/theme/templates/tripal_stock_relationships.tpl.php

@@ -1,12 +1,12 @@
 <?php
 /* Typically in a Tripal template, the data needed is retrieved using a call to
- * tripal_core_expand_chado_vars function.  For example, to retrieve all 
+ * chado_expand_var function.  For example, to retrieve all 
  * of the stock relationships for this node, the following function call would be made:
  * 
- *   $stock = tripal_core_expand_chado_vars($stock,'table','stock_relationship');
+ *   $stock = chado_expand_var($stock,'table','stock_relationship');
  * 
  * However, this function call can be extremely slow when there are numerous relationships.
- * This is because the tripal_core_expand_chado_vars function is recursive and expands 
+ * This is because the chado_expand_var function is recursive and expands 
  * all data following the foreign key relationships tree.  Therefore, to speed retrieval
  * of data, a special variable is provided to this template:
  * 

+ 1 - 1
tripal_stock/theme/templates/tripal_stock_synonyms.tpl.php

@@ -7,7 +7,7 @@ $synonyms = array();
 
 // expand the stock object to include the stockprop records
 $options = array('return_array' => 1);
-$stock = tripal_core_expand_chado_vars($stock, 'table', 'stockprop', $options);
+$stock = chado_expand_var($stock, 'table', 'stockprop', $options);
 $stockprops = $stock->stockprop;
 
 // iterate through all of the properties and pull out only the synonyms

+ 1 - 1
tripal_stock/theme/templates/tripal_stock_teaser.tpl.php

@@ -1,7 +1,7 @@
 <?php
 $node  = $variables['node'];
 $stock = $variables['node']->stock;
-$stock = tripal_core_expand_chado_vars($stock,'field','stock.description'); ?>
+$stock = chado_expand_var($stock,'field','stock.description'); ?>
 
 <div class="tripal_stock-teaser tripal-teaser"> 
   <div class="tripal-stock-teaser-title tripal-teaser-title"><?php