Browse Source

Removing CORE Deprecated functions

Lacey Sanderson 10 years ago
parent
commit
a36e57753a

+ 7 - 7
tripal_core/api/get_FKs.php

@@ -46,7 +46,7 @@ function get_chado_fk_relationships($version) {
   $v = $version;
   $v = $version;
   $v = preg_replace("/\./","_",$v);
   $v = preg_replace("/\./","_",$v);
 
 
-  $tables = tripal_core_get_chado_tables();
+  $tables = chado_get_table_names();
   $sql ="
   $sql ="
     SELECT
     SELECT
         tc.constraint_name, tc.table_name, kcu.column_name,
         tc.constraint_name, tc.table_name, kcu.column_name,
@@ -84,10 +84,10 @@ function get_chado_fk_relationships($version) {
  * the Drupal-style array definition for any table, use the following function
  * the Drupal-style array definition for any table, use the following function
  * call:
  * call:
  *
  *
- *   \$table_desc = tripal_core_get_chado_table_schema(\$table)
+ *   \$table_desc = chado_get_schema(\$table)
  *
  *
  * where the variable \$table contains the name of the table you want to
  * where the variable \$table contains the name of the table you want to
- * retireve.  The tripal_core_get_chado_table_schema function determines the appropriate version of
+ * retireve.  The chado_get_schema function determines the appropriate version of
  * Chado and uses the Drupal hook infrastructure to call the appropriate
  * Chado and uses the Drupal hook infrastructure to call the appropriate
  * hook function to retrieve the table schema.
  * hook function to retrieve the table schema.
  *
  *
@@ -100,7 +100,7 @@ function get_chado_fk_relationships($version) {
   foreach ($tables as $table) {
   foreach ($tables as $table) {
 
 
     // get the existing table array
     // get the existing table array
-    $table_arr = tripal_core_get_chado_table_schema($table);
+    $table_arr = chado_get_schema($table);
 
 
     if (empty($table_arr)) {
     if (empty($table_arr)) {
        print "ERROR: empty table definition $table\n";
        print "ERROR: empty table definition $table\n";
@@ -140,9 +140,9 @@ function get_chado_fk_relationships($version) {
 print "/**
 print "/**
  * Implements hook_chado_schema_v".$v."_".$table."()
  * Implements hook_chado_schema_v".$v."_".$table."()
  * Purpose: To describe the structure of '$table' to tripal
  * Purpose: To describe the structure of '$table' to tripal
- * @see tripal_core_chado_insert()
- * @see tripal_core_chado_update()
- * @see tripal_core_chado_select()
+ * @see chado_insert_record()
+ * @see chado_update_record()
+ * @see chado_select_record()
  *
  *
  * @return
  * @return
  *    An array describing the '$table' table
  *    An array describing the '$table' table

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

@@ -370,7 +370,7 @@ function chado_example_insert($node) {
   // we do need to proceed with the rest of the insert
   // we do need to proceed with the rest of the insert
   if (!property_exists($node, 'example_id')) {
   if (!property_exists($node, 'example_id')) {
 
 
-    // perform the insert using the tripal_core_chado_insert function();
+    // perform the insert using the chado_insert_record function();
     $values = array(
     $values = array(
       'uniquename' => $node->uniquename,
       'uniquename' => $node->uniquename,
       'description' => $node->description,
       'description' => $node->description,
@@ -574,13 +574,13 @@ function chado_example_load($nodes) {
     // cases it is probably best to let the end-user decide if text fields should
     // cases it is probably best to let the end-user decide if text fields should
     // be included by using this function in the templates.
     // be included by using this function in the templates.
     $example = chado_expand_var($example, 'field', 'example.description');
     $example = chado_expand_var($example, 'field', 'example.description');
-    
+
 
 
     // If your module is using the Chado Node: Title & Path API to allow custom titles
     // If your module is using the Chado Node: Title & Path API to allow custom titles
     // for your node type. Every time you want the title of the node, you need to use the
     // for your node type. Every time you want the title of the node, you need to use the
     // following API function:
     // following API function:
     $node->title = chado_get_node_title($node);
     $node->title = chado_get_node_title($node);
-    
+
     // add the new example object to this node.
     // add the new example object to this node.
     $nodes[$nid]->example = $example;
     $nodes[$nid]->example = $example;
   }
   }
@@ -653,10 +653,10 @@ function tripal_example_node_insert($node) {
   // it in the hook_insert()
   // it in the hook_insert()
   switch ($node->type) {
   switch ($node->type) {
     case 'chado_example':
     case 'chado_example':
-     
+
       // find the example and add in the details
       // find the example and add in the details
       $example_id = chado_get_id_from_nid('example', $nid);
       $example_id = chado_get_id_from_nid('example', $nid);
-      
+
       // build the example variable by using the chado_generate_var() function
       // build the example variable by using the chado_generate_var() function
       $values = array('example_id' => $example_id);
       $values = array('example_id' => $example_id);
       $example = chado_generate_var('example', $values);
       $example = chado_generate_var('example', $values);
@@ -777,9 +777,9 @@ function tripal_example_node_view($node, $view_mode, $langcode) {
           '#tripal_toc_id'    => 'relationships',
           '#tripal_toc_id'    => 'relationships',
           '#tripal_toc_title' => 'Relationships',
           '#tripal_toc_title' => 'Relationships',
         );
         );
-        
-        // Note: if you create a template that you do not want a user to 
-        // know where it is (discourage editing of it), you can add the following 
+
+        // Note: if you create a template that you do not want a user to
+        // know where it is (discourage editing of it), you can add the following
         // key:  '#tripal_template_show' => FALSE. If this key/value is set
         // key:  '#tripal_template_show' => FALSE. If this key/value is set
         // the the administrator message that Tripal provides indicating
         // the the administrator message that Tripal provides indicating
         // where the template is housed will not be shown.
         // where the template is housed will not be shown.

+ 7 - 7
tripal_feature/includes/tripal_feature.chado_node.inc

@@ -775,12 +775,12 @@ function tripal_feature_node_insert($node) {
     case 'chado_feature':
     case 'chado_feature':
 
 
       $feature_id = chado_get_id_from_nid('feature', $node->nid);
       $feature_id = chado_get_id_from_nid('feature', $node->nid);
-      
+
       // build the feature variable
       // build the feature variable
       $values = array('feature_id' => $feature_id);
       $values = array('feature_id' => $feature_id);
       $feature = chado_generate_var('feature', $values);
       $feature = chado_generate_var('feature', $values);
       $node->feature = $feature;
       $node->feature = $feature;
-      
+
       // on an insert we need to add the feature_id to the node object
       // on an insert we need to add the feature_id to the node object
       // so that the tripal_feature_get_feature_url function can set the URL properly
       // so that the tripal_feature_get_feature_url function can set the URL properly
       $node->feature_id = chado_get_id_from_nid('feature', $node->nid);
       $node->feature_id = chado_get_id_from_nid('feature', $node->nid);
@@ -811,14 +811,14 @@ function tripal_feature_node_update($node) {
   // add items to other nodes, build index and search results
   // add items to other nodes, build index and search results
   switch ($node->type) {
   switch ($node->type) {
     case 'chado_feature':
     case 'chado_feature':
-      
+
       $feature_id = chado_get_id_from_nid('feature', $node->nid);
       $feature_id = chado_get_id_from_nid('feature', $node->nid);
-      
+
       // build the feature variable
       // build the feature variable
       $values = array('feature_id' => $feature_id);
       $values = array('feature_id' => $feature_id);
       $feature = chado_generate_var('feature', $values);
       $feature = chado_generate_var('feature', $values);
       $node->feature = $feature;
       $node->feature = $feature;
-      
+
       // remove any previous alias
       // remove any previous alias
       db_query("DELETE FROM {url_alias} WHERE source = :source", array(':source' => "node/$node->nid"));
       db_query("DELETE FROM {url_alias} WHERE source = :source", array(':source' => "node/$node->nid"));
 
 
@@ -963,7 +963,7 @@ function tripal_feature_set_urls($na = NULL, $job = NULL) {
       // update the job status every 1% features
       // update the job status every 1% features
       if ($job and $num_set % $num_per_interval == 0) {
       if ($job and $num_set % $num_per_interval == 0) {
         $percent = ($num_set / $num_nodes) * 100;
         $percent = ($num_set / $num_nodes) * 100;
-        tripal_job_set_progress($job, intval($percent));
+        tripal_set_job_progress($job, intval($percent));
         $percent = sprintf("%.2f", $percent);
         $percent = sprintf("%.2f", $percent);
         print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
         print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
 
 
@@ -971,7 +971,7 @@ function tripal_feature_set_urls($na = NULL, $job = NULL) {
       $num_set++;
       $num_set++;
     }
     }
     $percent = ($num_set / $num_nodes) * 100;
     $percent = ($num_set / $num_nodes) * 100;
-    tripal_job_set_progress($job, intval($percent));
+    tripal_set_job_progress($job, intval($percent));
     $percent = sprintf("%.2f", $percent);
     $percent = sprintf("%.2f", $percent);
     print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
     print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
     print "\nDone. Set " . number_format($num_set) . " URLs\n";
     print "\nDone. Set " . number_format($num_set) . " URLs\n";

+ 37 - 37
tripal_feature/includes/tripal_feature.gff_loader.inc

@@ -314,62 +314,62 @@ function tripal_feature_gff3_load_form_submit($form, &$form_state) {
  *   Set to 1 if feature should be added only.  In the case where a feature
  *   Set to 1 if feature should be added only.  In the case where a feature
  *   already exists, it will not be updated.  Default is 0
  *   already exists, it will not be updated.  Default is 0
  * @param $update
  * @param $update
- *   Set to 1 to update existing features. New features will be added. Attributes 
- *   for a feature that are not present in the GFF but which are present in the 
+ *   Set to 1 to update existing features. New features will be added. Attributes
+ *   for a feature that are not present in the GFF but which are present in the
  *   database will not be altered. Default is 1
  *   database will not be altered. Default is 1
  * @param $refresh
  * @param $refresh
- *   Set to 1 to update existing features. New features will be added. Attributes 
- *   for a feature that are not present in the GFF but which are present in the 
+ *   Set to 1 to update existing features. New features will be added. Attributes
+ *   for a feature that are not present in the GFF but which are present in the
  *   database will be removed. Default is 0
  *   database will be removed. Default is 0
  * @param $remove
  * @param $remove
- *   Set to 1 to remove features present in the GFF file that exist in the database. 
+ *   Set to 1 to remove features present in the GFF file that exist in the database.
  *   Default is 0.
  *   Default is 0.
  * @param $use_transaction
  * @param $use_transaction
  *   Set to 1 to use a transaction when loading the GFF. Any failure during
  *   Set to 1 to use a transaction when loading the GFF. Any failure during
  *   loading will result in the rollback of any changes. Default is 1.
  *   loading will result in the rollback of any changes. Default is 1.
  * @param $target_organism_id
  * @param $target_organism_id
- *   If the GFF file contains a 'Target' attribute then the feature and the 
- *   target will have an alignment created, but to find the proper target 
- *   feature the target organism must also be known.  If different from the 
+ *   If the GFF file contains a 'Target' attribute then the feature and the
+ *   target will have an alignment created, but to find the proper target
+ *   feature the target organism must also be known.  If different from the
  *   organism specified for the GFF file, then use  this argument to specify
  *   organism specified for the GFF file, then use  this argument to specify
- *   the target organism.  Only use this argument if all target sequences belong 
- *   to the same species. If the targets in the GFF file belong to multiple 
- *   different species then the organism must be specified using the 
+ *   the target organism.  Only use this argument if all target sequences belong
+ *   to the same species. If the targets in the GFF file belong to multiple
+ *   different species then the organism must be specified using the
  *   'target_organism=genus:species' attribute in the GFF file. Default is NULL.
  *   'target_organism=genus:species' attribute in the GFF file. Default is NULL.
  * @param $target_type
  * @param $target_type
- *   If the GFF file contains a 'Target' attribute then the feature and the 
- *   target will have an alignment created, but to find the proper target 
- *   feature the target organism must also be known.  This can be used to 
+ *   If the GFF file contains a 'Target' attribute then the feature and the
+ *   target will have an alignment created, but to find the proper target
+ *   feature the target organism must also be known.  This can be used to
  *   specify the target feature type to help with identification of the target
  *   specify the target feature type to help with identification of the target
- *   feature.  Only use this argument if all target sequences types are the same. 
- *   If the targets are of different types then the type must be specified using 
- *   the 'target_type=type' attribute in the GFF file. This must be a valid 
+ *   feature.  Only use this argument if all target sequences types are the same.
+ *   If the targets are of different types then the type must be specified using
+ *   the 'target_type=type' attribute in the GFF file. This must be a valid
  *   Sequence Ontology (SO) term. Default is NULL
  *   Sequence Ontology (SO) term. Default is NULL
  * @param $create_target
  * @param $create_target
- *   Set to 1 to create the target feature if it cannot be found in the 
- *   database. Default is 0 
+ *   Set to 1 to create the target feature if it cannot be found in the
+ *   database. Default is 0
  * @param $start_line
  * @param $start_line
  *   Set this to the line in the GFF file where importing should start. This
  *   Set this to the line in the GFF file where importing should start. This
  *   is useful for testing and debugging GFF files that may have problems and
  *   is useful for testing and debugging GFF files that may have problems and
  *   you want to start at a particular line to speed testing.  Default = 1
  *   you want to start at a particular line to speed testing.  Default = 1
  * @param $landmark_type
  * @param $landmark_type
- *   Use this argument to specify a Sequence Ontology term name for the landmark 
- *   sequences in the GFF fie (e.g. 'chromosome'), if the GFF file contains a 
+ *   Use this argument to specify a Sequence Ontology term name for the landmark
+ *   sequences in the GFF fie (e.g. 'chromosome'), if the GFF file contains a
  *   '##sequence-region' line that describes the landmark sequences. Default = ''
  *   '##sequence-region' line that describes the landmark sequences. Default = ''
  * @param $alt_id_attr
  * @param $alt_id_attr
- *   Sometimes lines in the GFF file are missing the required ID attribute that 
- *   specifies the unique name of the feature. If so, you may specify the 
+ *   Sometimes lines in the GFF file are missing the required ID attribute that
+ *   specifies the unique name of the feature. If so, you may specify the
  *   name of an existing attribute to use for the ID.
  *   name of an existing attribute to use for the ID.
  * @param $create_organism
  * @param $create_organism
- *   The Tripal GFF loader supports the "organism" attribute. This allows 
- *   features of a different organism to be aligned to the landmark sequence of 
- *   another species. The format of the attribute is "organism=[genus]:[species]", 
- *   where [genus] is the organism's genus and [species] is the species name. 
- *   Check this box to automatically add the organism to the database if it does 
- *   not already exists. Otherwise lines with an oraganism attribute where the 
+ *   The Tripal GFF loader supports the "organism" attribute. This allows
+ *   features of a different organism to be aligned to the landmark sequence of
+ *   another species. The format of the attribute is "organism=[genus]:[species]",
+ *   where [genus] is the organism's genus and [species] is the species name.
+ *   Check this box to automatically add the organism to the database if it does
+ *   not already exists. Otherwise lines with an oraganism attribute where the
  *   organism is not present in the database will be skipped.
  *   organism is not present in the database will be skipped.
  * @param $job
  * @param $job
- *  The tripal job_id.  Only used by the Tripal Jobs subsystem. 
+ *  The tripal job_id.  Only used by the Tripal Jobs subsystem.
  *
  *
  * @ingroup gff3_loader
  * @ingroup gff3_loader
  */
  */
@@ -424,7 +424,7 @@ function tripal_feature_load_gff3($gff_file, $organism_id, $analysis_id,
     $sql = "SELECT * FROM {cv} WHERE name = :cvname";
     $sql = "SELECT * FROM {cv} WHERE name = :cvname";
     $cv = chado_query($sql, array(':cvname' => 'sequence'))->fetchObject();
     $cv = chado_query($sql, array(':cvname' => 'sequence'))->fetchObject();
     if (!$cv) {
     if (!$cv) {
-      tripal_report_error('T_gff3_loader', TRIPAL_ERROR, 
+      tripal_report_error('T_gff3_loader', TRIPAL_ERROR,
         "Cannot find the 'sequence' ontology", array());
         "Cannot find the 'sequence' ontology", array());
       return '';
       return '';
     }
     }
@@ -947,7 +947,7 @@ function tripal_feature_load_gff3($gff_file, $organism_id, $analysis_id,
     }
     }
   }
   }
   catch (Exception $e) {
   catch (Exception $e) {
-    print "\n"; // make sure we start errors on new line    
+    print "\n"; // make sure we start errors on new line
     if ($use_transaction) {
     if ($use_transaction) {
       $transaction->rollback();
       $transaction->rollback();
       print "FAILED: Rolling back database changes...\n";
       print "FAILED: Rolling back database changes...\n";
@@ -981,7 +981,7 @@ function tripal_feature_load_gff3_derives_from($feature, $subject, $organism) {
     'organism_id' => $organism->organism_id,
     'organism_id' => $organism->organism_id,
     'uniquename' => $subject,
     'uniquename' => $subject,
   );
   );
-  $result = tripal_core_chado_select('tripal_gff_temp', array('type_name'), $values);
+  $result = chado_select_record('tripal_gff_temp', array('type_name'), $values);
   $type_id = array();
   $type_id = array();
   if (count($result) > 0) {
   if (count($result) > 0) {
     $type_id = array(
     $type_id = array(
@@ -991,12 +991,12 @@ function tripal_feature_load_gff3_derives_from($feature, $subject, $organism) {
       ),
       ),
     );
     );
   }
   }
-  
+
   // if we don't have a subject type then look for the feature in the feature table
   // if we don't have a subject type then look for the feature in the feature table
   if (empty($type_id)) {
   if (empty($type_id)) {
-    $result = tripal_core_chado_select('feature', array('type_id'), $values);
+    $result = chado_select_record('feature', array('type_id'), $values);
     if (count($result) > 1) {
     if (count($result) > 1) {
-      watchdog("T_gff3_loader", "Cannot find subject type for feature,'%subject' , in 'derives_from' relationship. Multiple matching features exist with this uniquename.", 
+      watchdog("T_gff3_loader", "Cannot find subject type for feature,'%subject' , in 'derives_from' relationship. Multiple matching features exist with this uniquename.",
         array('%subject' => $subject), WATCHDOG_WARNING);
         array('%subject' => $subject), WATCHDOG_WARNING);
       return '';
       return '';
     }
     }
@@ -1562,7 +1562,7 @@ function tripal_feature_load_gff3_feature($organism, $analysis_id, $cvterm, $uni
     if (strcmp($score, '.') != 0) {
     if (strcmp($score, '.') != 0) {
       $af_values['significance'] = $score;
       $af_values['significance'] = $score;
     }
     }
-    if (!tripal_core_chado_insert('analysisfeature', $af_values)) {
+    if (!chado_insert_record('analysisfeature', $af_values)) {
       tripal_report_error("T_gff3_loader", TRIPAL_WARNING, "Could not add analysisfeature record: $analysis_id, $feature->feature_id", array());
       tripal_report_error("T_gff3_loader", TRIPAL_WARNING, "Could not add analysisfeature record: $analysis_id, $feature->feature_id", array());
     }
     }
   }
   }

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

@@ -11,7 +11,7 @@ $so_terms = explode(' ', $allowed_types);
 
 
 // get the feature_id's of the feature that belong to this organism.  But we only
 // get the feature_id's of the feature that belong to this organism.  But we only
 // want 25 and we want a pager to let the user cycle between pages of features.
 // want 25 and we want a pager to let the user cycle between pages of features.
-// so we, use the tripal_core_chado_select API function to get the results and
+// so we, use the chado_select_record API function to get the results and
 // generate the pager.  The function is smart enough to know which page the user is
 // generate the pager.  The function is smart enough to know which page the user is
 // on and retrieves the proper set of features
 // on and retrieves the proper set of features
 $element = 0;        // an index to specify the pager if more than one is on the page
 $element = 0;        // an index to specify the pager if more than one is on the page
@@ -25,12 +25,12 @@ $values = array(
 $columns = array('feature_id');
 $columns = array('feature_id');
 $options = array(
 $options = array(
   'pager' => array(
   'pager' => array(
-    'limit' => $num_per_page, 
+    'limit' => $num_per_page,
     'element' => $element
     'element' => $element
    ),
    ),
   'order_by' => array('name' => 'ASC'),
   'order_by' => array('name' => 'ASC'),
 );
 );
-$results = tripal_core_chado_select('feature', $columns, $values, $options);
+$results = chado_select_record('feature', $columns, $values, $options);
 
 
 // now that we have all of the feature IDs, we want to expand each one so that we
 // now that we have all of the feature IDs, we want to expand each one so that we
 // have all of the neccessary values, including the node ID, if one exists, and the
 // have all of the neccessary values, including the node ID, if one exists, and the
@@ -48,18 +48,18 @@ foreach ($results as $result) {
 
 
 if (count($features) > 0) { ?>
 if (count($features) > 0) { ?>
   <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following browser provides a quick view for new visitors.  Use the searching mechanism to find specific features.</div> <?php
   <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following browser provides a quick view for new visitors.  Use the searching mechanism to find specific features.</div> <?php
-  
+
   // the $headers array is an array of fields to use as the colum headers.
   // the $headers array is an array of fields to use as the colum headers.
   // additional documentation can be found here
   // additional documentation can be found here
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $headers = array('Feature Name' ,'Unique Name', 'Type');
   $headers = array('Feature Name' ,'Unique Name', 'Type');
-  
+
   // the $rows array contains an array of rows where each row is an array
   // the $rows array contains an array of rows where each row is an array
   // of values for each column of the table in that row.  Additional documentation
   // of values for each column of the table in that row.  Additional documentation
   // can be found here:
   // can be found here:
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $rows = array();
   $rows = array();
-  
+
   // let admins know they can customize the terms that appear in the list
   // let admins know they can customize the terms that appear in the list
   print tripal_set_message("Administrators, you can specify the feature types ".
   print tripal_set_message("Administrators, you can specify the feature types ".
     "that should appear in this browser or remove it from the list of resources ".
     "that should appear in this browser or remove it from the list of resources ".
@@ -68,7 +68,7 @@ if (count($features) > 0) { ?>
     TRIPAL_INFO,
     TRIPAL_INFO,
     array('return_html' => 1)
     array('return_html' => 1)
   );
   );
-  
+
   foreach ($features as $feature){
   foreach ($features as $feature){
     $fname =  $feature->name;
     $fname =  $feature->name;
     if (property_exists($feature, 'nid')) {
     if (property_exists($feature, 'nid')) {
@@ -79,7 +79,7 @@ if (count($features) > 0) { ?>
       $feature->uniquename,
       $feature->uniquename,
       $feature->type_id->name
       $feature->type_id->name
     );
     );
-  } 
+  }
   // the $table array contains the headers and rows array as well as other
   // the $table array contains the headers and rows array as well as other
   // options for controlling the display of the table.  Additional
   // options for controlling the display of the table.  Additional
   // documentation can be found here:
   // documentation can be found here:
@@ -99,8 +99,8 @@ if (count($features) > 0) { ?>
   // once we have our table array structure defined, we call Drupal's theme_table()
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
   // function to generate the table.
   print theme_table($table);
   print theme_table($table);
-  
-  // the $pager array values that control the behavior of the pager.  For 
+
+  // the $pager array values that control the behavior of the pager.  For
   // documentation on the values allows in this array see:
   // documentation on the values allows in this array see:
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
   // here we add the paramter 'block' => 'feature_browser'. This is because
   // here we add the paramter 'block' => 'feature_browser'. This is because
@@ -114,8 +114,8 @@ if (count($features) > 0) { ?>
     ),
     ),
     'quantity' => $num_per_page,
     'quantity' => $num_per_page,
   );
   );
-  print theme_pager($pager); 
-} 
+  print theme_pager($pager);
+}
 else {  ?>
 else {  ?>
   <p>There are no results.</p><?php
   <p>There are no results.</p><?php
   print tripal_set_message("
   print tripal_set_message("
@@ -134,7 +134,7 @@ else {  ?>
     <br>
     <br>
     <br>
     <br>
     You can specify the feature types
     You can specify the feature types
-    that should appear in this browser or remove it from the list of resources by navigating to the " . 
+    that should appear in this browser or remove it from the list of resources by navigating to the " .
     l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank')))  . "
     l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank')))  . "
     The feature browser will not appear to site visitors unless features are present. ",
     The feature browser will not appear to site visitors unless features are present. ",
     TRIPAL_INFO,
     TRIPAL_INFO,

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

@@ -4,7 +4,7 @@ $library = $variables['node']->library;
 
 
 // get the feature_id's of the features that belong to this library.  But we only
 // get the feature_id's of the features that belong to this library.  But we only
 // want 25 and we want a pager to let the user cycle between pages of features.
 // want 25 and we want a pager to let the user cycle between pages of features.
-// so we, use the tripal_core_chado_select API function to get the results and
+// so we, use the chado_select_record API function to get the results and
 // generate the pager.  The function is smart enough to know which page the user is
 // generate the pager.  The function is smart enough to know which page the user is
 // on and retrieves the proper set of features
 // on and retrieves the proper set of features
 $element = 0;        // an index to specify the pager if more than one is on the page
 $element = 0;        // an index to specify the pager if more than one is on the page
@@ -15,11 +15,11 @@ $values = array(
 $columns = array('feature_id');
 $columns = array('feature_id');
 $options = array(
 $options = array(
   'pager' => array(
   'pager' => array(
-    'limit' => $num_per_page, 
+    'limit' => $num_per_page,
     'element' => $element
     'element' => $element
    ),
    ),
 );
 );
-$results = tripal_core_chado_select('library_feature', $columns, $values, $options);
+$results = chado_select_record('library_feature', $columns, $values, $options);
 
 
 // now that we have all of the feature IDs, we want to expand each one so that we
 // now that we have all of the feature IDs, we want to expand each one so that we
 // have all of the neccessary values, including the node ID, if one exists, and the
 // have all of the neccessary values, including the node ID, if one exists, and the
@@ -37,12 +37,12 @@ foreach ($results as $library_feature) {
 
 
 if (count($features) > 0) { ?>
 if (count($features) > 0) { ?>
   <div class="tripal_library-data-block-desc tripal-data-block-desc">The following browser provides a quick view for new visitors.  Use the searching mechanism to find specific features.</div> <?php
   <div class="tripal_library-data-block-desc tripal-data-block-desc">The following browser provides a quick view for new visitors.  Use the searching mechanism to find specific features.</div> <?php
-  
+
   // the $headers array is an array of fields to use as the colum headers.
   // the $headers array is an array of fields to use as the colum headers.
   // additional documentation can be found here
   // additional documentation can be found here
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $headers = array('Feature Name' ,'Unique Name', 'Type');
   $headers = array('Feature Name' ,'Unique Name', 'Type');
-  
+
   // the $rows array contains an array of rows where each row is an array
   // the $rows array contains an array of rows where each row is an array
   // of values for each column of the table in that row.  Additional documentation
   // of values for each column of the table in that row.  Additional documentation
   // can be found here:
   // can be found here:
@@ -59,7 +59,7 @@ if (count($features) > 0) { ?>
       $feature->uniquename,
       $feature->uniquename,
       $feature->type_id->name
       $feature->type_id->name
     );
     );
-  } 
+  }
   // the $table array contains the headers and rows array as well as other
   // the $table array contains the headers and rows array as well as other
   // options for controlling the display of the table.  Additional
   // options for controlling the display of the table.  Additional
   // documentation can be found here:
   // documentation can be found here:
@@ -79,8 +79,8 @@ if (count($features) > 0) { ?>
   // once we have our table array structure defined, we call Drupal's theme_table()
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
   // function to generate the table.
   print theme_table($table);
   print theme_table($table);
-  
-  // the $pager array values that control the behavior of the pager.  For 
+
+  // the $pager array values that control the behavior of the pager.  For
   // documentation on the values allows in this array see:
   // documentation on the values allows in this array see:
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
   // here we add the paramter 'block' => 'feature_browser'. This is because
   // here we add the paramter 'block' => 'feature_browser'. This is because
@@ -94,8 +94,8 @@ if (count($features) > 0) { ?>
     ),
     ),
     'quantity' => $num_per_page,
     'quantity' => $num_per_page,
   );
   );
-  print theme_pager($pager); 
-} 
+  print theme_pager($pager);
+}
 
 
 
 
 
 

+ 7 - 7
tripal_project/includes/tripal_project.chado_node.inc

@@ -404,7 +404,7 @@ function chado_project_load($nodes) {
 
 
     // Now get the title
     // Now get the title
     $node->title = chado_get_node_title($node);
     $node->title = chado_get_node_title($node);
-      
+
   }
   }
 
 
 }
 }
@@ -524,7 +524,7 @@ function tripal_project_node_insert($node) {
   // know the project_id in the presave
   // know the project_id in the presave
   switch ($node->type) {
   switch ($node->type) {
     case 'chado_project':
     case 'chado_project':
-      
+
       // get the feature details from chado
       // get the feature details from chado
       $project_id = chado_get_id_from_nid('project', $node->nid);
       $project_id = chado_get_id_from_nid('project', $node->nid);
       $values = array('project_id' => $project_id);
       $values = array('project_id' => $project_id);
@@ -533,7 +533,7 @@ function tripal_project_node_insert($node) {
 
 
       // Now get the title
       // Now get the title
       $node->title = chado_get_node_title($node);
       $node->title = chado_get_node_title($node);
-      
+
       // on an insert we need to add the project_id to the node object
       // on an insert we need to add the project_id to the node object
       // so that the tripal_project_get_project_url function can set the URL properly
       // so that the tripal_project_get_project_url function can set the URL properly
       $node->project_id = $project_id;
       $node->project_id = $project_id;
@@ -566,10 +566,10 @@ function tripal_project_node_update($node) {
       $values = array('project_id' => $project_id);
       $values = array('project_id' => $project_id);
       $project = chado_generate_var('project', $values);
       $project = chado_generate_var('project', $values);
       $nodes->project = $project;
       $nodes->project = $project;
-      
+
       // Now get the title
       // Now get the title
       $node->title = chado_get_node_title($node);
       $node->title = chado_get_node_title($node);
-      
+
       // remove any previous alias
       // remove any previous alias
       db_query("DELETE FROM {url_alias} WHERE source = :source", array(':source' => "node/$node->nid"));
       db_query("DELETE FROM {url_alias} WHERE source = :source", array(':source' => "node/$node->nid"));
 
 
@@ -694,7 +694,7 @@ function tripal_project_set_urls($na = NULL, $job = NULL) {
       // update the job status every 1% projects
       // update the job status every 1% projects
       if ($job and $num_set % $num_per_interval == 0) {
       if ($job and $num_set % $num_per_interval == 0) {
         $percent = ($num_set / $num_nodes) * 100;
         $percent = ($num_set / $num_nodes) * 100;
-        tripal_job_set_progress($job, intval($percent));
+        tripal_set_job_progress($job, intval($percent));
         $percent = sprintf("%.2f", $percent);
         $percent = sprintf("%.2f", $percent);
         print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
         print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
 
 
@@ -702,7 +702,7 @@ function tripal_project_set_urls($na = NULL, $job = NULL) {
       $num_set++;
       $num_set++;
     }
     }
     $percent = ($num_set / $num_nodes) * 100;
     $percent = ($num_set / $num_nodes) * 100;
-    tripal_job_set_progress($job, intval($percent));
+    tripal_set_job_progress($job, intval($percent));
     $percent = sprintf("%.2f", $percent);
     $percent = sprintf("%.2f", $percent);
     print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
     print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
     print "\nDone. Set " . number_format($num_set) . " URLs\n";
     print "\nDone. Set " . number_format($num_set) . " URLs\n";

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

@@ -4,18 +4,18 @@ $featuremaps = array();
 
 
 // get the featuremaps that are associated with this publication.  But we only
 // get the featuremaps that are associated with this publication.  But we only
 // want 25 and we want a pager to let the user cycle between pages of featuremaps.
 // want 25 and we want a pager to let the user cycle between pages of featuremaps.
-// so we, use the tripal_core_chado_select API function to get the results and
+// so we, use the chado_select_record API function to get the results and
 // generate the pager.  The function is smart enough to know which page the user is
 // generate the pager.  The function is smart enough to know which page the user is
 // on and retrieves the proper set of featuremaps
 // on and retrieves the proper set of featuremaps
 
 
 $element = 1;        // an index to specify the pager this must be unique amongst all pub templates
 $element = 1;        // an index to specify the pager this must be unique amongst all pub templates
-$num_per_page = 25;  // the number of featuremaps to show per page$num_results_per_page = 25; 
+$num_per_page = 25;  // the number of featuremaps to show per page$num_results_per_page = 25;
 
 
 // get the featuremaps from the featuremap_pub table
 // get the featuremaps from the featuremap_pub table
-$options = array(  
+$options = array(
   'return_array' => 1,
   'return_array' => 1,
   'pager' => array(
   'pager' => array(
-    'limit'   => $num_per_page, 
+    'limit'   => $num_per_page,
     'element' => $element
     'element' => $element
   ),
   ),
 );
 );
@@ -23,7 +23,7 @@ $options = array(
 $pub = chado_expand_var($pub, 'table', 'featuremap_pub', $options);
 $pub = chado_expand_var($pub, 'table', 'featuremap_pub', $options);
 $featuremap_pubs = $pub->featuremap_pub;
 $featuremap_pubs = $pub->featuremap_pub;
 if (count($featuremap_pubs) > 0 ) {
 if (count($featuremap_pubs) > 0 ) {
-  foreach ($featuremap_pubs as $featuremap_pub) {    
+  foreach ($featuremap_pubs as $featuremap_pub) {
     $featuremaps[] = $featuremap_pub->featuremap_id;
     $featuremaps[] = $featuremap_pub->featuremap_id;
   }
   }
 }
 }
@@ -32,25 +32,25 @@ if (count($featuremap_pubs) > 0 ) {
 $total_records = chado_pager_get_count($element);
 $total_records = chado_pager_get_count($element);
 
 
 if(count($featuremaps) > 0){ ?>
 if(count($featuremaps) > 0){ ?>
-  <div class="tripal_pub-data-block-desc tripal-data-block-desc">This publication contains information about <?php print number_format($total_records) ?> maps:</div> <?php 
+  <div class="tripal_pub-data-block-desc tripal-data-block-desc">This publication contains information about <?php print number_format($total_records) ?> maps:</div> <?php
 
 
   // the $headers array is an array of fields to use as the colum headers.
   // the $headers array is an array of fields to use as the colum headers.
   // additional documentation can be found here
   // additional documentation can be found here
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $headers = array('Map Name');
   $headers = array('Map Name');
-  
+
   // the $rows array contains an array of rows where each row is an array
   // the $rows array contains an array of rows where each row is an array
   // of values for each column of the table in that row.  Additional documentation
   // of values for each column of the table in that row.  Additional documentation
   // can be found here:
   // can be found here:
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $rows = array();
   $rows = array();
-  
+
   foreach ($featuremaps as $featuremap){
   foreach ($featuremaps as $featuremap){
      $featuremap_name = $featuremap->name;
      $featuremap_name = $featuremap->name;
      if (property_exists($featuremap, 'nid')) {
      if (property_exists($featuremap, 'nid')) {
        $featuremap_name = l($featuremap_name, 'node/' . $featuremap->nid, array('attributes' => array('target' => '_blank')));
        $featuremap_name = l($featuremap_name, 'node/' . $featuremap->nid, array('attributes' => array('target' => '_blank')));
      }
      }
-     
+
      $rows[] = array(
      $rows[] = array(
        $featuremap_name,
        $featuremap_name,
      );
      );
@@ -74,7 +74,7 @@ if(count($featuremaps) > 0){ ?>
   // once we have our table array structure defined, we call Drupal's theme_table()
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
   // function to generate the table.
   print theme_table($table);
   print theme_table($table);
-  
+
   // the $pager array values that control the behavior of the pager.  For
   // the $pager array values that control the behavior of the pager.  For
   // documentation on the values allows in this array see:
   // documentation on the values allows in this array see:
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
@@ -89,6 +89,6 @@ if(count($featuremaps) > 0){ ?>
     ),
     ),
     'quantity' => $num_per_page,
     'quantity' => $num_per_page,
   );
   );
-  print theme_pager($pager); 
+  print theme_pager($pager);
 }?>
 }?>
 
 

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

@@ -4,18 +4,18 @@ $features = array();
 
 
 // get the features that are associated with this publication.  But we only
 // get the features that are associated with this publication.  But we only
 // want 25 and we want a pager to let the user cycle between pages of features.
 // want 25 and we want a pager to let the user cycle between pages of features.
-// so we, use the tripal_core_chado_select API function to get the results and
+// so we, use the chado_select_record API function to get the results and
 // generate the pager.  The function is smart enough to know which page the user is
 // generate the pager.  The function is smart enough to know which page the user is
 // on and retrieves the proper set of features
 // on and retrieves the proper set of features
 
 
 $element = 2;        // an index to specify the pager this must be unique amongst all pub templates
 $element = 2;        // an index to specify the pager this must be unique amongst all pub templates
-$num_per_page = 25;  // the number of features to show per page$num_results_per_page = 25; 
+$num_per_page = 25;  // the number of features to show per page$num_results_per_page = 25;
 
 
 // get the features from the feature_pub table
 // get the features from the feature_pub table
-$options = array(  
+$options = array(
   'return_array' => 1,
   'return_array' => 1,
   'pager' => array(
   'pager' => array(
-    'limit'   => $num_per_page, 
+    'limit'   => $num_per_page,
     'element' => $element
     'element' => $element
   ),
   ),
 );
 );
@@ -23,7 +23,7 @@ $options = array(
 $pub = chado_expand_var($pub, 'table', 'feature_pub', $options);
 $pub = chado_expand_var($pub, 'table', 'feature_pub', $options);
 $feature_pubs = $pub->feature_pub;
 $feature_pubs = $pub->feature_pub;
 if (count($feature_pubs) > 0 ) {
 if (count($feature_pubs) > 0 ) {
-  foreach ($feature_pubs as $feature_pub) {    
+  foreach ($feature_pubs as $feature_pub) {
     $features[] = $feature_pub->feature_id;
     $features[] = $feature_pub->feature_id;
   }
   }
 }
 }
@@ -32,25 +32,25 @@ if (count($feature_pubs) > 0 ) {
 $total_records = chado_pager_get_count($element);
 $total_records = chado_pager_get_count($element);
 
 
 if(count($features) > 0){ ?>
 if(count($features) > 0){ ?>
-  <div class="tripal_pub-data-block-desc tripal-data-block-desc">This publication contains information about <?php print number_format($total_records) ?> features:</div> <?php 
+  <div class="tripal_pub-data-block-desc tripal-data-block-desc">This publication contains information about <?php print number_format($total_records) ?> features:</div> <?php
 
 
   // the $headers array is an array of fields to use as the colum headers.
   // the $headers array is an array of fields to use as the colum headers.
   // additional documentation can be found here
   // additional documentation can be found here
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $headers = array('Feature Name', 'Uniquenaem', 'Type');
   $headers = array('Feature Name', 'Uniquenaem', 'Type');
-  
+
   // the $rows array contains an array of rows where each row is an array
   // the $rows array contains an array of rows where each row is an array
   // of values for each column of the table in that row.  Additional documentation
   // of values for each column of the table in that row.  Additional documentation
   // can be found here:
   // can be found here:
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $rows = array();
   $rows = array();
-  
+
   foreach ($features as $feature){
   foreach ($features as $feature){
      $feature_name = $feature->name;
      $feature_name = $feature->name;
      if (property_exists($feature, 'nid')) {
      if (property_exists($feature, 'nid')) {
        $feature_name = l($feature_name, 'node/' . $feature->nid, array('attributes' => array('target' => '_blank')));
        $feature_name = l($feature_name, 'node/' . $feature->nid, array('attributes' => array('target' => '_blank')));
      }
      }
-     
+
      $rows[] = array(
      $rows[] = array(
        $feature_name,
        $feature_name,
        $feature->uniquename,
        $feature->uniquename,
@@ -76,7 +76,7 @@ if(count($features) > 0){ ?>
   // once we have our table array structure defined, we call Drupal's theme_table()
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
   // function to generate the table.
   print theme_table($table);
   print theme_table($table);
-  
+
   // the $pager array values that control the behavior of the pager.  For
   // the $pager array values that control the behavior of the pager.  For
   // documentation on the values allows in this array see:
   // documentation on the values allows in this array see:
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
@@ -91,6 +91,6 @@ if(count($features) > 0){ ?>
     ),
     ),
     'quantity' => $num_per_page,
     'quantity' => $num_per_page,
   );
   );
-  print theme_pager($pager);  
+  print theme_pager($pager);
 }
 }
 
 

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

@@ -4,18 +4,18 @@ $libraries = array();
 
 
 // get the libraries that are associated with this publication.  But we only
 // get the libraries that are associated with this publication.  But we only
 // want 25 and we want a pager to let the user cycle between pages of libraries.
 // want 25 and we want a pager to let the user cycle between pages of libraries.
-// so we, use the tripal_core_chado_select API function to get the results and
+// so we, use the chado_select_record API function to get the results and
 // generate the pager.  The function is smart enough to know which page the user is
 // generate the pager.  The function is smart enough to know which page the user is
 // on and retrieves the proper set of libraries
 // on and retrieves the proper set of libraries
 
 
 $element = 3;        // an index to specify the pager this must be unique amongst all pub templates
 $element = 3;        // an index to specify the pager this must be unique amongst all pub templates
-$num_per_page = 25;  // the number of libraries to show per page$num_results_per_page = 25; 
+$num_per_page = 25;  // the number of libraries to show per page$num_results_per_page = 25;
 
 
 // get the libraries from the library_pub table
 // get the libraries from the library_pub table
-$options = array(  
+$options = array(
   'return_array' => 1,
   'return_array' => 1,
   'pager' => array(
   'pager' => array(
-    'limit'   => $num_per_page, 
+    'limit'   => $num_per_page,
     'element' => $element
     'element' => $element
   ),
   ),
 );
 );
@@ -23,7 +23,7 @@ $options = array(
 $pub = chado_expand_var($pub, 'table', 'library_pub', $options);
 $pub = chado_expand_var($pub, 'table', 'library_pub', $options);
 $library_pubs = $pub->library_pub;
 $library_pubs = $pub->library_pub;
 if (count($library_pubs) > 0 ) {
 if (count($library_pubs) > 0 ) {
-  foreach ($library_pubs as $library_pub) {    
+  foreach ($library_pubs as $library_pub) {
     $libraries[] = $library_pub->library_id;
     $libraries[] = $library_pub->library_id;
   }
   }
 }
 }
@@ -32,19 +32,19 @@ if (count($library_pubs) > 0 ) {
 $total_records = chado_pager_get_count($element);
 $total_records = chado_pager_get_count($element);
 
 
 if(count($libraries) > 0){ ?>
 if(count($libraries) > 0){ ?>
-  <div class="tripal_pub-data-block-desc tripal-data-block-desc">This publication contains information about <?php print number_format($total_records) ?> libraries:</div> <?php 
+  <div class="tripal_pub-data-block-desc tripal-data-block-desc">This publication contains information about <?php print number_format($total_records) ?> libraries:</div> <?php
 
 
   // the $headers array is an array of fields to use as the colum headers.
   // the $headers array is an array of fields to use as the colum headers.
   // additional documentation can be found here
   // additional documentation can be found here
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $headers = array('Library Name', 'Unique Name', 'Organism');
   $headers = array('Library Name', 'Unique Name', 'Organism');
-  
+
   // the $rows array contains an array of rows where each row is an array
   // the $rows array contains an array of rows where each row is an array
   // of values for each column of the table in that row.  Additional documentation
   // of values for each column of the table in that row.  Additional documentation
   // can be found here:
   // can be found here:
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $rows = array();
   $rows = array();
-  
+
   foreach ($libraries as $library){
   foreach ($libraries as $library){
      $library_name = $library->name;
      $library_name = $library->name;
      if (property_exists($library, 'nid')) {
      if (property_exists($library, 'nid')) {
@@ -79,7 +79,7 @@ if(count($libraries) > 0){ ?>
   // once we have our table array structure defined, we call Drupal's theme_table()
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
   // function to generate the table.
   print theme_table($table);
   print theme_table($table);
-  
+
   // the $pager array values that control the behavior of the pager.  For
   // the $pager array values that control the behavior of the pager.  For
   // documentation on the values allows in this array see:
   // documentation on the values allows in this array see:
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
@@ -94,6 +94,6 @@ if(count($libraries) > 0){ ?>
     ),
     ),
     'quantity' => $num_per_page,
     'quantity' => $num_per_page,
   );
   );
-  print theme_pager($pager); 
+  print theme_pager($pager);
 }
 }
 
 

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

@@ -4,18 +4,18 @@ $projects = array();
 
 
 // get the features that are associated with this publication.  But we only
 // get the features that are associated with this publication.  But we only
 // want 25 and we want a pager to let the user cycle between pages of features.
 // want 25 and we want a pager to let the user cycle between pages of features.
-// so we, use the tripal_core_chado_select API function to get the results and
+// so we, use the chado_select_record API function to get the results and
 // generate the pager.  The function is smart enough to know which page the user is
 // generate the pager.  The function is smart enough to know which page the user is
 // on and retrieves the proper set of features
 // on and retrieves the proper set of features
 
 
 $element = 4;        // an index to specify the pager this must be unique amongst all pub templates
 $element = 4;        // an index to specify the pager this must be unique amongst all pub templates
-$num_per_page = 25;  // the number of projects to show per page$num_results_per_page = 25; 
+$num_per_page = 25;  // the number of projects to show per page$num_results_per_page = 25;
 
 
 // get the projects from the project_pub table
 // get the projects from the project_pub table
-$options = array(  
+$options = array(
   'return_array' => 1,
   'return_array' => 1,
   'pager' => array(
   'pager' => array(
-    'limit'   => $num_per_page, 
+    'limit'   => $num_per_page,
     'element' => $element
     'element' => $element
   ),
   ),
 );
 );
@@ -23,7 +23,7 @@ $options = array(
 $pub = chado_expand_var($pub, 'table', 'project_pub', $options);
 $pub = chado_expand_var($pub, 'table', 'project_pub', $options);
 $project_pubs = $pub->project_pub;
 $project_pubs = $pub->project_pub;
 if (count($project_pubs) > 0 ) {
 if (count($project_pubs) > 0 ) {
-  foreach ($project_pubs as $project_pub) {    
+  foreach ($project_pubs as $project_pub) {
     $projects[] = $project_pub->project_id;
     $projects[] = $project_pub->project_id;
   }
   }
 }
 }
@@ -32,19 +32,19 @@ if (count($project_pubs) > 0 ) {
 $total_records = chado_pager_get_count($element);
 $total_records = chado_pager_get_count($element);
 
 
 if(count($projects) > 0){ ?>
 if(count($projects) > 0){ ?>
-  <div class="tripal_pub-data-block-desc tripal-data-block-desc">This publication contains information about <?php print number_format($total_records) ?> projects:</div> <?php 
+  <div class="tripal_pub-data-block-desc tripal-data-block-desc">This publication contains information about <?php print number_format($total_records) ?> projects:</div> <?php
 
 
   // the $headers array is an array of fields to use as the colum headers.
   // the $headers array is an array of fields to use as the colum headers.
   // additional documentation can be found here
   // additional documentation can be found here
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $headers = array('Project Name', 'Description');
   $headers = array('Project Name', 'Description');
-  
+
   // the $rows array contains an array of rows where each row is an array
   // the $rows array contains an array of rows where each row is an array
   // of values for each column of the table in that row.  Additional documentation
   // of values for each column of the table in that row.  Additional documentation
   // can be found here:
   // can be found here:
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $rows = array();
   $rows = array();
-  
+
   foreach ($projects as $project){
   foreach ($projects as $project){
      $project_name = $project->name;
      $project_name = $project->name;
      if (property_exists($project, 'nid')) {
      if (property_exists($project, 'nid')) {
@@ -53,7 +53,7 @@ if(count($projects) > 0){ ?>
      $description =  substr($project->description, 0, 200);
      $description =  substr($project->description, 0, 200);
      if (strlen($project->description) > 200) {
      if (strlen($project->description) > 200) {
        $description .= "... " . l("[more]", 'node/' . $project->nid, array('attributes' => array('target' => '_blank')));
        $description .= "... " . l("[more]", 'node/' . $project->nid, array('attributes' => array('target' => '_blank')));
-     } 
+     }
      $rows[] = array(
      $rows[] = array(
        $project_name,
        $project_name,
        $description
        $description
@@ -78,7 +78,7 @@ if(count($projects) > 0){ ?>
   // once we have our table array structure defined, we call Drupal's theme_table()
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
   // function to generate the table.
   print theme_table($table);
   print theme_table($table);
-  
+
   // the $pager array values that control the behavior of the pager.  For
   // the $pager array values that control the behavior of the pager.  For
   // documentation on the values allows in this array see:
   // documentation on the values allows in this array see:
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
@@ -93,6 +93,6 @@ if(count($projects) > 0){ ?>
     ),
     ),
     'quantity' => $num_per_page,
     'quantity' => $num_per_page,
   );
   );
-  print theme_pager($pager);  
+  print theme_pager($pager);
 }
 }
 
 

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

@@ -4,18 +4,18 @@ $stocks = array();
 
 
 // get the stocks that are associated with this publication.  But we only
 // get the stocks that are associated with this publication.  But we only
 // want 25 and we want a pager to let the user cycle between pages of stocks.
 // want 25 and we want a pager to let the user cycle between pages of stocks.
-// so we, use the tripal_core_chado_select API function to get the results and
+// so we, use the chado_select_record API function to get the results and
 // generate the pager.  The function is smart enough to know which page the user is
 // generate the pager.  The function is smart enough to know which page the user is
 // on and retrieves the proper set of stocks
 // on and retrieves the proper set of stocks
 
 
 $element = 5;        // an index to specify the pager this must be unique amongst all pub templates
 $element = 5;        // an index to specify the pager this must be unique amongst all pub templates
-$num_per_page = 25;  // the number of stocks to show per page$num_results_per_page = 25; 
+$num_per_page = 25;  // the number of stocks to show per page$num_results_per_page = 25;
 
 
 // get the stocks from the stock_pub table
 // get the stocks from the stock_pub table
-$options = array(  
+$options = array(
   'return_array' => 1,
   'return_array' => 1,
   'pager' => array(
   'pager' => array(
-    'limit'   => $num_per_page, 
+    'limit'   => $num_per_page,
     'element' => $element
     'element' => $element
   ),
   ),
 );
 );
@@ -23,7 +23,7 @@ $options = array(
 $pub = chado_expand_var($pub, 'table', 'stock_pub', $options);
 $pub = chado_expand_var($pub, 'table', 'stock_pub', $options);
 $stock_pubs = $pub->stock_pub;
 $stock_pubs = $pub->stock_pub;
 if (count($stock_pubs) > 0 ) {
 if (count($stock_pubs) > 0 ) {
-  foreach ($stock_pubs as $stock_pub) {    
+  foreach ($stock_pubs as $stock_pub) {
     $stocks[] = $stock_pub->stock_id;
     $stocks[] = $stock_pub->stock_id;
   }
   }
 }
 }
@@ -32,25 +32,25 @@ if (count($stock_pubs) > 0 ) {
 $total_records = chado_pager_get_count($element);
 $total_records = chado_pager_get_count($element);
 
 
 if(count($stocks) > 0){ ?>
 if(count($stocks) > 0){ ?>
-  <div class="tripal_pub-data-block-desc tripal-data-block-desc">This publication contains information about <?php print number_format($total_records) ?> stocks:</div> <?php 
+  <div class="tripal_pub-data-block-desc tripal-data-block-desc">This publication contains information about <?php print number_format($total_records) ?> stocks:</div> <?php
 
 
   // the $headers array is an array of fields to use as the colum headers.
   // the $headers array is an array of fields to use as the colum headers.
   // additional documentation can be found here
   // additional documentation can be found here
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $headers = array('Stock Name', 'Uniquenaem', 'Type');
   $headers = array('Stock Name', 'Uniquenaem', 'Type');
-  
+
   // the $rows array contains an array of rows where each row is an array
   // the $rows array contains an array of rows where each row is an array
   // of values for each column of the table in that row.  Additional documentation
   // of values for each column of the table in that row.  Additional documentation
   // can be found here:
   // can be found here:
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $rows = array();
   $rows = array();
-  
+
   foreach ($stocks as $stock){
   foreach ($stocks as $stock){
      $stock_name = $stock->name;
      $stock_name = $stock->name;
      if (property_exists($stock, 'nid')) {
      if (property_exists($stock, 'nid')) {
        $stock_name = l($stock_name, 'node/' . $stock->nid, array('attributes' => array('target' => '_blank')));
        $stock_name = l($stock_name, 'node/' . $stock->nid, array('attributes' => array('target' => '_blank')));
      }
      }
-     
+
      $rows[] = array(
      $rows[] = array(
        $stock_name,
        $stock_name,
        $stock->uniquename,
        $stock->uniquename,
@@ -76,7 +76,7 @@ if(count($stocks) > 0){ ?>
   // once we have our table array structure defined, we call Drupal's theme_table()
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
   // function to generate the table.
   print theme_table($table);
   print theme_table($table);
-  
+
   // the $pager array values that control the behavior of the pager.  For
   // the $pager array values that control the behavior of the pager.  For
   // documentation on the values allows in this array see:
   // documentation on the values allows in this array see:
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
   // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
@@ -91,6 +91,6 @@ if(count($stocks) > 0){ ?>
     ),
     ),
     'quantity' => $num_per_page,
     'quantity' => $num_per_page,
   );
   );
-  print theme_pager($pager); 
+  print theme_pager($pager);
 }
 }
 
 

+ 5 - 5
tripal_stock/includes/tripal_stock.chado_node.inc

@@ -472,7 +472,7 @@ function chado_stock_insert($node) {
           'db_id' => $node->database,
           'db_id' => $node->database,
           'accession' => $node->accession,
           'accession' => $node->accession,
         );
         );
-        if (!tripal_core_chado_select('dbxref', array('dbxref_id'), $values)) {
+        if (!chado_select_record('dbxref', array('dbxref_id'), $values)) {
           $values['description'] = $node->db_description;
           $values['description'] = $node->db_description;
           $values['version'] = '1';
           $values['version'] = '1';
           $dbxref_status = chado_insert_record('dbxref', $values);
           $dbxref_status = chado_insert_record('dbxref', $values);
@@ -888,7 +888,7 @@ function tripal_stock_node_insert($node) {
   // know the stock_id in the presave
   // know the stock_id in the presave
   switch ($node->type) {
   switch ($node->type) {
     case 'chado_stock':
     case 'chado_stock':
-      
+
       // get the feature details from chado
       // get the feature details from chado
       $stock_id = chado_get_id_from_nid('stock', $node->nid);
       $stock_id = chado_get_id_from_nid('stock', $node->nid);
       $values = array('stock_id' => $stock_id);
       $values = array('stock_id' => $stock_id);
@@ -928,7 +928,7 @@ function tripal_stock_node_update($node) {
   // add items to other nodes, build index and search results
   // add items to other nodes, build index and search results
   switch ($node->type) {
   switch ($node->type) {
     case 'chado_stock':
     case 'chado_stock':
-      
+
       // get the feature details from chado
       // get the feature details from chado
       $stock_id = chado_get_id_from_nid('stock', $node->nid);
       $stock_id = chado_get_id_from_nid('stock', $node->nid);
       $values = array('stock_id' => $stock_id);
       $values = array('stock_id' => $stock_id);
@@ -1081,7 +1081,7 @@ function tripal_stock_set_urls($na = NULL, $job = NULL) {
       // update the job status every 1% stocks
       // update the job status every 1% stocks
       if ($job and $num_set % $num_per_interval == 0) {
       if ($job and $num_set % $num_per_interval == 0) {
         $percent = ($num_set / $num_nodes) * 100;
         $percent = ($num_set / $num_nodes) * 100;
-        tripal_job_set_progress($job, intval($percent));
+        tripal_set_job_progress($job, intval($percent));
         $percent = sprintf("%.2f", $percent);
         $percent = sprintf("%.2f", $percent);
         print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
         print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
 
 
@@ -1089,7 +1089,7 @@ function tripal_stock_set_urls($na = NULL, $job = NULL) {
       $num_set++;
       $num_set++;
     }
     }
     $percent = ($num_set / $num_nodes) * 100;
     $percent = ($num_set / $num_nodes) * 100;
-    tripal_job_set_progress($job, intval($percent));
+    tripal_set_job_progress($job, intval($percent));
     $percent = sprintf("%.2f", $percent);
     $percent = sprintf("%.2f", $percent);
     print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
     print "Setting URLs (" . $percent . "%). Memory: " . number_format(memory_get_usage()) . " bytes.\r";
     print "\nDone. Set " . number_format($num_set) . " URLs\n";
     print "\nDone. Set " . number_format($num_set) . " URLs\n";

+ 1 - 1
tripal_views/tripal_views.views.inc

@@ -554,7 +554,7 @@ function tripal_views_views_data_alter(&$data) {
       $base_title = ucwords(str_replace('_', ' ', $base_table));
       $base_title = ucwords(str_replace('_', ' ', $base_table));
 
 
       // add in joins to the node tables if the Chado schema is local
       // add in joins to the node tables if the Chado schema is local
-      if (tripal_core_chado_schema_exists()) {
+      if (chado_is_local()) {
         // if a node linking table exists then add in the joins
         // if a node linking table exists then add in the joins
         if (db_table_exists($linker_table)) {
         if (db_table_exists($linker_table)) {